[orca/new-settings] First attempt at getting the keybindings written out.
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/new-settings] First attempt at getting the keybindings written out.
- Date: Wed, 27 Oct 2010 06:26:17 +0000 (UTC)
commit fee66444b262c6a5a431b80c8e8d7aee974e17da
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Wed Oct 27 02:24:22 2010 -0400
First attempt at getting the keybindings written out.
src/orca/orca_gui_prefs.py | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 37e742d..0dc57dc 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -508,7 +508,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
"""Write out the user's generic Orca preferences.
"""
pronunciationDict = self.getModelDict(self.pronunciationModel)
- keyBindingsDict = {} #self.getModelDict(self.keyBindingsModel)
+ keyBindingsDict = self.getKeyBindingsModelDict(self.keyBindingsModel)
if _settingsManager.saveSettings(self.prefsDict,
pronunciationDict,
keyBindingsDict):
@@ -2301,6 +2301,25 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
activeName = model.get_value(activeIter, 1)
return [activeLabel, activeName]
+ def getKeyBindingsModelDict(self, model, modifiedOnly=True):
+ modelDict = {}
+ node = model.get_iter_first()
+ while node:
+ child = model.iter_children(node)
+ while child:
+ key, modified = model.get(child, HANDLER, MODIF)
+ if modified or not modifiedOnly:
+ value = []
+ value.append(model.get(
+ child, KEY1, MOD_MASK1, MOD_USED1, CLICK_COUNT1))
+ value.append(model.get(
+ child, KEY2, MOD_MASK2, MOD_USED2, CLICK_COUNT2))
+ modelDict[key] = value
+ child = model.iter_next(child)
+ node = model.iter_next(node)
+
+ return modelDict
+
def getModelDict(self, model):
"""Get the list of values from a list[str,str] model
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]