[orca] Fix for Orca saying "Primary" for mnemonic Ctrl++



commit 6d1ce50a96a18b3025f4839573e5ee27c0bf83b2
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue May 22 10:12:09 2012 -0400

    Fix for Orca saying "Primary" for mnemonic Ctrl++

 src/orca/keynames.py         |    8 ++++----
 src/orca/script_utilities.py |    3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/keynames.py b/src/orca/keynames.py
index d533330..a8ebbea 100644
--- a/src/orca/keynames.py
+++ b/src/orca/keynames.py
@@ -330,12 +330,12 @@ def localizeKeySequence(keys):
     for key in keyList:
         keyName = getKeyName(key)
         try:
-            key = key.decode("UTF-8")
-        except UnicodeEncodeError:
+            key = key.encode("UTF-8")
+        except UnicodeDecodeError:
             pass
         try:
-            keyName = keyName.decode("UTF-8")
-        except UnicodeEncodeError:
+            keyName = keyName.encode("UTF-8")
+        except UnicodeDecodeError:
             pass
         keys = keys.replace(key, keyName)
 
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 6fda8d3..b3c2e07 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2838,7 +2838,8 @@ class Utilities:
             from gi.repository import Gtk
             key, mods = Gtk.accelerator_parse(sequence)
             newSequence = Gtk.accelerator_get_label(key, mods)
-            if newSequence and not newSequence.endswith('+'):
+            if newSequence and \
+               (not newSequence.endswith('+') or newSequence.endswith('++')):
                 sequence = newSequence
         except:
             if sequence.endswith(" "):



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