From 44c75a90ee60f66720845affddafbc165060cc5d Mon Sep 17 00:00:00 2001 From: chrys Date: Thu, 22 Aug 2019 14:38:25 +0200 Subject: [PATCH] Update remoteManager.py --- src/fenrirscreenreader/core/remoteManager.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/fenrirscreenreader/core/remoteManager.py b/src/fenrirscreenreader/core/remoteManager.py index df7711c0..ad2399aa 100644 --- a/src/fenrirscreenreader/core/remoteManager.py +++ b/src/fenrirscreenreader/core/remoteManager.py @@ -46,7 +46,8 @@ class remoteManager(): # setting controll self.settingConst = 'SETTING ' self.setSettingConst = 'SET ' - self.saveSettingConst = 'SAVE ' + self.saveAsSettingConst = 'SAVEAS ' + self.saveSettingConst = 'SAVE' self.resetSettingConst = 'RESET' def initialize(self, environment): self.env = environment @@ -64,10 +65,13 @@ class remoteManager(): if upperSettingsText.startswith(self.setSettingConst): parameterText = settingsText[len(self.setSettingConst):] self.setSettings(parameterText) + # save as setting + if upperSettingsText.startswith(self.saveAsSettingConst): + parameterText = settingsText[len(self.saveAsSettingConst):] + self.saveSettings(parameterText) # save setting if upperSettingsText.startswith(self.saveSettingConst): - parameterText = settingsText[len(self.saveSettingConst):] - self.saveSettings(parameterText) + self.saveSettings() # reset setting if upperSettingsText.startswith(self.resetSettingConst): self.resetSettings() @@ -144,9 +148,9 @@ class remoteManager(): self.env['runtime']['outputManager'].speakText(text) def interruptSpeech(self): self.env['runtime']['outputManager'].interruptOutput() - def saveSettings(self, settingConfigPath): + def saveSettings(self, settingConfigPath = None): if not settingConfigPath: - return + settingConfigPath = self.env['runtime']['settingsManager'].getSettingsFile() if settingConfigPath == '': return self.env['runtime']['settingsManager'].saveSettings(settingConfigPath)