[pitivi] ui: add a blacklist for hiding effects in the ui



commit 80251bcbf9f037ad9911bf4eff1462cad6ae1dfd
Author: Lubosz Sarnecki <lubosz gmail com>
Date:   Fri Aug 12 22:19:52 2011 +0200

    ui: add a blacklist for hiding effects in the ui

 pitivi/ui/clipproperties.py |   30 ++++++++++++++++--------------
 pitivi/ui/effectlist.py     |   17 ++++++++++-------
 2 files changed, 26 insertions(+), 21 deletions(-)
---
diff --git a/pitivi/ui/clipproperties.py b/pitivi/ui/clipproperties.py
index e66801b..63e64e3 100644
--- a/pitivi/ui/clipproperties.py
+++ b/pitivi/ui/clipproperties.py
@@ -36,6 +36,7 @@ from pitivi.ui.gstwidget import GstElementSettingsWidget
 from pitivi.ui.effectsconfiguration import EffectsPropertiesHandling
 from pitivi.ui.common import PADDING, SPACING
 from pitivi.ui import dynamic
+from pitivi.ui.effectlist import HIDDEN_EFFECTS
 
 (COL_ACTIVATED,
  COL_TYPE,
@@ -355,20 +356,21 @@ class EffectProperties(gtk.HBox):
     def _updateTreeview(self):
         self.storemodel.clear()
         for track_effect in self.selected_effects:
-            to_append = [track_effect.gnl_object.get_property("active")]
-            track_effect.gnl_object.connect("notify::active",
-                                            self._activeChangedCb)
-            if isinstance(track_effect.factory.getInputStreams()[0],
-                          VideoStream):
-                to_append.append("Video")
-            else:
-                to_append.append("Audio")
-
-            to_append.append(track_effect.factory.getHumanName())
-            to_append.append(track_effect.factory.getDescription())
-            to_append.append(track_effect)
-
-            self.storemodel.append(to_append)
+            if not track_effect.factory.effectname in HIDDEN_EFFECTS:
+                to_append = [track_effect.gnl_object.get_property("active")]
+                track_effect.gnl_object.connect("notify::active",
+                                                self._activeChangedCb)
+                if isinstance(track_effect.factory.getInputStreams()[0],
+                              VideoStream):
+                    to_append.append("Video")
+                else:
+                    to_append.append("Audio")
+
+                to_append.append(track_effect.factory.getHumanName())
+                to_append.append(track_effect.factory.getDescription())
+                to_append.append(track_effect)
+
+                self.storemodel.append(to_append)
 
     def _showInfoBar(self):
         if self._info_bar is None:
diff --git a/pitivi/ui/effectlist.py b/pitivi/ui/effectlist.py
index 5fa4e0f..f0c5b98 100644
--- a/pitivi/ui/effectlist.py
+++ b/pitivi/ui/effectlist.py
@@ -39,6 +39,8 @@ from pitivi.settings import GlobalSettings
 SHOW_TREEVIEW = 1
 SHOW_ICONVIEW = 2
 
+HIDDEN_EFFECTS = ["frei0r-filter-scale0tilt"]
+
 GlobalSettings.addConfigSection('effect-library')
 GlobalSettings.addConfigOption('lastEffectView',
     section='effect-library',
@@ -231,13 +233,14 @@ class EffectList(gtk.VBox, Loggable):
     def _addFactories(self, elements, effectType):
         for element in elements:
             name = element.get_name()
-            effect = self.app.effects.getFactoryFromName(name)
-            self.storemodel.append([effect.getHumanName(),
-                                     effect.getDescription(), effectType,
-                                     effect.getCategories(),
-                                     effect, name,
-                                     self.app.effects.getEffectIcon(name)])
-            self.storemodel.set_sort_column_id(COL_NAME_TEXT, gtk.SORT_ASCENDING)
+            if name not in HIDDEN_EFFECTS:
+                effect = self.app.effects.getFactoryFromName(name)
+                self.storemodel.append([effect.getHumanName(),
+                                         effect.getDescription(), effectType,
+                                         effect.getCategories(),
+                                         effect, name,
+                                         self.app.effects.getEffectIcon(name)])
+                self.storemodel.set_sort_column_id(COL_NAME_TEXT, gtk.SORT_ASCENDING)
 
     def show_categories(self, effectType):
         self.effectCategory.get_model().clear()



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