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 ]
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]
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
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