[orca/new-settings] Maintain sync backend object state with settings that are going to get saved.
- From: Alejandro Leiva <aleiva src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/new-settings] Maintain sync backend object state with settings that are going to get saved.
- Date: Thu, 28 Oct 2010 22:05:33 +0000 (UTC)
commit 8a6eaac4baa9bcc0e300fb6e271b5c1859b2bc40
Author: Alejandro Leiva <aleiva emergya es>
Date: Fri Oct 29 00:04:59 2010 +0200
Maintain sync backend object state with settings that are going to get saved.
src/orca/backends/yaml_backend.py | 5 +++++
src/orca/orca.py | 2 +-
src/orca/settings_manager.py | 3 +++
3 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/backends/yaml_backend.py b/src/orca/backends/yaml_backend.py
index 225d692..82e8e24 100644
--- a/src/orca/backends/yaml_backend.py
+++ b/src/orca/backends/yaml_backend.py
@@ -54,6 +54,11 @@ class Backend:
},
'pronunciations': pronunciations,
'keybindings': keybindings}
+
+ self.general = general
+ self.pronunciation = pronunciations
+ self.keybindings = keybindings
+
settingsFile = open(self.settingsFile, 'w')
dump(prefs, settingsFile)
settingsFile.close()
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 9eabe1d..0d52995 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -1144,7 +1144,7 @@ def loadUserSettings(script=None, inputEvent=None):
try:
#TODO: Temporal hack, we need to get it right
_userSettings = _settingsManager.getGeneralSettings()
- _profile = _userSettings.get('activeProfile')[1]
+ _profile = _userSettings.get('startingProfile')[1]
_userSettings = _settingsManager.getGeneralSettings(_profile)
if _debugSwitch:
debug.debugLevel = debug.LEVEL_ALL
diff --git a/src/orca/settings_manager.py b/src/orca/settings_manager.py
index f026ab0..cca483e 100644
--- a/src/orca/settings_manager.py
+++ b/src/orca/settings_manager.py
@@ -309,6 +309,9 @@ class SettingsManager():
self.profile = currentProfile
+ # Elements that need to stay updated in main configuration.
+ self.defaultGeneral['startingProfile'] = general.get('startingProfile')
+
# The default settings should already exist but we save them anyway
# just in case the default settings have changed at orca.settings
self._backend.saveDefaultSettings(self.defaultGeneral,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]