[pitivi] pitivi/ui/sourcelist.py: use nautilus behaviour for right-click modifiers
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] pitivi/ui/sourcelist.py: use nautilus behaviour for right-click modifiers
- Date: Mon, 8 Feb 2010 16:49:19 +0000 (UTC)
commit 84ba6ffe80e0cca607bad4e33885bdd2c75e52db
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Fri Feb 5 17:02:54 2010 -0800
pitivi/ui/sourcelist.py: use nautilus behaviour for right-click modifiers
pitivi/ui/sourcelist.py | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/ui/sourcelist.py b/pitivi/ui/sourcelist.py
index 754c7f6..51f450e 100644
--- a/pitivi/ui/sourcelist.py
+++ b/pitivi/ui/sourcelist.py
@@ -677,7 +677,16 @@ class SourceList(gtk.VBox, Loggable):
self.popup_remitem.set_sensitive(True)
self.popup_playmenuitem.set_sensitive(True)
elif view != None and (not self._nothingUnderMouse(view, event)):
- self._viewUnselectAll()
+ if not event.state & (gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK):
+ self._viewUnselectAll()
+ elif self.clip_view == SHOW_TREEVIEW and self._viewHasSelection() \
+ and (event.state & gtk.gdk.SHIFT_MASK):
+ selection = self.treeview.get_selection()
+ start_path = self._viewGetFirstSelected()
+ end_path = self._viewGetPathAtPos(event)
+ self._viewUnselectAll()
+ selection.select_range(start_path, end_path)
+
self._viewSelectPath(self._viewGetPathAtPos(event))
self.popup_remitem.set_sensitive(True)
self.popup_playmenuitem.set_sensitive(True)
@@ -687,6 +696,14 @@ class SourceList(gtk.VBox, Loggable):
self.popup.popup(None, None, None, event.button, event.time)
+ def _viewGetFirstSelected(self):
+ paths = self.getSelectedPaths()
+ return paths[0]
+
+ def _viewHasSelection(self):
+ paths = self.getSelectedPaths()
+ return bool(len(paths))
+
def _viewGetPathAtPos(self, event):
if self.clip_view == SHOW_TREEVIEW:
pathinfo = self.treeview.get_path_at_pos(int(event.x), int(event.y))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]