Esempio n. 1
0
 def cfgitems(self):
     """
     Return configure items.
     """
     configure = []
     for p in ItemPlugin.plugins(self.type):
         configure += p.actions_cfg(self)
     return [ SubMenuItem(self, a) for a in configure ]
Esempio n. 2
0
 def cfgitems(self):
     """
     Return configure items.
     """
     configure = []
     for p in ItemPlugin.plugins(self.type):
         configure += p.actions_cfg(self)
     return [SubMenuItem(self, a) for a in configure]
Esempio n. 3
0
 def eventhandler(self, event):
     """
     Simple eventhandler for an item
     """
     # call eventhandler from plugins
     for p in ItemPlugin.plugins(self.type):
         if p.eventhandler(self, event):
             return True
     # give the event to the next eventhandler in the list
     if self.parent:
         return self.parent.eventhandler(event)
     # nothing to do
     return False
Esempio n. 4
0
 def eventhandler(self, event):
     """
     Simple eventhandler for an item
     """
     # call eventhandler from plugins
     for p in ItemPlugin.plugins(self.type):
         if p.eventhandler(self, event):
             return True
     # give the event to the next eventhandler in the list
     if self.parent:
         return self.parent.eventhandler(event)
     # nothing to do
     return False
Esempio n. 5
0
 def _get_actions(self):
     """
     Get all actions for the item. Do not override this function,
     override 'actions' instead.
     """
     # get actions defined by the item
     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_menu(self):
             # set item for the action
             a.item = self
             actions.append(a)
     return pre_actions + self.actions() + post_actions
Esempio n. 6
0
 def _get_actions(self):
     """
     Get all actions for the item. Do not override this function,
     override 'actions' instead.
     """
     # get actions defined by the item
     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_menu(self):
             # set item for the action
             a.item = self
             actions.append(a)
     return pre_actions + self.actions() + post_actions