Bug 82909

Summary: closing outline triangle results in error to console
Product: [Retired] Red Hat Linux Reporter: Scott R. Godin <rhbugzilla>
Component: redhat-config-mouseAssignee: Brent Fox <bfox>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-28 20:10:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Scott R. Godin 2003-01-28 13:41:55 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020830

Description of problem:
closing a tab-triangle (outline view) in the dialog box, which has been 'left
open' from a previous usage, generates a warning/traceback to the console/xterm. 

Version-Release number of selected component (if applicable):
$ rpm -qf `where redhat-config-mouse`

How reproducible:

Steps to Reproduce:
1.run redhat-config-mouse, open the Microsoft tab-triangle, and select the
Intellimouse (USB) (for example)
2.close the dialog in the normal way

8:24am {1} pcp02404936pcs:/usr/doc/pam-0.75/ps>$ redhat-config-mouse
Shutting down console mouse services:                      [  OK  ]
Starting console mouse services:                           [  OK  ]

as you can see, things work normally.

3.now, re-run redhat-config-mouse, and click the triangle to CLOSE it, and the
error is generated to the console/xterm.

Actual Results:  
Traceback (most recent call last):
  File "/usr/share/redhat-config-mouse/mouse_gui.py", line 175, in selectMouse
    type = self.mouseStore.get_value(iter, 2)
TypeError: iter must be a GtkTreeIter

Expected Results:  no error message :)

Additional info:

problem occurrs with any triangle-tab left open from the previous usage (such as
Generic when having just selected a generic 2-button PS/2 mouse) and re-running
the configurator and trying to close the Generic tab-triangle.

Comment 1 Brent Fox 2003-01-28 19:19:29 UTC
I believe that this bug has already been fixed in Rawhide.  The problem was that
the program was allowing you to click the OK button even though no mouse was
currently selected in the list because the focus was now on the tree root (the
Manufacturer) instead of the branch (the actual mouse name).  

This caused the program to write out a config file with no mouse.  Then, when
running the program again, it would crash because the config file was messed up.
 redhat-config-mouse no longer allows you to click OK if no mouse is selected,
so this bug should no longer happen.  QA, please verify with the latest tree.

Comment 2 Scott R. Godin 2003-01-28 19:40:49 UTC
not sure.. The problem occurred before even getting anywhere near the OK button.
A mouse was definitely selected in the window, even when re-starting the app ..
just when you go and click the down-pointing outline triangle to turn it into a
right-pointing one, is when you see the error message to the console
(immediately. LONG before clicking the OK button). 

Comment 3 Brent Fox 2003-01-28 20:10:20 UTC
Oh, right.  The selectMouse() function gets called every time you select a mouse
in the list.  In the event that you selected the triangle, it would try to get
the value of the GtkTreeIter, which of course the triangle doesn't have an iter
associated with it.  I added a check a number of months ago that avoids this bug
by calling a "return" early in the function if the iter does not exist.

    def selectMouse(self, selection, *args):
        model, iter = selection.get_selected()
        if not iter:
        type = self.mouseStore.get_value(iter, 2)
        emu3 = self.mouseStore.get_value(iter, 3)

The "if" check above will return from the selectMouse function before it tries
to call a get_value for the iter (which does not exist).  I'm certain that this
bug doesn't occur in versions 1.0.3-4 and later.