diff --git a/deluge/plugins/execute/execute/data/deluge-execute.js b/deluge/plugins/execute/execute/data/deluge-execute.js new file mode 100644 index 000000000..cc5952443 --- /dev/null +++ b/deluge/plugins/execute/execute/data/deluge-execute.js @@ -0,0 +1,6 @@ +Deluge.Preferences.addPage(_('Execute'), { + border: false, + xtype: 'form', + layout: 'form', + items: [] +}); \ No newline at end of file diff --git a/deluge/plugins/execute/execute/webui.py b/deluge/plugins/execute/execute/webui.py index 465293937..be89d3da1 100644 --- a/deluge/plugins/execute/execute/webui.py +++ b/deluge/plugins/execute/execute/webui.py @@ -22,6 +22,7 @@ # Boston, MA 02110-1301, USA. # +import pkg_resources from deluge.log import LOG as log from deluge.ui.client import client @@ -30,7 +31,18 @@ from deluge.plugins.pluginbase import WebPluginBase class WebUI(WebPluginBase): def enable(self): - log.debug("Example Web plugin enabled!") + log.debug("Execute Web plugin enabled!") + deluge_web = component.get("DelugeWeb") + deluge_web.top_level.scripts.append("/js/deluge-execute.js") + deluge_web.top_level.debug_scripts.append("/js/deluge-execute.js") + + javascript = component.get("Javascript") + js_path = pkg_resources.resource_filename("execute", "data") + print js_path + javascript.directories.append(js_path) def disable(self): - log.debug("Example Web plugin disabled!") + log.debug("Execute Web plugin disabled!") + deluge_web = component.get("DelugeWeb") + deluge_web.top_level.scripts.remove("/js/deluge-execute.js") + deluge_web.top_level.debug_scripts.remove("/js/deluge-execute.js") diff --git a/deluge/plugins/execute/setup.py b/deluge/plugins/execute/setup.py index 5f46dba87..3ceee6cc0 100644 --- a/deluge/plugins/execute/setup.py +++ b/deluge/plugins/execute/setup.py @@ -50,7 +50,7 @@ setup( %s = %s:CorePlugin [deluge.plugin.gtkui] %s = %s:GtkUIPlugin - [deluge.plugin.webui] + [deluge.plugin.web] %s = %s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower())*3) )