[pitivi: 17/18] mainwindow: add a default action list to setActionsSensitive



commit 47c04d7b09178576dbae44c911cbce8fddb610b5
Author: Thibault Saunier <thibault saunier collabora co uk>
Date:   Mon Mar 7 14:31:39 2011 +0100

    mainwindow: add a default action list to setActionsSensitive

 pitivi/ui/effectlist.py |    6 ++----
 pitivi/ui/mainwindow.py |    6 +++++-
 pitivi/ui/sourcelist.py |    6 ++----
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/ui/effectlist.py b/pitivi/ui/effectlist.py
index cd42017..7122690 100644
--- a/pitivi/ui/effectlist.py
+++ b/pitivi/ui/effectlist.py
@@ -441,12 +441,10 @@ class EffectList(gtk.VBox, Loggable):
         entry.set_text("")
 
     def searchEntryDesactvateCb(self, entry, event):
-        sensitive_actions = self.app.gui.sensitive_actions
-        self.app.gui.setActionsSensitive(sensitive_actions, True)
+        self.app.gui.setActionsSensitive("default", True)
 
     def searchEntryActivateCb(self, entry, event):
-        sensitive_actions = self.app.gui.sensitive_actions
-        self.app.gui.setActionsSensitive(sensitive_actions, False)
+        self.app.gui.setActionsSensitive("default", False)
 
     def _setRowVisible(self, model, iter, data):
         if self.effectType.get_active() == model.get_value(iter, COL_EFFECT_TYPE):
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index baa2091..7bdfa3d 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -532,11 +532,15 @@ class PitiviMainWindow(gtk.Window, Loggable):
         Grab (or release) keyboard letter keys focus/sensitivity
         for operations such as typing text in an entry.
         @param action_names: The name of actions we
-                             want to set to sensitive or not
+                             want to set to sensitive or not, if set to "default"
+                             we use the default actions.
         @type action_names: A {list} of action names
         @param sensitive: %True if actions must be sensitive False otherwise
         @type action_names: C{Bool}
         """
+        if action_names == "default":
+            action_names = self.sensitive_actions
+
         for action in self.actiongroup.list_actions():
             if action.get_name() in action_names:
                 action.set_sensitive(sensitive)
diff --git a/pitivi/ui/sourcelist.py b/pitivi/ui/sourcelist.py
index 01cd83d..0e3a9cb 100644
--- a/pitivi/ui/sourcelist.py
+++ b/pitivi/ui/sourcelist.py
@@ -382,12 +382,10 @@ class SourceList(gtk.VBox, Loggable):
         entry.set_text("")
 
     def searchEntryDeactivateCb(self, entry, event):
-        sensitive_actions = self.app.gui.sensitive_actions
-        self.app.gui.setActionsSensitive(sensitive_actions, True)
+        self.app.gui.setActionsSensitive("default", True)
 
     def searchEntryActivateCb(self, entry, event):
-        sensitive_actions = self.app.gui.sensitive_actions
-        self.app.gui.setActionsSensitive(sensitive_actions, False)
+        self.app.gui.setActionsSensitive("default", False)
 
     def _setRowVisible(self, model, iter, data):
         """



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