After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350294 - _initGUIState in GUI prefs can issue a TypeError
_initGUIState in GUI prefs can issue a TypeError
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: magnification
0.2.x
Other All
: Normal normal
: ---
Assigned To: Rich Burridge
Orca Maintainers
: 350382 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-07 15:27 UTC by Willie Walker
Modified: 2006-08-08 07:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for the problem (plus one other). (1.38 KB, patch)
2006-08-07 16:36 UTC, Rich Burridge
none Details | Review

Description Willie Walker 2006-08-07 15:27:02 UTC
From an e-mail with community member Jorge Sandín:

The first time you start up orca (without ~/.orca directory and user-settings.py file), there's an error:

  • File "/usr/local/lib/python2.4/site-packages/orca/orca_gui_prefs.py", line 388 in _initGUIState
    self.magMouseTrackingComboBox.set_active(index)
TypeError: an integer is required

----

A potential workaround provided by Jorge is this (thanks Jorge!):

Change the line orca_gui_prefs.py: 388:

     index = self._getComboBoxIndex(self.magMouseTrackingComboBox, mode)
     self.magMouseTrackingComboBox.set_active(index)

to:

     index = self._getComboBoxIndex(self.magMouseTrackingComboBox, mode)
     if index != None:
          self.magMouseTrackingComboBox.set_active(index)
Comment 1 Rich Burridge 2006-08-07 16:36:57 UTC
Created attachment 70404 [details] [review]
Fix for the problem (plus one other).
Comment 2 Rich Burridge 2006-08-07 16:47:06 UTC
There were two problems here:

1/ The _getComboBoxIndex() in orca_gui_prefs.py should return
   0 rather than None if the "str" string to search for isn't
   found. There should have been a valid mode string going into
   the _getComboBoxIndex() routine (from the

          else:
            mode = _("Centered")

  in the _initGUIState() above. If this is not found, this suggests
  that you are running in a locale where these strings have not been
  consistently localized. For now, the _getComboBoxIndex() is more
  bullet-proof and will return 0 (the default -- Centered -- value).

2/ The initial value for orca_state.lastInputEventTimestamp should
   have been 0 not None. When there is no initial ~/.orca directory
   and/or ~/.orca/user-settings.py file, then this initial value is
   going to be used and therefore be of the correct type.
Comment 3 Jorge Sandín 2006-08-08 07:05:27 UTC
*** Bug 350382 has been marked as a duplicate of this bug. ***