Skip to content

Commit

Permalink
pitivi/ui/sourcelist.py: make insert key sensitive with both views
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Griffiths authored and bilboed committed Feb 8, 2010
1 parent 84ba6ff commit 5ed8769
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pitivi/ui/sourcelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(self, instance, uiman):
self.treeview.set_property("search_column", COL_SEARCH_TEXT)
tsel = self.treeview.get_selection()
tsel.set_mode(gtk.SELECTION_MULTIPLE)
tsel.connect("changed", self._treeSelectionChanged)
tsel.connect("changed", self._viewSelectionChangedCb)

pixbufcol = gtk.TreeViewColumn(_("Icon"))
pixbufcol.set_expand(False)
Expand Down Expand Up @@ -195,6 +195,7 @@ def __init__(self, instance, uiman):
self.iconview = gtk.IconView(self.storemodel)
self.iconview_scrollwin.add(self.iconview)
self.iconview.connect("button-press-event", self._iconViewButtonPressEventCb)
self.iconview.connect("selection-changed", self._viewSelectionChangedCb)
self.iconview.set_orientation(gtk.ORIENTATION_VERTICAL)
self.iconview.set_text_column(COL_SHORT_TEXT)
self.iconview.set_pixbuf_column(COL_ICON_LARGE)
Expand Down Expand Up @@ -780,8 +781,8 @@ def _treeViewButtonReleaseCb(self, treeview, event):
treeview.get_selection().select_path(path)
return False

def _treeSelectionChanged(self, tsel):
if self.getSelectedItemsTreeView():
def _viewSelectionChangedCb(self, unused):
if self._viewHasSelection():
self.selection_actions.set_sensitive(True)
else:
self.selection_actions.set_sensitive(False)
Expand Down

0 comments on commit 5ed8769

Please sign in to comment.