From 0aae824fd3f25522f6c81acd79d5486df0e981f1 Mon Sep 17 00:00:00 2001 From: Mladen Horvat Date: Mon, 7 Dec 2009 13:57:00 +0100 Subject: Plugins/Plugin.py, SoftwareManager/plugin.py: add WHERE_SOFTWAREMANAGER for plugins to hook inside the Softwaremanager mainmenus. Use it like: PluginDescriptor(name=_("Pluginname"),description=_("Description"),icon = "icon.png",where = PluginDescriptor.WHERE_SOFTWAREMANAGER, fnc={"SoftwareSupported": CallFnc, "menuEntryName": lambda x: _("menuName"), "menuEntryDescription": lambda x: _("Menu Description")}) --- lib/python/Plugins/Plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/python/Plugins/Plugin.py') diff --git a/lib/python/Plugins/Plugin.py b/lib/python/Plugins/Plugin.py index d7fc6898..8d538ef0 100755 --- a/lib/python/Plugins/Plugin.py +++ b/lib/python/Plugins/Plugin.py @@ -52,6 +52,12 @@ class PluginDescriptor: # reason (True: Networkconfig read finished, False: Networkconfig reload initiated ) WHERE_NETWORKCONFIG_READ = 12 + # fnc 'SoftwareSupported' or 'AdvancedSoftwareSupported' must take a parameter and return None + # if the plugin should not be displayed inside Softwaremanger or return a function which is called with session + # and 'None' as parameter to call the plugin from the Softwaremanager menus. "menuEntryName" and "menuEntryDescription" + # should be provided to name and describe the new menu entry. + WHERE_SOFTWAREMANAGER = 14 + def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None, wakeupfnc = None, internal = False): self.name = name self.internal = internal -- cgit v1.2.3