[pitivi] Refactore EffectsConfiguration



commit ebcca875cfae0ce8caab15df8f9bc482734699d8
Author: Thibault Saunier <tsaunier gnome org>
Date:   Tue Jul 13 00:43:54 2010 -0400

    Refactore EffectsConfiguration

 pitivi/ui/effectsconfiguration.py |   24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)
---
diff --git a/pitivi/ui/effectsconfiguration.py b/pitivi/ui/effectsconfiguration.py
index 5fb6151..10cc7da 100644
--- a/pitivi/ui/effectsconfiguration.py
+++ b/pitivi/ui/effectsconfiguration.py
@@ -62,26 +62,14 @@ class EffectsPropertiesHandling:
     def _connectAllWidgetCbs(self, video_balance_ui, effect):
         for prop, widget in video_balance_ui.properties.iteritems():
             if type(widget) in [gtk.SpinButton]:
-                widget.connect("value-changed", self._onValueChangedCb, prop.name, effect)
+                widget.connect("value-changed", self._onValueChangedCb, prop.name, effect, widget.get_value)
             elif type(widget) in [gtk.Entry]:
-                widget.connect("changed", self._onEntryChangedCb, prop.name, effect)
+                widget.connect("changed", self._onValueChangedCb, prop.name, effect, widget.get_text)
             elif type(widget) in [gtk.ComboBox]:
-                widget.connect("changed", self._onComboboxChangedCb, prop.name, effect)
+                widget.connect("changed", self._onValueChangedCb, prop.name, effect, widget.get_active_text)
             elif type(widget) in [gtk.CheckButton]:
-                widget.connect("clicked", self._onCheckButtonClickedCb, prop.name, effect)
+                widget.connect("clicked", self._onValueChangedCb, prop.name, effect, widget.get_active)
 
-    def _onValueChangedCb(self, widget, prop, element):
-        element.set_property(prop, widget.get_value())
-        self._flushSeekVideo()
-
-    def _onComboboxChangedCb(self, widget, prop, element):
-        element.set_property(prop, widget.get_active_text())
-        self._flushSeekVideo()
-
-    def _onCheckButtonClickedCb(self, widget, prop, element):
-        element.set_property(prop, widget.get_active())
-        self._flushSeekVideo()
-
-    def _onEntryChangedCb(self, widget, prop, element):
-        element.set_property(prop, widget.get_text())
+    def _onValueChangedCb(self, widget, prop, element, function):
+        element.set_property(prop, function())
         self._flushSeekVideo()



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