opening Preferences dialog twice throws an exception

Bug #252096 reported by Ákos Gyimesi
2
Affects Status Importance Assigned to Milestone
PyRoom
Fix Released
Undecided
Unassigned
0.3
Fix Released
Undecided
Unassigned

Bug Description

It happens only if the first dialog was closed with ESC or delete_event (not by pressing OK/cancel).

Traceback (most recent call last):

  File "/crypt/home/akos/src/pyroom/basic_edit.py", line 167, in key_press_event
    self.keybindings[event.hardware_keycode]()

  File "/crypt/home/akos/src/pyroom/preferences.py", line 316, in show
    self.dlg.show()

AttributeError: 'NoneType' object has no attribute 'show'

Related branches

Revision history for this message
Adam Rooke (abelianr) wrote : Re: [Bug 252096] [NEW] opening Preferences dialog twice throws an exception

I think the error here is that we initialise the preferences dialog outside
the function that calls the preferences dialog. This means that once you
have killed it the object doesn't exist anymore - so object.show makes no
sense.

I will take a look at it later and see if there is something that can be
done.

2008/7/26 Ákos Gyimesi <email address hidden>

> Public bug reported:
>
> It happens only if the first dialog was closed with ESC or delete_event
> (not by pressing OK/cancel).
>
> Traceback (most recent call last):
>
> File "/crypt/home/akos/src/pyroom/basic_edit.py", line 167, in
> key_press_event
> self.keybindings[event.hardware_keycode]()
>
> File "/crypt/home/akos/src/pyroom/preferences.py", line 316, in show
> self.dlg.show()
>
> AttributeError: 'NoneType' object has no attribute 'show'
>
> ** Affects: pyroom
> Importance: Undecided
> Status: New
>
> --
> opening Preferences dialog twice throws an exception
> https://bugs.launchpad.net/bugs/252096
> You received this bug notification because you are a member of PyRoom
> Bug Squad, which is subscribed to PyRoom.
>
> Status in PyRoom: distraction-free writing: New
>
> Bug description:
> It happens only if the first dialog was closed with ESC or delete_event
> (not by pressing OK/cancel).
>
> Traceback (most recent call last):
>
> File "/crypt/home/akos/src/pyroom/basic_edit.py", line 167, in
> key_press_event
> self.keybindings[event.hardware_keycode]()
>
> File "/crypt/home/akos/src/pyroom/preferences.py", line 316, in show
> self.dlg.show()
>
> AttributeError: 'NoneType' object has no attribute 'show'
>

Revision history for this message
Ákos Gyimesi (gyim) wrote :

I fixed the bug, but for some reason my "bzr push" request got stuck :( I attach the output of "bzr diff" (until I get more experience with bazaar)

In interface.glade the only modification I made was to add a new signal handler (on_close) on dialog-preferences/delete_event.

Adam Rooke (abelianr)
Changed in pyroom:
status: New → Fix Committed
Ákos Gyimesi (gyim)
Changed in pyroom:
status: Fix Committed → Fix Released
Florian Heinle (tiax)
Changed in pyroom:
milestone: none → 0.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.