~mmcg069/software-center/details-tweaks

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/panes/viewswitcher.py

  • Committer: Matthew McGowan
  • Date: 2011-08-22 09:26:30 UTC
  • mfrom: (2131.1.28 software-center)
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110822092630-yqbaa7zhljgo4zqe
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
_last_button = None
41
41
class ViewSwitcher(Gtk.Box):
42
42
 
43
 
    __gsignals__ = {
44
 
        "view-changed" : (GObject.SignalFlags.RUN_LAST,
45
 
                          None, 
46
 
                          (GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT),
47
 
                         ),
48
 
    }
49
 
 
50
 
 
51
43
    ICON_SIZE = Gtk.IconSize.LARGE_TOOLBAR
52
44
 
53
45
    def __init__(self, view_manager, datadir, db, cache, icons):
54
46
        # boring stuff
55
47
        self.view_manager = view_manager
 
48
        def on_view_changed(widget, view_id):
 
49
            self.view_buttons[view_id].set_active(True)
 
50
        self.view_manager.connect('view-changed', on_view_changed)
56
51
        self.channel_manager = get_channels_manager(db)
57
52
 
58
53
        # backend sig handlers ...
139
134
            self.on_channels_changed()
140
135
        return
141
136
 
142
 
    def on_section_sel_clicked(self, button, view_id):
 
137
    def on_section_sel_clicked(self, button, event, view_id):
143
138
        # mvo: this check causes bug LP: #828675
144
139
        #if self._prev_view is view_id:
145
140
        #    return True
196
191
        # to the group, toggled & clicked gets emitted... causing
197
192
        # all panes to fully initialise on USC startup, which is
198
193
        # undesirable!
199
 
        btn.connect("clicked", self.on_section_sel_clicked, view_id)
 
194
        btn.connect("button-release-event", self.on_section_sel_clicked, view_id)
200
195
        return btn
201
196
 
202
197
    def append_channel_selector(self, section_btn, view_id, build_func):