[orca/new-settings] The bulk of the remaining conversion to use the Settings Manager's getSetting() and setSetting() met
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/new-settings] The bulk of the remaining conversion to use the Settings Manager's getSetting() and setSetting() met
- Date: Sat, 11 Dec 2010 22:47:49 +0000 (UTC)
commit 0cb9f2280e553a7b10b9444d132db7627106a21d
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Sat Dec 11 17:46:41 2010 -0500
The bulk of the remaining conversion to use the Settings Manager's getSetting() and setSetting() methods.
src/orca/braille_generator.py | 13 ++-
src/orca/chat.py | 113 +++++++++++--------
src/orca/orca.py | 18 ++-
src/orca/orca_gui_prefs.py | 116 +++++++++++++-------
src/orca/scripts/apps/Instantbird/script.py | 7 +-
src/orca/scripts/apps/Thunderbird/script.py | 5 +-
src/orca/scripts/apps/evolution/script.py | 70 +++++++-----
.../scripts/apps/evolution/speech_generator.py | 6 +-
.../scripts/apps/gnome-panel/speech_generator.py | 6 +-
src/orca/scripts/apps/gnome-terminal/script.py | 10 +-
src/orca/scripts/apps/soffice/braille_generator.py | 16 ++-
src/orca/scripts/apps/soffice/speech_generator.py | 14 ++-
src/orca/scripts/apps/yelp/script.py | 5 +-
src/orca/scripts/toolkits/Gecko/script.py | 99 +++++++++--------
.../scripts/toolkits/Gecko/speech_generator.py | 8 +-
.../J2SE-access-bridge/speech_generator.py | 11 +-
src/orca/speech_generator.py | 83 ++++++++-------
17 files changed, 352 insertions(+), 248 deletions(-)
---
diff --git a/src/orca/braille_generator.py b/src/orca/braille_generator.py
index 5577250..213e582 100644
--- a/src/orca/braille_generator.py
+++ b/src/orca/braille_generator.py
@@ -29,12 +29,15 @@ import pyatspi
import braille
import generator
+import orca
import orca_state
import rolenames
import settings
from orca_i18n import ngettext # for ngettext support
+_settingsManager = getattr(orca, '_settingsManager')
+
class Space:
"""A dummy class to indicate we want to insert a space into an
utterance, but only if there is text prior to the space."""
@@ -119,8 +122,8 @@ class BrailleGenerator(generator.Generator):
"""
result = []
role = args.get('role', obj.getRole())
- if (role in settings.brailleForceRoles)\
- or ((settings.brailleVerbosityLevel \
+ if (role in _settingsManager.getSetting('brailleForceRoles'))\
+ or ((_settingsManager.getSetting('brailleVerbosityLevel') \
== settings.VERBOSITY_LEVEL_VERBOSE)\
and not args.get('readingRow', False)\
and (role != pyatspi.ROLE_UNKNOWN)):
@@ -181,7 +184,7 @@ class BrailleGenerator(generator.Generator):
previous object with focus.
"""
result = []
- if not settings.enableBrailleContext:
+ if not _settingsManager.getSetting('enableBrailleContext'):
return result
args['includeContext'] = False
@@ -293,7 +296,7 @@ class BrailleGenerator(generator.Generator):
# are on the very first line. Otherwise, we show only the
# line.
#
- include = settings.enableBrailleContext
+ include = _settingsManager.getSetting('enableBrailleContext')
if not include:
return include
try:
@@ -322,7 +325,7 @@ class BrailleGenerator(generator.Generator):
def _generateEol(self, obj, **args):
result = []
- if not settings.disableBrailleEOL:
+ if not _settingsManager.getSetting('disableBrailleEOL'):
if not args.get('mode', None):
args['mode'] = self._mode
args['stringType'] = 'eol'
diff --git a/src/orca/chat.py b/src/orca/chat.py
index e177851..b41513b 100644
--- a/src/orca/chat.py
+++ b/src/orca/chat.py
@@ -29,12 +29,15 @@ import pyatspi
import input_event
import keybindings
+import orca
import orca_state
import settings
import speech
from orca_i18n import _
+_settingsManager = getattr(orca, '_settingsManager')
+
#############################################################################
# #
# Ring List. A fixed size circular list by Flavio Catalani #
@@ -412,8 +415,9 @@ class Chat:
self.speakNameCheckButton = gtk.CheckButton(label)
gtk.Widget.show(self.speakNameCheckButton)
gtk.Box.pack_start(vbox, self.speakNameCheckButton, False, False, 0)
- gtk.ToggleButton.set_active(self.speakNameCheckButton,
- settings.chatSpeakRoomName)
+ gtk.ToggleButton.set_active(
+ self.speakNameCheckButton,
+ _settingsManager.getSetting('chatSpeakRoomName'))
# Translators: If this checkbox is checked, then Orca will tell
# you when one of your buddies is typing a message.
@@ -422,8 +426,9 @@ class Chat:
self.buddyTypingCheckButton = gtk.CheckButton(label)
gtk.Widget.show(self.buddyTypingCheckButton)
gtk.Box.pack_start(vbox, self.buddyTypingCheckButton, False, False, 0)
- gtk.ToggleButton.set_active(self.buddyTypingCheckButton,
- settings.chatAnnounceBuddyTyping)
+ gtk.ToggleButton.set_active(
+ self.buddyTypingCheckButton,
+ _settingsManager.getSetting('chatAnnounceBuddyTyping'))
# Translators: If this checkbox is checked, then Orca will provide
# the user with chat room specific message histories rather than just
@@ -435,8 +440,9 @@ class Chat:
gtk.Widget.show(self.chatRoomHistoriesCheckButton)
gtk.Box.pack_start(vbox, self.chatRoomHistoriesCheckButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.chatRoomHistoriesCheckButton,
- settings.chatRoomHistories)
+ gtk.ToggleButton.set_active(
+ self.chatRoomHistoriesCheckButton,
+ _settingsManager.getSetting('chatRoomHistories'))
# "Speak Messages" frame.
#
@@ -453,6 +459,8 @@ class Chat:
gtk.Widget.show(messagesVBox)
gtk.Container.add(messagesAlignment, messagesVBox)
+ verbosity = _settingsManager.getSetting('chatMessageVerbosity')
+
# Translators: Orca will speak all new chat messages as they appear
# irrespective of whether the chat application currently has focus.
# This is the default behaviour.
@@ -461,36 +469,37 @@ class Chat:
gtk.Widget.show(self.allMessagesRadioButton)
gtk.Box.pack_start(messagesVBox, self.allMessagesRadioButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.allMessagesRadioButton,
- (settings.chatMessageVerbosity == settings.CHAT_SPEAK_ALL))
+ gtk.ToggleButton.set_active(
+ self.allMessagesRadioButton,
+ verbosity == settings.CHAT_SPEAK_ALL)
# Translators: Orca will speak only new chat messages for the channel
# that currently has focus, irrespective of whether the chat
# application has focus.
#
- self.focusedChannelRadioButton = gtk.RadioButton( \
- self.allMessagesRadioButton, \
- _("A channel only if its _window is active"))
+ self.focusedChannelRadioButton = gtk.RadioButton(
+ self.allMessagesRadioButton,
+ _("A channel only if its _window is active"))
gtk.Widget.show(self.focusedChannelRadioButton)
gtk.Box.pack_start(messagesVBox, self.focusedChannelRadioButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.focusedChannelRadioButton,
- (settings.chatMessageVerbosity == \
- settings.CHAT_SPEAK_FOCUSED_CHANNEL))
+ gtk.ToggleButton.set_active(
+ self.focusedChannelRadioButton,
+ verbosity == settings.CHAT_SPEAK_FOCUSED_CHANNEL)
# Translators: Orca will speak new chat messages for all channels
# only when the chat application has focus.
#
- self.allChannelsRadioButton = gtk.RadioButton( \
- self.allMessagesRadioButton,
- _("All channels when an_y %s window is active") \
- % self._script.app.name)
+ self.allChannelsRadioButton = gtk.RadioButton(
+ self.allMessagesRadioButton,
+ _("All channels when an_y %s window is active") \
+ % self._script.app.name)
gtk.Widget.show(self.allChannelsRadioButton)
gtk.Box.pack_start(messagesVBox, self.allChannelsRadioButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.allChannelsRadioButton,
- (settings.chatMessageVerbosity == \
- settings.CHAT_SPEAK_ALL_IF_FOCUSED))
+ gtk.ToggleButton.set_active(
+ self.allChannelsRadioButton,
+ verbosity == settings.CHAT_SPEAK_ALL_IF_FOCUSED)
# Translators: this is the title of a panel holding options for
# how messages in this application's chat rooms should be spoken.
@@ -512,35 +521,37 @@ class Chat:
"""
prefix = "orca.settings"
- settings.chatSpeakRoomName = \
- self.speakNameCheckButton.get_active()
+
+ value = self.speakNameCheckButton.get_active()
+ _settingsManager.setSetting('chatSpeakRoomName', value)
prefs.writelines("\n")
- prefs.writelines("%s.chatSpeakRoomName = %s\n" % \
- (prefix, settings.chatSpeakRoomName))
+ prefs.writelines("%s.chatSpeakRoomName = %s\n" % (prefix, value))
- settings.chatAnnounceBuddyTyping = \
- self.buddyTypingCheckButton.get_active()
- prefs.writelines("%s.chatAnnounceBuddyTyping = %s\n" % \
- (prefix, settings.chatAnnounceBuddyTyping))
+ value = self.buddyTypingCheckButton.get_active()
+ _settingsManager.setSetting('chatAnnounceBuddyTyping', value)
+ prefs.writelines("%s.chatAnnounceBuddyTyping = %s\n" % (prefix, value))
- settings.chatRoomHistories = \
- self.chatRoomHistoriesCheckButton.get_active()
- prefs.writelines("%s.chatRoomHistories = %s\n" % \
- (prefix, settings.chatRoomHistories))
+ value = self.chatRoomHistoriesCheckButton.get_active()
+ _settingsManager.setSetting('chatRoomHistories', value)
+ prefs.writelines("%s.chatRoomHistories = %s\n" % (prefix, value))
+ value = None
+ option = None
if self.allMessagesRadioButton.get_active():
- settings.chatMessageVerbosity = settings.CHAT_SPEAK_ALL
+ value = settings.CHAT_SPEAK_ALL
option = ("%s.CHAT_SPEAK_ALL" % prefix)
elif self.allChannelsRadioButton.get_active():
- settings.chatMessageVerbosity = \
- settings.CHAT_SPEAK_ALL_IF_FOCUSED
+ value = settings.CHAT_SPEAK_ALL_IF_FOCUSED
option = ("%s.CHAT_SPEAK_ALL_IF_FOCUSED" % prefix)
elif self.focusedChannelRadioButton.get_active():
- settings.chatMessageVerbosity = \
- settings.CHAT_SPEAK_FOCUSED_CHANNEL
+ value = settings.CHAT_SPEAK_FOCUSED_CHANNEL
option = ("%s.CHAT_SPEAK_FOCUSED_CHANNEL" % prefix)
- prefs.writelines("\n")
- prefs.writelines("%s.chatMessageVerbosity = %s\n" % (prefix, option))
+
+ if value and option:
+ _settingsManager.setSetting('chatMessageVerbosity', value)
+ prefs.writelines("\n")
+ prefs.writelines("%s.chatMessageVerbosity = %s\n" % \
+ (prefix, option))
########################################################################
# #
@@ -558,8 +569,9 @@ class Chat:
"""
line = _("speak chat room name.")
- settings.chatSpeakRoomName = not settings.chatSpeakRoomName
- if not settings.chatSpeakRoomName:
+ speakRoomName = _settingsManager.getSetting('chatSpeakRoomName')
+ _settingsManager.setSetting('chatSpeakRoomName', not speakRoomName)
+ if speakRoomName:
line = _("Do not speak chat room name.")
self._script.presentMessage(line)
@@ -574,8 +586,10 @@ class Chat:
"""
line = _("announce when your buddies are typing.")
- settings.chatAnnounceBuddyTyping = not settings.chatAnnounceBuddyTyping
- if not settings.chatAnnounceBuddyTyping:
+ announceTyping = _settingsManager.getSetting('chatAnnounceBuddyTyping')
+ _settingsManager.setSetting(
+ 'chatAnnounceBuddyTyping', not announceTyping)
+ if announceTyping:
line = _("Do not announce when your buddies are typing.")
self._script.presentMessage(line)
@@ -590,8 +604,9 @@ class Chat:
"""
line = _("Provide chat room specific message histories.")
- settings.chatRoomHistories = not settings.chatRoomHistories
- if not settings.chatRoomHistories:
+ roomHistories = _settingsManager.getSetting('chatRoomHistories')
+ _settingsManager.setSetting('chatRoomHistories', not roomHistories)
+ if roomHistories:
line = _("Do not provide chat room specific message histories.")
self._script.presentMessage(line)
@@ -617,7 +632,7 @@ class Chat:
messageNumber = self.messageListLength - (index + 1)
message, chatRoomName = None, None
- if settings.chatRoomHistories:
+ if _settingsManager.getSetting('chatRoomHistories'):
conversation = self.getConversation(orca_state.locusOfFocus)
if conversation:
message = conversation.getNthMessage(messageNumber)
@@ -651,7 +666,7 @@ class Chat:
return
text = ""
- if settings.chatSpeakRoomName and chatRoomName:
+ if _settingsManager.getSetting('chatSpeakRoomName') and chatRoomName:
text = _("Message from chat room %s") % chatRoomName
text = self._script.utilities.appendString(text, message)
@@ -757,7 +772,7 @@ class Chat:
Returns True if we spoke the change; False otherwise
"""
- if settings.chatAnnounceBuddyTyping:
+ if _settingsManager.getSetting('chatAnnounceBuddyTyping'):
conversation = self.getConversation(event.source)
if conversation and (status != conversation.getTypingStatus()):
speech.speak(status)
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 3244aa8..84c0488 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -51,6 +51,15 @@ try:
except:
pass
+# This needs to occur prior to our importing anything which might in turn
+# import anything which might expect to be able to use the Settings Manager
+# You have been warned.
+#
+from settings_manager import SettingsManager
+_settingsManager = SettingsManager()
+if _settingsManager is None:
+ die()
+
try:
# If we don't have an active desktop, we will get a RuntimeError.
import mouse_review
@@ -64,11 +73,6 @@ import time
import unicodedata
import shutil
-from settings_manager import SettingsManager
-_settingsManager = SettingsManager()
-if _settingsManager is None:
- die()
-
import settings
if settings.useDBus:
import dbus.mainloop.glib
@@ -316,7 +320,7 @@ def _onChildrenChanged(e):
#
try:
if desktop.childCount == 0:
- if not settings.onlySpeakDisplayedText:
+ if not _settingsManager.getSetting('onlySpeakDisplayedText'):
speech.speak(_("Goodbye."))
shutdown()
return
@@ -2240,7 +2244,7 @@ def main():
try:
message = _("Welcome to Orca.")
- if not settings.onlySpeakDisplayedText:
+ if not _settingsManager.getSetting('onlySpeakDisplayedText'):
speech.speak(message, settings.voices.get(settings.SYSTEM_VOICE))
braille.displayMessage(message)
except:
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 09068ae..cd62de6 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -147,7 +147,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
generalSettings = _settingsManager.getGeneralSettings(activeProfile[1])
self.prefsDict = generalSettings
- self.enableLiveUpdating = settings.enableMagLiveUpdating
+ self.enableLiveUpdating = \
+ _settingsManager.getSetting('enableMagLiveUpdating')
# Initialize variables to None to keep pylint happy.
#
@@ -188,6 +189,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
self.savedRate = None
self._isInitialSetup = False
self.selectedFamilyChoices = {}
+ self.profilesCombo = None
+ self.profilesComboModel = None
+ self.startingProfileCombo = None
def init(self):
"""Initialize the Orca configuration GUI. Read the users current
@@ -200,7 +204,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
# in case the user played with the sliders.
#
try:
- defaultVoice = settings.voices[settings.DEFAULT_VOICE]
+ voices = _settingsManager.getSetting('voices')
+ defaultVoice = voices[settings.DEFAULT_VOICE]
except KeyError:
defaultVoice = {}
try:
@@ -1030,8 +1035,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
[attrList, attrDict] = \
defScript.utilities.stringToKeysAndDict(setAttributes)
- [allAttrList, allAttrDict] = \
- defScript.utilities.stringToKeysAndDict(settings.allTextAttributes)
+ [allAttrList, allAttrDict] = defScript.utilities.stringToKeysAndDict(
+ _settingsManager.getSetting('allTextAttributes'))
for i in range(0, len(attrList)):
for path in range(0, len(allAttrList)):
@@ -1070,8 +1075,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
defScript = default.Script(None)
[attrList, attrDict] = \
defScript.utilities.stringToKeysAndDict(setAttributes)
- [allAttrList, allAttrDict] = \
- defScript.utilities.stringToKeysAndDict(settings.allTextAttributes)
+ [allAttrList, allAttrDict] = defScript.utilities.stringToKeysAndDict(
+ _settingsManager.getSetting('allTextAttributes'))
for i in range(0, len(attrList)):
for path in range(0, len(allAttrList)):
@@ -1229,7 +1234,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
#
defScript = default.Script(None)
[allAttrList, allAttrDict] = defScript.utilities.stringToKeysAndDict(
- settings.allTextAttributes)
+ _settingsManager.getSetting('allTextAttributes'))
for i in range(0, len(allAttrList)):
thisIter = model.append()
localizedKey = \
@@ -1320,13 +1325,17 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
# Check all the enabled (spoken) text attributes.
#
- self._setSpokenTextAttributes(self.getTextAttributesView,
- settings.enabledSpokenTextAttributes, True, True)
+ self._setSpokenTextAttributes(
+ self.getTextAttributesView,
+ _settingsManager.getSetting('enabledSpokenTextAttributes'),
+ True, True)
# Check all the enabled (brailled) text attributes.
#
- self._setBrailledTextAttributes(self.getTextAttributesView,
- settings.enabledBrailledTextAttributes, True)
+ self._setBrailledTextAttributes(
+ self.getTextAttributesView,
+ _settingsManager.getSetting('enabledBrailledTextAttributes'),
+ True)
# Connect a handler for when the user changes columns within the
# view, so that we can adjust the search column for item lookups.
@@ -2185,12 +2194,13 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
# General pane.
#
- self.get_widget("showMainWindowCheckButton").set_active( \
- prefs["showMainWindow"])
- self.get_widget("quitOrcaNoConfirmationCheckButton").set_active( \
- prefs["quitOrcaNoConfirmation"])
- self.get_widget("presentToolTipsCheckButton").set_active( \
- prefs["presentToolTips"] and settings.canPresentToolTips)
+ self.get_widget("showMainWindowCheckButton").set_active(
+ prefs["showMainWindow"])
+ self.get_widget("quitOrcaNoConfirmationCheckButton").set_active(
+ prefs["quitOrcaNoConfirmation"])
+ self.get_widget("presentToolTipsCheckButton").set_active(
+ prefs["presentToolTips"] \
+ and _settingsManager.getSetting('canPresentToolTips'))
self.disableKeyGrabPref = settings.isGKSUGrabDisabled()
self.get_widget("disableKeyGrabCheckButton").set_active( \
@@ -2349,7 +2359,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
#
orcaSetupWindow.realize()
try:
- if settings.showMainWindow:
+ if _settingsManager.getSettings('showMainWindow'):
orcaSetupWindow.present()
except:
pass
@@ -2364,8 +2374,10 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
# We always want to re-order the text attributes page so that enabled
# items are consistently at the top.
#
- self._setSpokenTextAttributes(self.getTextAttributesView,
- settings.enabledSpokenTextAttributes, True, True)
+ self._setSpokenTextAttributes(
+ self.getTextAttributesView,
+ _settingsManager.getSetting('enabledSpokenTextAttributes'),
+ True, True)
orcaSetupWindow.show()
@@ -2846,7 +2858,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
rate = widget.get_value()
voiceType = self.get_widget("voiceTypes").get_active()
self._setRateForVoiceType(voiceType, rate)
- settings.voices[settings.DEFAULT_VOICE][acss.ACSS.RATE] = rate
+ voices = _settingsManager.getSetting('voices')
+ voices[settings.DEFAULT_VOICE][acss.ACSS.RATE] = rate
+ _settingsManager.setSetting('voices', voices)
def pitchValueChanged(self, widget):
"""Signal handler for the "value_changed" signal for the pitchScale
@@ -2861,7 +2875,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
pitch = widget.get_value()
voiceType = self.get_widget("voiceTypes").get_active()
self._setPitchForVoiceType(voiceType, pitch)
- settings.voices[settings.DEFAULT_VOICE][acss.ACSS.AVERAGE_PITCH] = pitch
+ voices = _settingsManager.getSetting('voices')
+ voices[settings.DEFAULT_VOICE][acss.ACSS.AVERAGE_PITCH] = pitch
+ _settingsManager.setSetting('voices', voices)
def volumeValueChanged(self, widget):
"""Signal handler for the "value_changed" signal for the voiceScale
@@ -2876,7 +2892,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
volume = widget.get_value()
voiceType = self.get_widget("voiceTypes").get_active()
self._setVolumeForVoiceType(voiceType, volume)
- settings.voices[settings.DEFAULT_VOICE][acss.ACSS.GAIN] = volume
+ voices = _settingsManager.getSetting('voices')
+ voices[settings.DEFAULT_VOICE][acss.ACSS.GAIN] = volume
+ _settingsManager.setSetting('voices', voices)
def checkButtonToggled(self, widget):
"""Signal handler for "toggled" signal for basic GtkCheckButton
@@ -4113,8 +4131,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
- widget: the component that generated the signal.
"""
- self.prefsDict["presentToolTips"] = widget.get_active() and \
- settings.canPresentToolTips
+ self.prefsDict["presentToolTips"] = \
+ widget.get_active() \
+ and _settingsManager.getSetting('canPresentToolTips')
def disableKeyGrabChecked(self, widget):
"""Signal handler for the "toggled" signal for the
@@ -4202,10 +4221,11 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
- widget: the component that generated the signal.
"""
- self._setSpokenTextAttributes(self.getTextAttributesView,
- settings.allTextAttributes, True)
- self._setBrailledTextAttributes(self.getTextAttributesView,
- settings.allTextAttributes, True)
+ attributes = _settingsManager.getSetting('allTextAttributes')
+ self._setSpokenTextAttributes(
+ self.getTextAttributesView, attributes, True)
+ self._setBrailledTextAttributes(
+ self.getTextAttributesView, attributes, True)
self._updateTextDictEntry()
def textUnselectAllButtonClicked(self, widget):
@@ -4219,10 +4239,11 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
- widget: the component that generated the signal.
"""
- self._setSpokenTextAttributes(self.getTextAttributesView,
- settings.allTextAttributes, False)
- self._setBrailledTextAttributes(self.getTextAttributesView,
- settings.allTextAttributes, False)
+ attributes = _settingsManager.getSetting('allTextAttributes')
+ self._setSpokenTextAttributes(
+ self.getTextAttributesView, attributes, False)
+ self._setBrailledTextAttributes(
+ self.getTextAttributesView, attributes, False)
self._updateTextDictEntry()
def textResetButtonClicked(self, widget):
@@ -4236,12 +4257,21 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
- widget: the component that generated the signal.
"""
- self._setSpokenTextAttributes(self.getTextAttributesView,
- settings.allTextAttributes, False)
- self._setSpokenTextAttributes(self.getTextAttributesView,
- settings.enabledSpokenTextAttributes, True)
- self._setBrailledTextAttributes(self.getTextAttributesView,
- settings.enabledBrailledTextAttributes, True)
+ attributes = _settingsManager.getSetting('allTextAttributes')
+ self._setSpokenTextAttributes(
+ self.getTextAttributesView, attributes, False)
+ self._setBrailledTextAttributes(
+ self.getTextAttributesView, attributes, False)
+
+ attributes = _settingsManager.getSetting('enabledSpokenTextAttributes')
+ self._setSpokenTextAttributes(
+ self.getTextAttributesView, attributes, True)
+
+ attributes = \
+ _settingsManager.getSetting('enabledBrailledTextAttributes')
+ self._setBrailledTextAttributes(
+ self.getTextAttributesView, attributes, True)
+
self._updateTextDictEntry()
def textMoveToTopButtonClicked(self, widget):
@@ -4341,7 +4371,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
# Restore the default rate/pitch/gain,
# in case the user played with the sliders.
#
- defaultVoice = settings.voices[settings.DEFAULT_VOICE]
+ voices = _settingsManager.getSetting('voices')
+ defaultVoice = voices[settings.DEFAULT_VOICE]
defaultVoice[acss.ACSS.GAIN] = self.savedGain
defaultVoice[acss.ACSS.AVERAGE_PITCH] = self.savedPitch
defaultVoice[acss.ACSS.RATE] = self.savedRate
@@ -4583,7 +4614,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
self.prefsDict = _settingsManager.getGeneralSettings(activeProfile[1])
orca.showMainWindowGUI()
- if settings.showMainWindow:
+ if _settingsManager.getSetting('showMainWindow'):
self.window.present()
self._initGUIState()
@@ -4608,7 +4639,8 @@ class OrcaAdvancedMagGUI(OrcaSetupGUI):
OrcaSetupGUI.__init__(self, fileName, windowName)
self.prefsDict = prefsDict
- self.enableLiveUpdating = settings.enableMagLiveUpdating
+ self.enableLiveUpdating = \
+ _settingsManager.getSetting('enableMagLiveUpdating')
# To make pylint happy.
#
diff --git a/src/orca/scripts/apps/Instantbird/script.py b/src/orca/scripts/apps/Instantbird/script.py
index 7fb8910..64afc25 100644
--- a/src/orca/scripts/apps/Instantbird/script.py
+++ b/src/orca/scripts/apps/Instantbird/script.py
@@ -32,12 +32,13 @@ import orca.default as default
import orca.orca as orca
import orca.orca_state as orca_state
import orca.scripts.toolkits.Gecko as Gecko
-import orca.settings as settings
import orca.speech as speech
from chat import Chat
from script_utilities import Utilities
+_settingsManager = getattr(orca, '_settingsManager')
+
########################################################################
# #
# The Instantbird script class. #
@@ -207,8 +208,8 @@ class Script(Gecko.Script):
room2 = self.chat.getChatRoomName(event.source)
if room1 != room2:
speech.speak(room2)
- self.displayBrailleMessage(
- room2, flashTime=settings.brailleFlashTime)
+ flashTime = _settingsManager.getSetting('brailleFlashTime')
+ self.displayBrailleMessage(room2, flashTime)
orca.setLocusOfFocus(event, event.source)
return
diff --git a/src/orca/scripts/apps/Thunderbird/script.py b/src/orca/scripts/apps/Thunderbird/script.py
index 024e13b..606ab55 100644
--- a/src/orca/scripts/apps/Thunderbird/script.py
+++ b/src/orca/scripts/apps/Thunderbird/script.py
@@ -32,7 +32,6 @@ import orca.orca as orca
import orca.debug as debug
import orca.default as default
import orca.orca_state as orca_state
-import orca.settings as settings
import orca.speech as speech
import orca.scripts.toolkits.Gecko as Gecko
@@ -43,6 +42,8 @@ from speech_generator import SpeechGenerator
from script_utilities import Utilities
import script_settings
+_settingsManager = getattr(orca, '_settingsManager')
+
########################################################################
# #
# The Thunderbird script class. #
@@ -616,7 +617,7 @@ class Script(Gecko.Script):
self.setCaretPosition(obj, offset)
if not script_settings.sayAllOnLoad:
self.presentLine(obj, offset)
- elif settings.enableSpeech:
+ elif _settingsManager.getSetting('enableSpeech'):
self.sayAll(None)
self._messageLoaded = False
diff --git a/src/orca/scripts/apps/evolution/script.py b/src/orca/scripts/apps/evolution/script.py
index 0c41cda..53f0533 100644
--- a/src/orca/scripts/apps/evolution/script.py
+++ b/src/orca/scripts/apps/evolution/script.py
@@ -44,6 +44,8 @@ from formatting import Formatting
from speech_generator import SpeechGenerator
from script_utilities import Utilities
+_settingsManager = getattr(orca, '_settingsManager')
+
########################################################################
# #
# The Evolution script class. #
@@ -332,7 +334,7 @@ class Script(default.Script):
self.rolesList = [pyatspi.ROLE_TEXT, \
pyatspi.ROLE_PANEL, \
pyatspi.ROLE_TABLE_CELL]
- if settings.readTableCellRow \
+ if _settingsManager.getSetting('readTableCellRow') \
and (self.utilities.hasMatchingHierarchy(
event.source, self.rolesList)):
debug.println(self.debugLevel,
@@ -385,8 +387,9 @@ class Script(default.Script):
self.rolesList = [pyatspi.ROLE_TABLE_CELL, \
pyatspi.ROLE_TREE_TABLE]
- if settings.readTableCellRow and self.utilities.hasMatchingHierarchy(
- event.source, self.rolesList):
+ if _settingsManager.getSetting('readTableCellRow') \
+ and self.utilities.hasMatchingHierarchy(event.source,
+ self.rolesList):
debug.println(self.debugLevel,
"evolution.locusOfFocusChanged - mail view: " \
+ "message header list.")
@@ -397,7 +400,7 @@ class Script(default.Script):
# for the duration of this code section, then resetting it to
# True at the end.
#
- settings.readTableCellRow = False
+ _settingsManager.setSetting('readTableCellRow', False)
parent = event.source.parent
parentTable = parent.queryTable()
@@ -412,7 +415,7 @@ class Script(default.Script):
if self.lastMessageRow == row:
default.Script.locusOfFocusChanged(self, event,
oldLocusOfFocus, newLocusOfFocus)
- settings.readTableCellRow = True
+ _settingsManager.setSetting('readTableCellRow', True)
return
# This is an indication of whether we should speak all the table
@@ -432,8 +435,10 @@ class Script(default.Script):
self.lastMessageColumn == column) or \
justDeleted
- savedBrailleVerbosityLevel = settings.brailleVerbosityLevel
- savedSpeechVerbosityLevel = settings.speechVerbosityLevel
+ savedBrailleVerbosityLevel = \
+ _settingsManager.getSetting('brailleVerbosityLevel')
+ savedSpeechVerbosityLevel = \
+ _settingsManager.getSetting('speechVerbosityLevel')
brailleRegions = []
cellWithFocus = None
@@ -525,10 +530,12 @@ class Script(default.Script):
#
if (verbose or (checkbox and column == i)) \
and not useAlternativeName:
- settings.brailleVerbosityLevel = \
- settings.VERBOSITY_LEVEL_BRIEF
- settings.speechVerbosityLevel = \
- settings.VERBOSITY_LEVEL_BRIEF
+ _settingsManager.setSetting(
+ 'brailleVerbosityLevel',
+ settings.VERBOSITY_LEVEL_BRIEF)
+ _settingsManager.setSetting(
+ 'speechVerbosityLevel',
+ settings.VERBOSITY_LEVEL_BRIEF)
utterances = speechGen.generateSpeech(
header,
@@ -552,13 +559,14 @@ class Script(default.Script):
# then speak/braille "attachment".
#
if verbose:
- settings.brailleVerbosityLevel = \
- settings.VERBOSITY_LEVEL_VERBOSE
+ level = settings.VERBOSITY_LEVEL_VERBOSE
else:
- settings.brailleVerbosityLevel = \
- settings.VERBOSITY_LEVEL_BRIEF
- settings.speechVerbosityLevel = \
- savedSpeechVerbosityLevel
+ level = settings.VERBOSITY_LEVEL_BRIEF
+ _settingsManager.setSetting(
+ 'brailleVerbosityLevel', level)
+ _settingsManager.setSetting(
+ 'speechVerbosityLevel',
+ savedSpeechVerbosityLevel)
utterances = speechGen.generateSpeech(
cell,
includeContext=False,
@@ -619,11 +627,13 @@ class Script(default.Script):
if brailleRegions != []:
self.displayBrailleRegions([brailleRegions, cellWithFocus])
- settings.brailleVerbosityLevel = savedBrailleVerbosityLevel
- settings.speechVerbosityLevel = savedSpeechVerbosityLevel
+ _settingsManager.setSetting(
+ 'brailleVerbosityLevel', savedBrailleVerbosityLevel)
+ _settingsManager.setSetting(
+ 'speechVerbosityLevel', savedSpeechVerbosityLevel)
self.lastMessageColumn = column
self.lastMessageRow = row
- settings.readTableCellRow = True
+ _settingsManager.setSetting('readTableCellRow', True)
return
# 4) Calendar view: day view: tabbing to day with appts.
@@ -1187,10 +1197,12 @@ class Script(default.Script):
speechGen = self.speechGenerator
savedSpeechVerbosityLevel = settings.speechVerbosityLevel
- settings.speechVerbosityLevel = settings.VERBOSITY_LEVEL_BRIEF
+ _settingsManager.setSetting(
+ 'speechVerbosityLevel', settings.VERBOSITY_LEVEL_BRIEF)
utterances = speechGen.generateSpeech(tab)
speech.speak(utterances)
- settings.speechVerbosityLevel = savedSpeechVerbosityLevel
+ _settingsManager.setSetting(
+ 'speechVerbosityLevel', savedSpeechVerbosityLevel)
self.displayBrailleRegions(brailleGen.generateBraille(tab))
@@ -1232,12 +1244,14 @@ class Script(default.Script):
# Determine the correct "say all by" mode to use.
#
- if settings.sayAllStyle == settings.SAYALL_STYLE_SENTENCE:
+ sayAllStyle = _settingsManager.getSetting('sayAllStyle')
+ if sayAllStyle == settings.SAYALL_STYLE_SENTENCE:
mode = pyatspi.TEXT_BOUNDARY_SENTENCE_END
- elif settings.sayAllStyle == settings.SAYALL_STYLE_LINE:
+ elif sayAllStyle == settings.SAYALL_STYLE_LINE:
mode = pyatspi.TEXT_BOUNDARY_LINE_START
else:
mode = pyatspi.TEXT_BOUNDARY_LINE_START
+ voices = _settingsManager.getSetting('voices')
while not done:
panel = htmlPanel.getChildAtIndex(i)
@@ -1261,9 +1275,9 @@ class Script(default.Script):
len(mystr) == 0 or mystr[len(mystr)-1] in '.?!':
string = self.utilities.adjustForRepeats(string)
if string.decode("UTF-8").isupper():
- voice = settings.voices[settings.UPPERCASE_VOICE]
+ voice = voices[settings.UPPERCASE_VOICE]
else:
- voice = settings.voices[settings.DEFAULT_VOICE]
+ voice = voices[settings.DEFAULT_VOICE]
if not textObjs:
textObjs.append(textObj)
@@ -1290,9 +1304,9 @@ class Script(default.Script):
if len(string) != 0:
string = self.utilities.adjustForRepeats(string)
if string.decode("UTF-8").isupper():
- voice = settings.voices[settings.UPPERCASE_VOICE]
+ voice = voices[settings.UPPERCASE_VOICE]
else:
- voice = settings.voices[settings.DEFAULT_VOICE]
+ voice = voices[settings.DEFAULT_VOICE]
yield [speechserver.SayAllContext(textObjs, string,
startOffset, endOffset),
diff --git a/src/orca/scripts/apps/evolution/speech_generator.py b/src/orca/scripts/apps/evolution/speech_generator.py
index 6c9b05f..38eb330 100644
--- a/src/orca/scripts/apps/evolution/speech_generator.py
+++ b/src/orca/scripts/apps/evolution/speech_generator.py
@@ -27,11 +27,13 @@ __license__ = "LGPL"
import pyatspi
-import orca.settings as settings
+import orca.orca as orca
import orca.speech_generator as speech_generator
from orca.orca_i18n import _ # for gettext support
+_settingsManager = getattr(orca, '_settingsManager')
+
class SpeechGenerator(speech_generator.SpeechGenerator):
"""Overrides _generateSpeechForTableCell so that, if this is an
expanded table cell, we can strip off the "0 items".
@@ -85,7 +87,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
# formatting string to address the headers associated with
# toggle columns. That's really the difference here.]]]
#
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
diff --git a/src/orca/scripts/apps/gnome-panel/speech_generator.py b/src/orca/scripts/apps/gnome-panel/speech_generator.py
index c2c8884..efa2b72 100644
--- a/src/orca/scripts/apps/gnome-panel/speech_generator.py
+++ b/src/orca/scripts/apps/gnome-panel/speech_generator.py
@@ -27,9 +27,11 @@ __license__ = "LGPL"
import pyatspi
-import orca.settings as settings
+import orca.orca as orca
import orca.speech_generator as speech_generator
+_settingsManager = getattr(orca, '_settingsManager')
+
class SpeechGenerator(speech_generator.SpeechGenerator):
def __init__(self, script):
@@ -48,7 +50,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
acss = self.voice(speech_generator.DEFAULT)
role = args.get('role', obj.getRole())
if role == pyatspi.ROLE_FRAME:
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
else:
acss = self.voice(speech_generator.SYSTEM)
diff --git a/src/orca/scripts/apps/gnome-terminal/script.py b/src/orca/scripts/apps/gnome-terminal/script.py
index f387786..5378b69 100644
--- a/src/orca/scripts/apps/gnome-terminal/script.py
+++ b/src/orca/scripts/apps/gnome-terminal/script.py
@@ -36,6 +36,8 @@ import orca.orca_state as orca_state
import orca.settings as settings
import orca.speech as speech
+_settingsManager = getattr(orca, '_settingsManager')
+
########################################################################
# #
# The GnomeTerminal script class. #
@@ -251,9 +253,9 @@ class Script(default.Script):
# We might need to echo this if it is a single character.
#
speakThis = speakThis \
- or ((settings.enableEchoByCharacter \
- or (settings.enableKeyEcho \
- and settings.enablePrintableKeys)) \
+ or ((_settingsManager.getSetting('enableEchoByCharacter') \
+ or (_settingsManager.getSetting('enableKeyEcho') \
+ and _settingsManager.getSetting('enablePrintableKeys'))) \
and text \
and event.source.getRole() \
!= pyatspi.ROLE_PASSWORD_TEXT \
@@ -265,7 +267,7 @@ class Script(default.Script):
else:
speech.speak(text)
- if settings.enableEchoByWord \
+ if _settingsManager.getSetting('enableEchoByWord') \
and self.utilities.isWordDelimiter(text.decode("UTF-8")[-1:]):
if matchFound:
self.echoPreviousWord(event.source)
diff --git a/src/orca/scripts/apps/soffice/braille_generator.py b/src/orca/scripts/apps/soffice/braille_generator.py
index d932bd6..c1caa31 100644
--- a/src/orca/scripts/apps/soffice/braille_generator.py
+++ b/src/orca/scripts/apps/soffice/braille_generator.py
@@ -29,7 +29,9 @@ import pyatspi
import orca.braille as braille
import orca.braille_generator as braille_generator
-import orca.settings as settings
+import orca.orca as orca
+
+_settingsManager = getattr(orca, '_settingsManager')
class BrailleGenerator(braille_generator.BrailleGenerator):
@@ -162,8 +164,9 @@ class BrailleGenerator(braille_generator.BrailleGenerator):
for child in obj:
cellResult = self._generateRealTableCell(child, **args)
if cellResult and result and self._mode == 'braille':
- result.append(braille.Region(
- settings.brailleTableCellDelimiter))
+ delimiter = _settingsManager.getSetting(
+ 'brailleTableCellDelimiter')
+ result.append(braille.Region(delimiter))
result.extend(cellResult)
return result
@@ -186,7 +189,7 @@ class BrailleGenerator(braille_generator.BrailleGenerator):
#
parent = obj.parent
parentTable = parent.queryTable()
- if settings.readTableCellRow and parentTable:
+ if _settingsManager.getSetting('readTableCellRow') and parentTable:
index = self._script.utilities.cellIndex(obj)
row = parentTable.getRowAtIndex(index)
column = parentTable.getColumnAtIndex(index)
@@ -216,8 +219,9 @@ class BrailleGenerator(braille_generator.BrailleGenerator):
**args)
if cellResult and result \
and self._mode == 'braille':
- result.append(braille.Region(
- settings.brailleTableCellDelimiter))
+ delimiter = _settingsManager.getSetting(
+ 'brailleTableCellDelimiter')
+ result.append(braille.Region(delimiter))
result.extend(cellResult)
else:
result.extend(self._generateRealTableCell(obj, **args))
diff --git a/src/orca/scripts/apps/soffice/speech_generator.py b/src/orca/scripts/apps/soffice/speech_generator.py
index ef6c620..e458690 100644
--- a/src/orca/scripts/apps/soffice/speech_generator.py
+++ b/src/orca/scripts/apps/soffice/speech_generator.py
@@ -27,13 +27,14 @@ __license__ = "LGPL"
import pyatspi
+import orca.orca as orca
import orca.speech_generator as speech_generator
-import orca.settings as settings
from orca.orca_i18n import ngettext # for ngettext support
from orca.orca_i18n import _ # for gettext support
import script_settings
+_settingsManager = getattr(orca, '_settingsManager')
class SpeechGenerator(speech_generator.SpeechGenerator):
@@ -178,7 +179,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
if that description is different from that of the name and
label.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -378,7 +379,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
Returns an indication of how many characters are greater than the size
of the spread sheet cell, or None if the message fits.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -488,7 +489,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
def _generateTableCellRow(self, obj, **args):
"""Get the speech for a table cell row or a single table cell
- if settings.readTableCellRow is False. If this isn't inside a
+ if _settingsManager.getSetting('readTableCellRow') is False. If this isn't inside a
spread sheet, just return the utterances returned by the default
table cell speech handler.
@@ -499,7 +500,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
"""
result = []
if self._script.isSpreadSheetCell(obj):
- if settings.readTableCellRow:
+ if _settingsManager.getSetting('readTableCellRow'):
parent = obj.parent
parentTable = parent.queryTable()
index = self._script.utilities.cellIndex(obj)
@@ -535,7 +536,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
result.extend(
speech_generator.SpeechGenerator._generateTableCellRow(
self, obj, **args))
- if not len(result) and settings.speakBlankLines:
+ if not len(result) \
+ and _settingsManager.getSetting('speakBlankLines'):
# Translators: "blank" is a short word to mean the
# user has navigated to an empty line.
#
diff --git a/src/orca/scripts/apps/yelp/script.py b/src/orca/scripts/apps/yelp/script.py
index 9f76b8a..f92c1d6 100644
--- a/src/orca/scripts/apps/yelp/script.py
+++ b/src/orca/scripts/apps/yelp/script.py
@@ -29,7 +29,6 @@ import gtk
import pyatspi
import orca.orca as orca
-import orca.settings as settings
import orca.speech as speech
import orca.scripts.toolkits.Gecko as Gecko
@@ -37,6 +36,8 @@ import orca.scripts.toolkits.Gecko as Gecko
import script_settings
from script_utilities import Utilities
+_settingsManager = getattr(orca, '_settingsManager')
+
class Script(Gecko.Script):
def __init__(self, app):
@@ -209,7 +210,7 @@ class Script(Gecko.Script):
elif not Gecko.script_settings.sayAllOnLoad:
self.speakContents(\
self.getLineContentsAtOffset(obj, characterOffset))
- elif settings.enableSpeech:
+ elif _settingsManager.getSetting('enableSpeech'):
self.sayAll(None)
return
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 5932421..006fcae 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -79,6 +79,8 @@ from orca.orca_i18n import _
from orca.speech_generator import Pause
from orca.acss import ACSS
+_settingsManager = getattr(orca, '_settingsManager')
+
########################################################################
# #
# Script #
@@ -284,25 +286,27 @@ class Script(default.Script):
def activate(self):
"""Called when this script is activated."""
self.savedEnabledBrailledTextAttributes = \
- settings.enabledBrailledTextAttributes
- settings.enabledBrailledTextAttributes = \
- self.enabledBrailledTextAttributes
+ _settingsManager.getSetting('enabledBrailledTextAttributes')
+ _settingsManager.setSetting(
+ 'enabledBrailledTextAttributes', self.enabledBrailledTextAttributes)
self.savedEnabledSpokenTextAttributes = \
- settings.enabledSpokenTextAttributes
- settings.enabledSpokenTextAttributes = \
- self.enabledSpokenTextAttributes
+ _settingsManager.getSetting('enabledSpokenTextAttributes')
+ _settingsManager.setSetting(
+ 'enabledSpokenTextAttributes', self.enabledSpokenTextAttributes)
- self.savedAllTextAttributes = settings.allTextAttributes
- settings.allTextAttributes = self.allTextAttributes
+ self.savedAllTextAttributes = \
+ _settingsManager.getSetting('allTextAttributes')
+ _settingsManager.getSetting('allTextAttributes', self.allTextAttributes)
def deactivate(self):
"""Called when this script is deactivated."""
- settings.enabledBrailledTextAttributes = \
- self.savedEnabledBrailledTextAttributes
- settings.enabledSpokenTextAttributes = \
- self.savedEnabledSpokenTextAttributes
- settings.allTextAttributes = self.savedAllTextAttributes
+ _settingsManager.setSetting('enabledBrailledTextAttributes',
+ self.savedEnabledBrailledTextAttributes)
+ _settingsManager.setSetting('enabledSpokenTextAttributes',
+ self.savedEnabledSpokenTextAttributes)
+ _settingsManager.setSetting('allTextAttributes',
+ self.savedAllTextAttributes)
def getBookmarks(self):
"""Returns the "bookmarks" class for this script.
@@ -635,8 +639,8 @@ class Script(default.Script):
# load common keymap
keyBindings.load(keymaps.commonKeymap, self.inputEventHandlers)
- if orca.settings.keyboardLayout == \
- orca.settings.GENERAL_KEYBOARD_LAYOUT_DESKTOP:
+ if _settingsManager.getSetting('keyboardLayout') == \
+ orca.settings.GENERAL_KEYBOARD_LAYOUT_DESKTOP:
keyBindings.load(keymaps.desktopKeymap, self.inputEventHandlers)
else:
keyBindings.load(keymaps.laptopKeymap, self.inputEventHandlers)
@@ -780,8 +784,9 @@ class Script(default.Script):
gtk.Widget.show(self.speakCellCoordinatesCheckButton)
gtk.Box.pack_start(tableVBox, self.speakCellCoordinatesCheckButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.speakCellCoordinatesCheckButton,
- settings.speakCellCoordinates)
+ gtk.ToggleButton.set_active(
+ self.speakCellCoordinatesCheckButton,
+ _settingsManager.getSetting('speakCellCoordinates'))
# Translators: this is an option to tell Orca whether or not it
# should speak the span size of a table cell (e.g., how many
@@ -792,8 +797,9 @@ class Script(default.Script):
gtk.Widget.show(self.speakCellSpanCheckButton)
gtk.Box.pack_start(tableVBox, self.speakCellSpanCheckButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.speakCellSpanCheckButton,
- settings.speakCellSpan)
+ gtk.ToggleButton.set_active(
+ self.speakCellSpanCheckButton,
+ _settingsManager.getSetting('speakCellSpan'))
# Translators: this is an option for whether or not to speak
# the header of a table cell in document content.
@@ -803,8 +809,9 @@ class Script(default.Script):
gtk.Widget.show(self.speakCellHeadersCheckButton)
gtk.Box.pack_start(tableVBox, self.speakCellHeadersCheckButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.speakCellHeadersCheckButton,
- settings.speakCellHeaders)
+ gtk.ToggleButton.set_active(
+ self.speakCellHeadersCheckButton,
+ _settingsManager.getSetting('speakCellHeaders'))
# Translators: this is an option to allow users to skip over
# empty/blank cells when navigating tables in document content.
@@ -814,8 +821,9 @@ class Script(default.Script):
gtk.Widget.show(self.skipBlankCellsCheckButton)
gtk.Box.pack_start(tableVBox, self.skipBlankCellsCheckButton,
False, False, 0)
- gtk.ToggleButton.set_active(self.skipBlankCellsCheckButton,
- settings.skipBlankCells)
+ gtk.ToggleButton.set_active(
+ self.skipBlankCellsCheckButton,
+ _settingsManager.getSetting('skipBlankCells'))
# Translators: this is the title of a panel containing options
# for specifying how to navigate tables in document content.
@@ -960,19 +968,19 @@ class Script(default.Script):
#
value = self.speakCellCoordinatesCheckButton.get_active()
prefs.writelines("orca.settings.speakCellCoordinates = %s\n" % value)
- settings.speakCellCoordinates = value
+ _settingsManager.setSetting('speakCellCoordinates', value)
value = self.speakCellSpanCheckButton.get_active()
prefs.writelines("orca.settings.speakCellSpan = %s\n" % value)
- settings.speakCellSpan = value
+ _settingsManager.setSetting('speakCellSpan', value)
value = self.speakCellHeadersCheckButton.get_active()
prefs.writelines("orca.settings.speakCellHeaders = %s\n" % value)
- settings.speakCellHeaders = value
+ _settingsManager.setSetting('speakCellHeaders', value)
value = self.skipBlankCellsCheckButton.get_active()
prefs.writelines("orca.settings.skipBlankCells = %s\n" % value)
- settings.skipBlankCells = value
+ _settingsManager.setSetting('skipBlankCells', value)
def getAppState(self):
"""Returns an object that can be passed to setAppState. This
@@ -1020,7 +1028,7 @@ class Script(default.Script):
# we want to allow to control its own destiny).]]]
user_bindings = None
- user_bindings_map = settings.keyBindingsMap
+ user_bindings_map = _settingsManager.getSetting('keyBindingsMap')
if self.__module__ in user_bindings_map:
user_bindings = user_bindings_map[self.__module__]
elif "default" in user_bindings_map:
@@ -1063,8 +1071,8 @@ class Script(default.Script):
# Determine the correct "say all by" mode to use.
#
- sayAllBySentence = \
- (settings.sayAllStyle == settings.SAYALL_STYLE_SENTENCE)
+ sayAllStyle = _settingsManager.getSetting('sayAllStyle')
+ sayAllBySentence = sayAllStyle == settings.SAYALL_STYLE_SENTENCE
[obj, characterOffset] = self.getCaretContext()
if sayAllBySentence:
@@ -1482,8 +1490,8 @@ class Script(default.Script):
pyatspi.ROLE_FRAME]:
utterances = []
utterances.append(rolenames.getSpeechForRoleName(event.any_data))
- if settings.speechVerbosityLevel == \
- settings.VERBOSITY_LEVEL_VERBOSE:
+ verbosity = _settingsManager.getSetting('speechVerbosityLevel')
+ if verbosity == settings.VERBOSITY_LEVEL_VERBOSE:
utterances.extend(
self.speechGenerator.generateSpeech(event.any_data))
speech.speak(utterances)
@@ -1707,8 +1715,8 @@ class Script(default.Script):
# or if the user forced it to appear with (Alt+)Down Arrow.
#
if self._autocompleteVisible:
- speakIt = (settings.speechVerbosityLevel == \
- settings.VERBOSITY_LEVEL_VERBOSE)
+ level = _settingsManager.getSetting('speechVerbosityLevel')
+ speakIt = level == settings.VERBOSITY_LEVEL_VERBOSE
if not speakIt \
and isinstance(orca_state.lastInputEvent,
input_event.KeyboardEvent):
@@ -1817,7 +1825,7 @@ class Script(default.Script):
self.speakContents(\
self.getLineContentsAtOffset(obj,
characterOffset))
- elif settings.enableSpeech:
+ elif _settingsManager.getSetting('enableSpeech'):
self.sayAll(None)
return
@@ -2885,7 +2893,7 @@ class Script(default.Script):
# regions. We will handle everything else as a live region. We
# will do the cheap tests first
if self._loadingDocumentContent \
- or not settings.inferLiveRegions:
+ or not _settingsManager.getSetting('inferLiveRegions'):
return False
# Ideally, we would like to do a inDocumentContent() call to filter out
@@ -2921,7 +2929,8 @@ class Script(default.Script):
and not 'tooltip' in attrList:
return False
# Only present tooltips when user wants them presented
- elif 'tooltip' in attrList and not settings.presentToolTips:
+ elif 'tooltip' in attrList \
+ and not _settingsManager.getSetting('presentToolTips'):
return False
else:
# Some alerts have been seen without the :system postfix.
@@ -3668,7 +3677,7 @@ class Script(default.Script):
and unvisited links on the page containing obj.
"""
- if settings.useCollection:
+ if _settingsManager.getSetting('useCollection'):
try:
summary = self._collectionPageSummary()
except:
@@ -5339,7 +5348,7 @@ class Script(default.Script):
clumped.append([element, acss])
if (len(clumped) == 1) and (clumped[0][0] == "\n"):
- if settings.speakBlankLines:
+ if _settingsManager.getSetting('speakBlankLines'):
# Translators: "blank" is a short word to mean the
# user has navigated to an empty line.
#
@@ -6156,7 +6165,7 @@ class Script(default.Script):
def advanceLivePoliteness(self, inputEvent):
"""Advances live region politeness level."""
- if settings.inferLiveRegions:
+ if _settingsManager.getSetting('inferLiveRegions'):
self.liveMngr.advancePoliteness(orca_state.locusOfFocus)
else:
# Translators: this announces to the user that live region
@@ -6165,14 +6174,14 @@ class Script(default.Script):
self.presentMessage(_("Live region support is off"))
def monitorLiveRegions(self, inputEvent):
- if not settings.inferLiveRegions:
- settings.inferLiveRegions = True
+ if not _settingsManager.getSetting('inferLiveRegions'):
+ _settingsManager.setSetting('inferLiveRegions', True)
# Translators: this announces to the user that live region
# are being monitored.
#
self.presentMessage(_("Live regions monitoring on"))
else:
- settings.inferLiveRegions = False
+ _settingsManager.setSetting('inferLiveRegions', False)
# Translators: this announces to the user that live region
# are not being monitored.
#
@@ -6180,7 +6189,7 @@ class Script(default.Script):
self.presentMessage(_("Live regions monitoring off"))
def setLivePolitenessOff(self, inputEvent):
- if settings.inferLiveRegions:
+ if _settingsManager.getSetting('inferLiveRegions'):
self.liveMngr.setLivePolitenessOff()
else:
# Translators: this announces to the user that live region
@@ -6189,7 +6198,7 @@ class Script(default.Script):
self.presentMessage(_("Live region support is off"))
def reviewLiveAnnouncement(self, inputEvent):
- if settings.inferLiveRegions:
+ if _settingsManager.getSetting('inferLiveRegions'):
self.liveMngr.reviewLiveAnnouncement( \
int(inputEvent.event_string[1:]))
else:
diff --git a/src/orca/scripts/toolkits/Gecko/speech_generator.py b/src/orca/scripts/toolkits/Gecko/speech_generator.py
index 6018792..81745e4 100644
--- a/src/orca/scripts/toolkits/Gecko/speech_generator.py
+++ b/src/orca/scripts/toolkits/Gecko/speech_generator.py
@@ -31,13 +31,15 @@ __license__ = "LGPL"
import pyatspi
+import orca.orca as orca
import orca.rolenames as rolenames
-import orca.settings as settings
import orca.speech_generator as speech_generator
from orca.orca_i18n import _
from orca.orca_i18n import ngettext # for ngettext support
+_settingsManager = getattr(orca, '_settingsManager')
+
########################################################################
# #
# Custom SpeechGenerator #
@@ -286,7 +288,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
return result
def _generateNumberOfChildren(self, obj, **args):
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -420,7 +422,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
# Finally add the role if it's not among the roles we don't
# wish to speak.
#
- if not settings.onlySpeakDisplayedText:
+ if not _settingsManager.getSetting('onlySpeakDisplayedText'):
acss = self.voice(speech_generator.SYSTEM)
if not (role in dontSpeakRoles) and len(newResult):
roleInfo = rolenames.getSpeechForRoleName(parent)
diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
index 68fac1a..2d70557 100644
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
+++ b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
@@ -27,11 +27,13 @@ __license__ = "LGPL"
import pyatspi
-import orca.settings as settings
+import orca.orca as orca
import orca.speech_generator as speech_generator
from orca.orca_i18n import ngettext
+_settingsManager = getattr(orca, '_settingsManager')
+
########################################################################
# #
# Speech Generator #
@@ -84,7 +86,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
specifications) that represents the number of children the
object has."""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -110,7 +112,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
object in a list.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
listObj = None
@@ -142,7 +144,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
if nextName == name:
position = index
- if (settings.enablePositionSpeaking or args.get('forceList', False)) \
+ if (_settingsManager.getSetting('enablePositionSpeaking') \
+ or args.get('forceList', False)) \
and position >= 0:
result.append(self._script.formatting.getString(
mode='speech', stringType='groupindex') \
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index db2a33f..956a1a7 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -29,6 +29,7 @@ import urlparse, urllib2
import generator
import pyatspi
+import orca
import rolenames
import settings
import sound
@@ -79,6 +80,8 @@ voiceType = {
VALUE : settings.SYSTEM_VOICE, # Users may prefer DEFAULT_VOICE here
}
+_settingsManager = getattr(orca, '_settingsManager')
+
class SpeechGenerator(generator.Generator):
"""Takes accessible objects and produces a string to speak for
those objects. See the generateSpeech method, which is the primary
@@ -103,8 +106,9 @@ class SpeechGenerator(generator.Generator):
settings.py:sounds dictionary (e.g., a pyatspi.ROLE_* value)
or just the name of an audio file to use.
"""
+ sounds = _settingsManager.getSetting('sounds')
try:
- soundBite = sound.Sound(settings.sounds[key])
+ soundBite = sound.Sound(sounds[key])
except:
if isinstance(key, basestring):
soundBite = sound.Sound(key)
@@ -138,7 +142,7 @@ class SpeechGenerator(generator.Generator):
role = args.get('role', obj.getRole())
if role == pyatspi.ROLE_LAYERED_PANE:
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
else:
acss = self.voice(SYSTEM)
@@ -180,7 +184,7 @@ class SpeechGenerator(generator.Generator):
represent the description of the object, if that description
is different from that of the name and label.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
acss = self.voice(SYSTEM)
@@ -212,7 +216,7 @@ class SpeechGenerator(generator.Generator):
of a speech generator that we can update and the user can
override.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -228,7 +232,7 @@ class SpeechGenerator(generator.Generator):
Note that a 'role' attribute in args will override the
accessible role of the obj.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -294,7 +298,7 @@ class SpeechGenerator(generator.Generator):
for check boxes. [[[WDW - should we return an empty array if
we can guarantee we know this thing is not checkable?]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
acss = self.voice(STATE)
@@ -309,7 +313,7 @@ class SpeechGenerator(generator.Generator):
tree node. If the object is not expandable, an empty array
will be returned.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
acss = self.voice(STATE)
@@ -323,7 +327,7 @@ class SpeechGenerator(generator.Generator):
represent the checked state of the menu item, only if it is
checked. Otherwise, and empty array will be returned.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
acss = self.voice(STATE)
@@ -339,7 +343,7 @@ class SpeechGenerator(generator.Generator):
the object. This is typically for check boxes. If the object
is not multiselectable, an empty array will be returned.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -360,7 +364,7 @@ class SpeechGenerator(generator.Generator):
for check boxes. [[[WDW - should we return an empty array if
we can guarantee we know this thing is not checkable?]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
acss = self.voice(STATE)
@@ -375,7 +379,7 @@ class SpeechGenerator(generator.Generator):
for check boxes. [[[WDW - should we return an empty array if
we can guarantee we know this thing is not checkable?]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
acss = self.voice(STATE)
@@ -671,7 +675,7 @@ class SpeechGenerator(generator.Generator):
oldRole = self._overrideRole('REAL_ROLE_TABLE_CELL', args)
result.extend(self.generate(obj, **args))
self._restoreRole(oldRole, args)
- if not result and settings.speakBlankLines \
+ if not result and _settingsManager.getSetting('speakBlankLines') \
and not args.get('readingRow', False):
# Translators: "blank" is a short word to mean the
# user has navigated to an empty line.
@@ -690,7 +694,7 @@ class SpeechGenerator(generator.Generator):
returned. [[[WDW - I wonder if this string should be moved to
settings.py.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -738,7 +742,7 @@ class SpeechGenerator(generator.Generator):
"""Returns an array of strings (and possibly voice and audio
specifications) reflecting the column number of a cell.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -767,7 +771,7 @@ class SpeechGenerator(generator.Generator):
"""Returns an array of strings (and possibly voice and audio
specifications) reflecting the row number of a cell.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -798,7 +802,7 @@ class SpeechGenerator(generator.Generator):
of its column number, the total number of columns, its row,
and the total number of rows.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -833,12 +837,13 @@ class SpeechGenerator(generator.Generator):
specifications) indicating that this cell is the last cell
in the table.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
acss = self.voice(SYSTEM)
- if settings.speechVerbosityLevel == settings.VERBOSITY_LEVEL_VERBOSE:
+ if _settingsManager.getSetting('speechVerbosityLevel') \
+ == settings.VERBOSITY_LEVEL_VERBOSE:
if obj.getRole() == pyatspi.ROLE_TABLE_CELL:
cell = obj
else:
@@ -1024,7 +1029,7 @@ class SpeechGenerator(generator.Generator):
char = textObj.getTextAtOffset(caretOffset,
pyatspi.TEXT_BOUNDARY_CHAR)
if char[0] == "\n" and startOffset == caretOffset \
- and settings.speakBlankLines:
+ and _settingsManager.getSetting('speakBlankLines'):
# Translators: "blank" is a short word to mean the
# user has navigated to an empty line.
#
@@ -1111,7 +1116,7 @@ class SpeechGenerator(generator.Generator):
object is selected. [[[WDW - I wonder if this string should be
moved to settings.py.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1135,7 +1140,7 @@ class SpeechGenerator(generator.Generator):
object is selected. [[[WDW - I wonder if this string should be
moved to settings.py.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1168,11 +1173,11 @@ class SpeechGenerator(generator.Generator):
- obj: the text object.
- line: the string to check for spaces and tabs.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
acss = self.voice(SYSTEM)
- if not settings.enableSpeechIndentation:
+ if not _settingsManager.getSetting('enableSpeechIndentation'):
return []
line = args.get('alreadyFocused', "")
if not line:
@@ -1236,7 +1241,7 @@ class SpeechGenerator(generator.Generator):
is typically set by Orca to be the previous object with
focus.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1260,7 +1265,7 @@ class SpeechGenerator(generator.Generator):
object. This is typically for progress bars. [[[WDW - we
should consider returning an empty array if there is no value.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1336,7 +1341,7 @@ class SpeechGenerator(generator.Generator):
this doesn't apply?]]] [[[WDW - I wonder if this string should
be moved to settings.py.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1360,7 +1365,7 @@ class SpeechGenerator(generator.Generator):
apply?]]] [[[WDW - I wonder if this string should be moved to
settings.py.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1387,7 +1392,7 @@ class SpeechGenerator(generator.Generator):
apply?]]] [[[WDW - I wonder if this string should be moved to
settings.py.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1406,7 +1411,7 @@ class SpeechGenerator(generator.Generator):
and the position of the current item. This object will be an icon
panel or a layered pane.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1469,7 +1474,7 @@ class SpeechGenerator(generator.Generator):
[[[WDW - I wonder if this string should be moved to
settings.py.]]]
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1589,7 +1594,7 @@ class SpeechGenerator(generator.Generator):
specifications) that represent the relative position of an
object in a group.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1625,7 +1630,7 @@ class SpeechGenerator(generator.Generator):
specifications) that represent the relative position of an
object in a list.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1695,7 +1700,7 @@ class SpeechGenerator(generator.Generator):
if nextName == name:
position = index
- if (settings.enablePositionSpeaking \
+ if (_settingsManager.getSetting('enablePositionSpeaking') \
or args.get('forceList', False)) \
and position >= 0:
result.append(self._script.formatting.getString(
@@ -1791,7 +1796,7 @@ class SpeechGenerator(generator.Generator):
specifications) that represent the accelerator for the object,
or an empty array if no accelerator can be found.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1809,12 +1814,13 @@ class SpeechGenerator(generator.Generator):
specifications) that represent the mnemonic for the object, or
an empty array if no mnemonic can be found.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
acss = self.voice(SYSTEM)
- if settings.enableMnemonicSpeaking or args.get('forceMnemonic', False):
+ if _settingsManager.getSetting('enableMnemonicSpeaking') \
+ or args.get('forceMnemonic', False):
[mnemonic, shortcut, accelerator] = \
self._script.utilities.mnemonicShortcutAccelerator(obj)
if mnemonic:
@@ -1841,7 +1847,7 @@ class SpeechGenerator(generator.Generator):
tutorial generator. A tutorial can be forced by setting the
'forceTutorial' attribute of the args dictionary to True.
"""
- if settings.onlySpeakDisplayedText:
+ if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
result = []
@@ -1884,4 +1890,5 @@ class SpeechGenerator(generator.Generator):
"""
voicename = voiceType.get(key) or voiceType.get(DEFAULT)
- return [settings.voices.get(voicename)]
+ voices = _settingsManager.getSetting('voices')
+ return [voices.get(voicename)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]