[orca] Handle situation where users customized indicators incorrectly
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca] Handle situation where users customized indicators incorrectly
- Date: Thu, 9 Jul 2009 19:29:18 +0000 (UTC)
commit f921b0029830674971e069f6e47973aeea307d90
Author: Willie Walker <william walker sun com>
Date: Thu Jul 9 15:26:54 2009 -0400
Handle situation where users customized indicators incorrectly
Some users have included indeterminate values in their indicator lists
for objects that do not have indeterminate values (e.g., radio buttons).
The braille refactor didn't account for this. This change permits their
incorrect code to still work.
src/orca/generator.py | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/src/orca/generator.py b/src/orca/generator.py
index 6da06c6..4ee1fb9 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -64,6 +64,9 @@ class Generator:
# pylint: disable-msg=W0142
def __init__(self, script, mode):
+
+ # pylint: disable-msg=W0108
+
self._mode = mode
self._script = script
self._methodsDict = {}
@@ -448,14 +451,14 @@ class Generator:
if not args.get('mode', None):
args['mode'] = self._mode
args['stringType'] = 'checkbox'
- [no, yes, indeterminate] = self._script.formatting.getString(**args)
+ indicators = self._script.formatting.getString(**args)
state = obj.getState()
if state.contains(pyatspi.STATE_INDETERMINATE):
- result.append(indeterminate)
+ result.append(indicators[2])
elif state.contains(pyatspi.STATE_CHECKED):
- result.append(yes)
+ result.append(indicators[1])
else:
- result.append(no)
+ result.append(indicators[0])
return result
def _generateRadioState(self, obj, **args):
@@ -468,12 +471,12 @@ class Generator:
if not args.get('mode', None):
args['mode'] = self._mode
args['stringType'] = 'radiobutton'
- [no, yes] = self._script.formatting.getString(**args)
+ indicators = self._script.formatting.getString(**args)
state = obj.getState()
if state.contains(pyatspi.STATE_CHECKED):
- result.append(yes)
+ result.append(indicators[1])
else:
- result.append(no)
+ result.append(indicators[0])
return result
def _generateToggleState(self, obj, **args):
@@ -486,13 +489,13 @@ class Generator:
if not args.get('mode', None):
args['mode'] = self._mode
args['stringType'] = 'togglebutton'
- [no, yes] = self._script.formatting.getString(**args)
+ indicators = self._script.formatting.getString(**args)
state = obj.getState()
if state.contains(pyatspi.STATE_CHECKED) \
or state.contains(pyatspi.STATE_PRESSED):
- result.append(yes)
+ result.append(indicators[1])
else:
- result.append(no)
+ result.append(indicators[0])
return result
def _generateMenuItemCheckedState(self, obj, **args):
@@ -504,11 +507,11 @@ class Generator:
if not args.get('mode', None):
args['mode'] = self._mode
args['stringType'] = 'checkbox'
- [no, yes, indeterminate] = self._script.formatting.getString(**args)
+ indicators = self._script.formatting.getString(**args)
if obj.getState().contains(pyatspi.STATE_CHECKED):
# Translators: this represents the state of a checked menu item.
#
- result.append(yes)
+ result.append(indicators[1])
return result
def _generateExpandableState(self, obj, **args):
@@ -521,13 +524,13 @@ class Generator:
if not args.get('mode', None):
args['mode'] = self._mode
args['stringType'] = 'expansion'
- [no, yes] = self._script.formatting.getString(**args)
+ indicators = self._script.formatting.getString(**args)
state = obj.getState()
if state.contains(pyatspi.STATE_EXPANDABLE):
if state.contains(pyatspi.STATE_EXPANDED):
- result.append(yes)
+ result.append(indicators[1])
else:
- result.append(no)
+ result.append(indicators[0])
return result
#####################################################################
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]