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)
|
d.addCallback(on_stop)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
def get_state(self):
|
||||||
|
return self._component_state
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@ class PreferencesManager(component.Component):
|
|||||||
self.session.set_settings(settings)
|
self.session.set_settings(settings)
|
||||||
|
|
||||||
def _on_config_value_change(self, key, value):
|
def _on_config_value_change(self, key, value):
|
||||||
|
if self.get_state() == "Started":
|
||||||
self.do_config_set_func(key, value)
|
self.do_config_set_func(key, value)
|
||||||
component.get("EventManager").emit(ConfigValueChangedEvent(key, value))
|
component.get("EventManager").emit(ConfigValueChangedEvent(key, value))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user