[orca/new-settings] Add new created profiles to the data structure passed from the UI and from Settings Manager.



commit d535d55b638e5f2e20b61c61f739bf2ee1823a8c
Author: Alejandro Leiva <aleiva emergya es>
Date:   Wed Oct 27 12:17:17 2010 +0200

    Add new created profiles to the data structure passed from the UI and from Settings Manager.

 src/orca/backends/yaml_backend.py |    3 +++
 src/orca/orca_gui_prefs.py        |    2 ++
 src/orca/settings_manager.py      |    5 +++++
 3 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/backends/yaml_backend.py b/src/orca/backends/yaml_backend.py
index 73b72fb..23185ef 100644
--- a/src/orca/backends/yaml_backend.py
+++ b/src/orca/backends/yaml_backend.py
@@ -68,7 +68,10 @@ class Backend:
 
         general['pronunciations'] = pronunciations
         general['keybindings'] = keybindings
+
+        currentProfilePrefs = self.profiles
         profilePrefs = {profile: general}
+        profilePrefs.update(currentProfilePrefs)
 
         self._getSettings()
         prefs = {'general': self.general,
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 0dc57dc..b1739f5 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -4413,6 +4413,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
             activeProfile = self.getComboBoxList(self.profilesCombo)
             startingProfile = self.getComboBoxList(self.startingProfileCombo)
 
+            self.prefsDict['profile'] = activeProfile
             self.prefsDict['activeProfile'] = activeProfile
             self.prefsDict['startingProfile'] = startingProfile
 
@@ -4515,6 +4516,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
                 activeProfileIter = self.profilesComboModel.append(profile)
                 self.profilesCombo.set_active_iter(activeProfileIter)
 
+            self.prefsDict['profile'] = profile
             self.prefsDict['activeProfile'] = profile
             self.writeUserPreferences()
 
diff --git a/src/orca/settings_manager.py b/src/orca/settings_manager.py
index 523a4a9..ae7eb0d 100644
--- a/src/orca/settings_manager.py
+++ b/src/orca/settings_manager.py
@@ -274,11 +274,16 @@ class SettingsManager():
     def saveSettings(self, general, pronunciations, keybindings):
         """Let the active backend to store the default settings and
         the profiles' ones."""
+        # Assign current profile
+        (currentProfileString, currentProfile) = general.get('activeProfile')
+        self.profile = currentProfile
+
         # 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,
                                           self.defaultPronunciations,
                                           self.defaultKeybindings)
+
         self._setProfileGeneral(general)
         self._setProfilePronunciations(pronunciations)
         self._setProfileKeybindings(keybindings)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]