re-enable webui plugins

This commit is contained in:
Martijn Voncken 2008-07-05 07:49:26 +00:00
parent 0e25062af7
commit 0acd13aaca
6 changed files with 29 additions and 16 deletions

View File

@ -50,6 +50,7 @@ import lib.newforms_plus as forms
from deluge.ui.client import aclient
from deluge import component, pluginmanagerbase
from deluge.configmanager import ConfigManager
from deluge.log import LOG as log
class TOOLBAR_FLAGS:
generic = 0
@ -134,19 +135,30 @@ class PluginManager(pluginmanagerbase.PluginManagerBase,
def start(self):
"""Start the plugin manager"""
# Update the enabled_plugins from the core
log.debug("start pl-manager")
aclient.get_enabled_plugins(self._on_get_enabled_plugins)
aclient.force_call(block=True)
def stop(self):
# Disable the plugins
self.disable_plugins()
def _on_get_enabled_plugins(self, enabled_plugins):
log.debug("Webui has these plugins enabled: %s", enabled_plugins)
self.config["enabled_plugins"] = enabled_plugins
log.debug("..Webui has these plugins enabled: %s", enabled_plugins)
log.debug("abababab")
log.debug(self.config)
self.config.config["enabled_plugins"] = enabled_plugins
# Enable the plugins that are enabled in the config and core
self.enable_plugins()
log.debug(self.enable_plugins)
try:
self.enable_plugins()
except Exception, e:
log.debug(e)
class ConfigPageManager(component.Component):
def __init__(self):

View File

@ -62,7 +62,7 @@ class NetworkPorts(config_forms.CfgForm ):
if (data['_port_to'] < data['_port_from']):
raise forms.ValidationError('"Port from" must be greater than "Port to"')
def extra_html(self):
def post_html(self):
return """
<ul>
<li>Active port:%(active_port)s </li>

View File

@ -101,7 +101,10 @@ class Form(FilteredForm):
def validate(self, data):
pass
def extra_html(self):
def pre_html(self):
return ''
def post_html(self):
return ''

View File

@ -103,9 +103,9 @@ class index:
filter_dict = {}
for filter_name in ["state","tracker","keyword"]:
value = getattr(vars, filter_name)
if value and value <> "All":
if value and value <> "All" and value <> "None":
filter_dict[filter_name] = value
log.debug(filter_dict)
torrent_ids = proxy.organize_get_session_state(filter_dict)
organize_filters = Storage(proxy.organize_all_filter_items())

View File

@ -21,6 +21,7 @@ $for group in groups:
<h2>$form.group / $form.title</h2>
<div class="info">$form.info</div>
<form method="POST">
$:form.pre_html()
<table id="config_table">
$:form.as_table()
<tr>
@ -35,11 +36,7 @@ $if message:
$if error:
<div class="error">$error</div>
<div>
$:form.extra_html()
</div>
$:form.post_html()
</form>

View File

@ -262,9 +262,10 @@ def apply_config():
#etc, mostly for apache:
from render import render
try:
sclient.set_core_uri(config.get('daemon'))
except:
print "error setting core uri:",config.get('daemon')
#sclient.set_core_uri(config.get('daemon'))
daemon_connect(config.get('daemon'))
except Exception,e:
log.debug("error setting core uri:%s:%s:%s" % (config.get('daemon'),e,e.message))
render.set_global('base', config.get('base'))
render.apply_cfg()