[pitivi] Disable keyboard shortcuts in the transformation spinbuttons



commit 571fb91949d7da7c7e9fd2f737d4dce6cc061f3f
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Wed Jul 18 22:52:16 2012 -0400

    Disable keyboard shortcuts in the transformation spinbuttons

 pitivi/clipproperties.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index b664e84..0da2760 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -592,8 +592,14 @@ class TransformationProperties(gtk.Expander):
             spinbtn.set_value(self.effect.get_property(name))
 
     def _getAndConnectToEffect(self, widget_name, property_name):
+        """
+        Create a spinbutton widget and connect its signals to change property
+        values. While focused, disable the timeline actions' sensitivity.
+        """
         spinbtn = self.builder.get_object(widget_name)
         spinbtn.connect("output", self._onValueChangedCb, property_name)
+        spinbtn.connect("focus-in-event", self._disableTimelineActionsCb)
+        spinbtn.connect("focus-out-event", self._enableTimelineActionsCb)
         self.spin_buttons[property_name] = spinbtn
         self.default_values[property_name] = spinbtn.get_value()
 
@@ -614,6 +620,12 @@ class TransformationProperties(gtk.Expander):
         if box and box.clicked_point == 0:
             box.update_from_effect(self.effect)
 
+    def _disableTimelineActionsCb(self, unused_widget, unused_event):
+        self.app.gui.setActionsSensitive(False)
+
+    def _enableTimelineActionsCb(self, unused_widget, unused_event):
+        self.app.gui.setActionsSensitive(True)
+
     def _flushPipeLineCb(self, widget):
         self.app.current.pipeline.flushSeek()
 



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