[orca/new-settings] Multiple fixes. Fix main prolems with YAML Backend.
- From: Alejandro Leiva <aleiva src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/new-settings] Multiple fixes. Fix main prolems with YAML Backend.
- Date: Tue, 26 Oct 2010 02:22:26 +0000 (UTC)
commit e821166038149a5a17e3ee5064e4accb2151ea56
Author: Alejandro Leiva <aleiva emergya es>
Date: Tue Oct 26 04:20:48 2010 +0200
Multiple fixes. Fix main prolems with YAML Backend.
src/orca/backends/yaml_backend.py | 5 ++++-
src/orca/orca_gui_prefs.py | 4 ++--
src/orca/settings.py | 23 ++++++++++++++---------
src/orca/settings_manager.py | 14 +++++++++++++-
4 files changed, 33 insertions(+), 13 deletions(-)
---
diff --git a/src/orca/backends/yaml_backend.py b/src/orca/backends/yaml_backend.py
index 87cfe29..0c420d2 100644
--- a/src/orca/backends/yaml_backend.py
+++ b/src/orca/backends/yaml_backend.py
@@ -107,5 +107,8 @@ class Backend:
return True
def availableProfiles(self):
- return self.profiles.keys()
+ profiles = []
+ for key in self.profiles.keys():
+ profiles.append([key.title(), key])
+ return profiles
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 041ee04..d4cd92b 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -59,7 +59,7 @@ import orca_gui_profile
from settings_manager import SettingsManager
_settingsManager = SettingsManager()
-_settingsManager.loadBackend()
+_settingsManager._loadBackend()
try:
@@ -5303,7 +5303,7 @@ def showPreferencesUI():
except:
pass
- prefsDict = _settingsManager.readPreferences()
+ prefsDict = _settingsManager.getPreferences()
orca_state.prefsUIFile = \
os.path.join(orca_platform.prefix,
diff --git a/src/orca/settings.py b/src/orca/settings.py
index 859268e..0dea4e2 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -392,16 +392,21 @@ speechFactoryModules = ["gnomespeechfactory",
speechServerFactory = "speechdispatcherfactory"
speechServerInfo = None # None means let the factory decide.
-DEFAULT_VOICE = "default"
-UPPERCASE_VOICE = "uppercase"
-HYPERLINK_VOICE = "hyperlink"
-SYSTEM_VOICE = "system"
+# FIXME: Check against GConf backend.
+#DEFAULT_VOICE = "default"
+DEFAULT_VOICE = "DEFAULT_VOICE"
+#UPPERCASE_VOICE = "uppercase"
+UPPERCASE_VOICE = "UPPERCASE_VOICE"
+#HYPERLINK_VOICE = "hyperlink"
+HYPERLINK_VOICE = "HYPERLINK_VOICE"
+#SYSTEM_VOICE = "system"
+SYSTEM_VOICE = "SYSTEM_VOICE"
voices = {
- 'DEFAULT_VOICE' : 'ACSS({})',
- 'UPPERCASE_VOICE' : 'ACSS({ACSS.AVERAGE_PITCH : 5.6})',
- 'HYPERLINK_VOICE' : 'ACSS({})',
- 'SYSTEM_VOICE' : 'ACSS({})',
+ 'DEFAULT_VOICE' : ACSS({}),
+ 'UPPERCASE_VOICE' : ACSS({ACSS.AVERAGE_PITCH : 5.6}),
+ 'HYPERLINK_VOICE' : ACSS({}),
+ 'SYSTEM_VOICE' : ACSS({}),
}
# If True, enable speaking of speech indentation and justification.
@@ -1348,7 +1353,7 @@ ALL_BUT_NUMLOCK_MODIFIER_MASK = (1 << MODIFIER_ORCA |
# conflicts with other commands, such as Orca's command for moving
# among headings (H) and the Help menu (Alt+H).
#
-defaultModifierMask = 'NON_LOCKING_MODIFIER_MASK'
+defaultModifierMask = NON_LOCKING_MODIFIER_MASK
# Whether or not we should present objects with STATE_REQUIRED to
# the user. Currently, this is only seen with ARIA widgets.
diff --git a/src/orca/settings_manager.py b/src/orca/settings_manager.py
index 7f73cca..186412f 100644
--- a/src/orca/settings_manager.py
+++ b/src/orca/settings_manager.py
@@ -185,7 +185,7 @@ class SettingsManager():
if key == 'magZoomerLeft':
value = eval('settings.%s' % prefsDict[key])
elif key in need2repr:
- value = "\'%s\'" % prefsDict[key]
+ value = "%s" % prefsDict[key]
else:
try:
value = getattr(settings, prefsDict[key])
@@ -264,6 +264,12 @@ class SettingsManager():
self._loadProfileSettings(profile)
self._mergeSettings()
+ def getPreferences(self):
+ preferences = self.getGeneralSettings()
+ preferences.update(self.getPronunciations())
+ preferences.update(self.getKeybindings())
+ return preferences
+
def getGeneralSettings(self):
"""Return the current general settings.
Those settings comes from updating the default settings
@@ -349,4 +355,10 @@ class SettingsManager():
return self._backend.availableProfiles()
+ def loadSettings(self):
+ #TODO: is it needed?
+ print "settings_manager::loadSettings"
+ def writeSettings(self, preferences, keybindings, pronunciation):
+ #TODO: is it needed?
+ print "settings_manager::writeSettings"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]