mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-14 21:44:28 +00:00
[Core] Emit ConfigValueChangedEvent only in started state
This commit is contained in:
parent
085dc76e41
commit
194d1291e1
@ -183,6 +183,9 @@ class Component(object):
|
||||
d.addCallback(on_stop)
|
||||
return d
|
||||
|
||||
def get_state(self):
|
||||
return self._component_state
|
||||
|
||||
def start(self):
|
||||
pass
|
||||
|
||||
|
@ -148,6 +148,7 @@ class PreferencesManager(component.Component):
|
||||
self.session.set_settings(settings)
|
||||
|
||||
def _on_config_value_change(self, key, value):
|
||||
if self.get_state() == "Started":
|
||||
self.do_config_set_func(key, value)
|
||||
component.get("EventManager").emit(ConfigValueChangedEvent(key, value))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user