[Core] Emit ConfigValueChangedEvent only in started state

This commit is contained in:
bendikro 2015-07-13 20:42:02 +02:00 committed by Calum Lind
parent 085dc76e41
commit 194d1291e1
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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))