[pitivi] timeline: Disable the selection actions when timeline focused but there is no selection



commit 23590635d4371d7097915804e071dc0f9278eadf
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Jan 14 16:56:16 2014 +0100

    timeline: Disable the selection actions when timeline focused but there is no selection

 pitivi/timeline/timeline.py |    8 ++++----
 pitivi/utils/timeline.py    |   12 ------------
 2 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 2f66024..387f1ca 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -788,10 +788,10 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
         """
         self.playhead_actions.set_sensitive(sensitive)
         self.debug("Playback shortcuts sensitivity set to %s", sensitive)
-        selected = self.timeline.selection.getSelectedTrackElements()
-        if not sensitive or (sensitive and selected):
-            self.selection_actions.set_sensitive(sensitive)
-            self.debug("Editing shortcuts sensitivity set to %s", sensitive)
+
+        sensitive = sensitive and self.timeline.selection
+        self.selection_actions.set_sensitive(sensitive)
+        self.debug("Editing shortcuts sensitivity set to %s", sensitive)
 
     # Internal API
 
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index 8c1c10d..9360881 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -120,18 +120,6 @@ class Selection(Signallable):
         """
         self.setSelection(set([obj]), mode)
 
-    def addClip(self, clip):
-        """
-        Add the given clip to the selection.
-
-        @param clip: The object to add
-        @type clip: L{GES.Clip}
-        @raises TimelineError: If the object is already controlled by this
-        Selection.
-        """
-        if clip in self.clips:
-            raise TimelineError("TrackElement already in this selection")
-
     def setSelection(self, objs, mode):
         """
         Update the current selection.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]