implement api.resetUI, fixes #176

This commit is contained in:
j 2016-01-17 15:40:10 +05:30
parent 1d585811d3
commit 2c57b043cd

View file

@ -69,6 +69,17 @@ def setPreferences(data):
return settings.preferences return settings.preferences
actions.register(setPreferences) actions.register(setPreferences)
def resetUI(data):
'''
takes {
}
'''
ui_json = os.path.join(settings.config_path, 'ui.json')
if os.path.exists(ui_json):
os.unlink(ui_json)
settings.ui = settings.pdict(ui_json, settings.config['user']['ui'])
return settings.ui
actions.register(resetUI)
def setUI(data): def setUI(data):
''' '''