icons added to all system plugins (preliminary)
This commit is contained in:
parent
abacb36dbe
commit
4b6681487e
14 changed files with 64 additions and 4 deletions
|
@ -20,6 +20,11 @@ class CryptoBoxPlugin:
|
|||
## default rank (0..100) of the plugin in listings (lower value means higher priority)
|
||||
rank = 80
|
||||
|
||||
|
||||
## default icon of this plugin (relative path)
|
||||
iconFile = "plugin_icon.png"
|
||||
|
||||
|
||||
def __init__(self, cbox, pluginDir):
|
||||
self.cbox = cbox
|
||||
self.hdf = {}
|
||||
|
@ -40,6 +45,12 @@ class CryptoBoxPlugin:
|
|||
def getName(self):
|
||||
"""the name of the python file (module) should be the name of the plugin"""
|
||||
return self.__module__
|
||||
|
||||
|
||||
def getIcon(self):
|
||||
"""return the image data of the icon of the plugin"""
|
||||
import cherrypy
|
||||
return cherrypy.lib.cptools.serveFile(os.path.join(self.pluginDir, self.iconFile))
|
||||
|
||||
|
||||
def getTemplateFileName(self, template_name):
|
||||
|
|
|
@ -179,6 +179,8 @@ class WebInterfaceSites:
|
|||
del args["weblang"]
|
||||
except KeyError:
|
||||
pass
|
||||
if "icon" in args.keys():
|
||||
return plugin.getIcon()
|
||||
## check the device argument of volume plugins
|
||||
if "volume" in plugin.pluginCapabilities:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue