[pitivi] Add an effect by double clicking in the effect list



commit 9fa6848db295fbb3176ea299a317a050185262b8
Author: Thibault Saunier <tsaunier gnome org>
Date:   Wed Aug 18 18:26:11 2010 -0400

    Add an effect by double clicking in the effect list

 pitivi/ui/clipproperties.py |   15 ++++++++++++---
 pitivi/ui/effectlist.py     |    3 +++
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/ui/clipproperties.py b/pitivi/ui/clipproperties.py
index 93cd2e9..a726cca 100644
--- a/pitivi/ui/clipproperties.py
+++ b/pitivi/ui/clipproperties.py
@@ -242,11 +242,19 @@ class EffectProperties(gtk.Expander):
         track.removeTrackObject(effect)
         self.app.action_log.commit()
 
-    def _dragDataReceivedCb(self, unused_layout, context, x, y,
-        selection, targetType, timestamp):
+    def addEffectToCurrentSelection(self, factory_name):
+        if self.timeline_object:
+            factory = self.app.effects.getFactoryFromName(factory_name)
+            self.app.action_log.begin("add effect")
+            self.timeline.addEffectFactoryOnObject(factory,
+                                                   timeline_objects = [self.timeline_object])
+            self.app.action_log.commit()
+
+    def _dragDataReceivedCb(self, unused_layout, context, unused_x, unused_y,
+        selection, unused_targetType, unused_timestamp):
         self._factory = self.app.effects.getFactoryFromName(selection.data)
 
-    def _dragDropCb(self, unused, context, x, y, timestamp):
+    def _dragDropCb(self, unused, context, unused_x, unused_y, unused_timestamp):
         if self._factory:
             self.app.action_log.begin("add effect")
             self.timeline.addEffectFactoryOnObject(self._factory,
@@ -294,6 +302,7 @@ class EffectProperties(gtk.Expander):
                 self._updateEffectConfigUi()
             else:
                 self._hideEffectConfig()
+                self.storemodel.clear()
                 self._showInfoBar()
             self.VContent.show()
         else:
diff --git a/pitivi/ui/effectlist.py b/pitivi/ui/effectlist.py
index f57cdce..5697804 100644
--- a/pitivi/ui/effectlist.py
+++ b/pitivi/ui/effectlist.py
@@ -217,6 +217,9 @@ class EffectList(gtk.VBox, Loggable):
         if event.button == 3:
             self._viewShowPopup(treeview, event)
             chain_up = False
+        if event.type is gtk.gdk._2BUTTON_PRESS:
+            factory_name = self.getSelectedItems()
+            self.app.gui.clipconfig.effect_expander.addEffectToCurrentSelection(factory_name)
         else:
             if not event.state & (gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK):
                 chain_up = not self._rowUnderMouseSelected(treeview, event)



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