[orca/new-settings] Fix for Orca Prefs dialog not loading initially for yaml:
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/new-settings] Fix for Orca Prefs dialog not loading initially for yaml:
- Date: Thu, 28 Oct 2010 12:32:48 +0000 (UTC)
commit e766fa4ea01796ca1c9d70ce0272be86bf94316e
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Thu Oct 28 08:27:27 2010 -0400
Fix for Orca Prefs dialog not loading initially for yaml:
* Prefs dialog now loads automatically for yaml backend until
settings are initially saved by the user.
* Adds a missing setFirstStart() to the yaml backend.
* Makes setFirstStart() take an optional argument of the value
to which the 'firstStart' user-configurable setting should be
set to.
src/orca/backends/gconf_backend.py | 10 +++++-----
src/orca/backends/yaml_backend.py | 18 ++++++++++++++----
src/orca/orca.py | 5 ++---
src/orca/orca_console_prefs.py | 1 +
src/orca/orca_gui_prefs.py | 1 +
src/orca/settings_manager.py | 13 +++++++------
6 files changed, 30 insertions(+), 18 deletions(-)
---
diff --git a/src/orca/backends/gconf_backend.py b/src/orca/backends/gconf_backend.py
index 23a89ac..11410ca 100644
--- a/src/orca/backends/gconf_backend.py
+++ b/src/orca/backends/gconf_backend.py
@@ -414,9 +414,9 @@ class Backend:
firstStartPath = self.GCONF_BASE_DIR + '/firstStart'
return self._client.get_bool(firstStartPath)
- def setFirstStart(self):
- """Set firstStart key to false
- This means the profile is being stored and it isn't a first start
- anymore."""
+ def setFirstStart(self, value=False):
+ """Set firstStart. This user-configurable settting is primarily
+ intended to serve as an indication as to whether or not initial
+ configuration is needed."""
firstStartPath = self.GCONF_BASE_DIR + '/firstStart'
- self._client.set_bool(firstStartPath, False)
+ self._client.set_bool(firstStartPath, value)
diff --git a/src/orca/backends/yaml_backend.py b/src/orca/backends/yaml_backend.py
index d5a11e4..f239656 100644
--- a/src/orca/backends/yaml_backend.py
+++ b/src/orca/backends/yaml_backend.py
@@ -128,10 +128,20 @@ class Backend:
def isFirstStart(self):
""" Check if we're in first start. """
- if os.path.exists(self.settingsFile):
- return False
- else:
- return True
+
+ if not self.general:
+ if os.path.exists(self.settingsFile):
+ self._getSettings()
+
+ return self.general.get('firstStart', True)
+
+ def setFirstStart(self, value=False):
+ """Set firstStart. This user-configurable settting is primarily
+ intended to serve as an indication as to whether or not initial
+ configuration is needed."""
+
+ self._getSettings()
+ self.general['firstStart'] = value
def availableProfiles(self):
""" List available profiles. DEPRECATED? """
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 42dc565..096ca51 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -2237,9 +2237,8 @@ def main():
#
if setupRequested and (not bypassSetup) and showGUI:
showPreferencesGUI()
- elif (not _userSettings) and (not bypassSetup) or \
- (not _settingsManager.isClassic()) and \
- (not bypassSetup) and _settingsManager.isFirstStart():
+ elif not bypassSetup \
+ and (not _userSettings or _settingsManager.isFirstStart()):
if desktopRunning:
if not os.path.exists(userprefs):
# Hack to work around b.g.o. 601657.
diff --git a/src/orca/orca_console_prefs.py b/src/orca/orca_console_prefs.py
index c70d150..93e682b 100644
--- a/src/orca/orca_console_prefs.py
+++ b/src/orca/orca_console_prefs.py
@@ -582,6 +582,7 @@ def showPreferencesUI(commandLineSettings):
stop = False
sayAndPrint(_("Please enter y or n."))
+ prefsDict['firstStart'] = False
logoutNeeded = orca_prefs.writePreferences(prefsDict)
if logoutNeeded:
sayAndPrint(_("Accessibility support for GNOME has just been enabled."),
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 6ba7b7b..7307bd2 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -4426,6 +4426,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
self.prefsDict['activeProfile'] = activeProfile
self.prefsDict['startingProfile'] = startingProfile
+ self.prefsDict['firstStart'] = False
self.writeUserPreferences()
diff --git a/src/orca/settings_manager.py b/src/orca/settings_manager.py
index 8764f5a..82c73b0 100644
--- a/src/orca/settings_manager.py
+++ b/src/orca/settings_manager.py
@@ -340,16 +340,17 @@ class SettingsManager():
def isFirstStart(self):
"""Check if the firstStart key is True or false"""
if self.isClassic():
- return False
+ return settings.firstStart
else:
return self._backend.isFirstStart()
- def setFirstStart(self):
- """Set firstStart key to false
- This means the profile is being stored and it isn't a first start
- anymore."""
+ def setFirstStart(self, value=False):
+ """Set firstStart. This user-configurable settting is primarily
+ intended to serve as an indication as to whether or not initial
+ configuration is needed."""
+
if not self.isClassic():
- self._backend.setFirstStart()
+ self._backend.setFirstStart(value)
def availableProfiles(self):
"""Get available profiles from active backend"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]