summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Niklaus <marex@opencompositing.org>2007-06-07 21:02:20 +0200
committerPatrick Niklaus <marex@opencompositing.org>2007-06-07 21:02:20 +0200
commit05dcd58129798548e7d552c04f93d21edc0f21e9 (patch)
treebd9cf5465552b8808f9d6ce5659e0032b7302c66
parent81f4db880feb9a1c96446dae283f587dd7460609 (diff)
downloadccsm-05dcd58129798548e7d552c04f93d21edc0f21e9.tar.gz
ccsm-05dcd58129798548e7d552c04f93d21edc0f21e9.tar.bz2
Use ranking system
-rwxr-xr-xccsm.in19
1 files changed, 4 insertions, 15 deletions
diff --git a/ccsm.in b/ccsm.in
index d858335..be64337 100755
--- a/ccsm.in
+++ b/ccsm.in
@@ -763,18 +763,8 @@ def MakeSetting(setting):
return None
-#def SettingSortCompare(v1, v2):
-# if v1.Type != v2.Type:
-# # XXX Work-a-round for range widgets
-# t1 = v1.Type
-# t2 = v2.Type
-# if t1 == 'Float' or t1 == 'Int':
-# t1 = 'CRange'
-# if t2 == 'Float' or t2 == 'Int':
-# t2 = 'CRange'
-# return cmp(t1, t2)
-# else:
-# return cmp(v1.ShortDesc, v2.ShortDesc)
+def SettingSortCompare(v1, v2):
+ return cmp(v1.Plugin.Ranking[v1.Name], v2.Plugin.Ranking[v2.Name])
def HasOnlyType(settings, type):
empty = True
@@ -787,8 +777,8 @@ def HasOnlyType(settings, type):
class SubGroupArea:
def __init__(self, name, subGroup):
- settings = sum((v.values() for v in [subGroup.Display]+[subGroup.Screens[CurrentScreenNum]]), [])
-
+ #settings = sum((v.values() for v in [subGroup.Display]+[subGroup.Screens[CurrentScreenNum]]), [])
+ settings = sorted(sum((v.values() for v in [subGroup.Display]+[subGroup.Screens[CurrentScreenNum]]), []), SettingSortCompare)
if name == '':
self.Widget = gtk.Table()
self.Child = self.Widget
@@ -811,7 +801,6 @@ class SubGroupArea:
self.Empty = True
row = 0
- #for setting in sorted(sum((v.values() for v in [subGroup.Display]+[subGroup.Screens[CurrentScreenNum]]), []), SettingSortCompare):
for setting in settings:
if not setting.Name == '____plugin_enabled':
set = MakeSetting(setting)