[pitivi] Make actions sensitive on selection changed



commit 5903c6c9a0543400c3eed40a71230884e470dfde
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date:   Wed Apr 17 01:12:21 2013 +0200

    Make actions sensitive on selection changed

 pitivi/timeline/timeline.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index f106765..f5996ec 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1627,8 +1627,22 @@ class Timeline(Gtk.VBox, Zoomable):
 
     def setTimeline(self, bTimeline):
         self.bTimeline = bTimeline
+        self.timeline.selection.connect("selection-changed", self._selectionChangedCb)
         self.timeline.setTimeline(bTimeline)
 
+    def _selectionChangedCb(self, selection):
+        """
+        The selected clips on the timeline canvas have changed with the
+        "selection-changed" signal.
+
+        This is where you apply global UI changes, unlike individual
+        track elements' "selected-changed" signal from the Selected class.
+        """
+        if selection:
+            self.selection_actions.set_sensitive(True)
+        else:
+            self.selection_actions.set_sensitive(False)
+
     def _scrollEventCb(self, embed, event):
         # FIXME : see https://bugzilla.gnome.org/show_bug.cgi?id=697522
         deltas = event.get_scroll_deltas()


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