[pitivi: 1/8] Effects: "All effect" selected by default whatever the localization is bug #637278
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 1/8] Effects: "All effect" selected by default whatever the localization is bug #637278
- Date: Thu, 20 Jan 2011 17:03:44 +0000 (UTC)
commit e6eae955041d87c94c7112b16523cf612b8e5698
Author: Thibault Saunier <thibault saunier collabora co uk>
Date: Wed Dec 15 12:29:43 2010 +0100
Effects: "All effect" selected by default whatever the localization is bug #637278
pitivi/effects.py | 41 +++++++++++++++++++++++------------------
1 files changed, 23 insertions(+), 18 deletions(-)
---
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 7a9654b..30df201 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -112,8 +112,8 @@ class EffectsHandler(object):
(_("Time"), ("frei0r-filter-delay0r",)),
(_("Uncategorized"), ("",))
)
- self._audio_categories = []
- self._video_categories = []
+ self._audio_categories =set([])
+ self._video_categories = set([])
self.video_effects = []
self.audio_effects = []
self._effect_factories_dict = {}
@@ -215,17 +215,16 @@ class EffectsHandler(object):
for name in categorie[1]:
if name == effect_name:
categories.append(categorie[0])
- self._video_categories.append(categorie[0])
+ self._video_categories.add(categorie[0])
if not categories:
uncategorized = _("Uncategorized")
categories.append(uncategorized)
- self._video_categories.append(uncategorized)
- self._audio_categories.append(uncategorized)
+ self._video_categories.add(uncategorized)
+ self._audio_categories.add(uncategorized)
- categories.append(self._video_categories_effects[0][0])
- self._audio_categories.append(self._video_categories_effects[0][0])
- self._video_categories.append(self._video_categories_effects[0][0])
+ categories.insert(0, self._video_categories_effects[0][0])
+ categories.insert(0, self._audio_categories_effects[0][0])
return categories
@@ -254,11 +253,14 @@ class EffectsHandler(object):
return all categories
"""
if not self._video_categories or not aware:
- for categorie in self._video_categories_effects:
- self._video_categories.append(categorie[0])
- self._video_categories = list(set(self._video_categories))
- self._video_categories.sort()
- return self._video_categories
+ for categorie in self._video_categories_effects[1:]:
+ self._video_categories.add(categorie[0])
+
+ ret = list(self._video_categories)
+ ret.sort()
+ ret.insert(0, self._video_categories_effects[0][0])
+
+ return ret
video_categories = property(getVideoCategories)
@@ -270,11 +272,14 @@ class EffectsHandler(object):
@returns: All audio effect categories names C{str}
"""
if not self._audio_categories or not aware:
- for categorie in self._audio_categories_effects:
- self._audio_categories.append(categorie[0])
- self._audio_categories = list(set(self._audio_categories))
- self._audio_categories.sort()
- return self._audio_categories
+ for categorie in self._audio_categories_effects[1:]:
+ self._audio_categories.add(categorie[0])
+
+ ret = list(self._audio_categories)
+ ret.sort()
+ ret.insert(0, self._audio_categories_effects[0][0])
+
+ return ret
audio_categories = property(getAudioCategories)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]