Author: dmeyer
Date: Sun Mar 11 09:48:30 2007
New Revision: 9317

Modified:
   trunk/ui/src/menu/item.py
   trunk/ui/src/plugin.py

Log:
make it possible to add actions with plugins before the item actions

Modified: trunk/ui/src/menu/item.py
==============================================================================
--- trunk/ui/src/menu/item.py   (original)
+++ trunk/ui/src/menu/item.py   Sun Mar 11 09:48:30 2007
@@ -161,14 +161,18 @@
         override 'actions' instead.
         """
         # get actions defined by the item
-        items = self.actions()
+        post_actions = []
+        pre_actions = []
         # get actions defined by plugins
         for p in ItemPlugin.plugins(self.type):
+            actions = post_actions
+            if p.plugin_level() < 10:
+                actions = pre_actions
             for a in p.actions(self):
                 # set item for the action
                 a.item = self
-                items.append(a)
-        return items
+                actions.append(a)
+        return pre_actions + self.actions() + post_actions
 
 
     def get_menustack(self):

Modified: trunk/ui/src/plugin.py
==============================================================================
--- trunk/ui/src/plugin.py      (original)
+++ trunk/ui/src/plugin.py      Sun Mar 11 09:48:30 2007
@@ -69,6 +69,13 @@
         _loader.register(self, name)
 
 
+    def plugin_level(self):
+        """
+        Return plugin level.
+        """
+        return self._plugin_level
+
+
 class PluginLoader(object):
     """
     Class for handling the different plugins.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to