On Sun, 24 Aug 2008, Frank Niessink wrote:

> 2008/8/24 Jerome Laheurte <[EMAIL PROTECTED]>:
>> On Sun, 24 Aug 2008, Jerome Laheurte wrote:
>>
>>> Actually I was so sure dialogs were already modal that I didn't check.
>>> Obviously a potential for bugs here.
>>
>> And thinking about it, all dialogs must be modal, not only those
>> created from a dialog.
>
> I guess you're saying that because you're thinking about the situation
> where a user deletes an object that is opened in a edit dialog?

I was thinking about another scenario: create a category, create a 
task, check the category in the task editor, delete the category in 
the main view, click OK. As expected,

   File 
"/home/jerome/prg/python/taskcoach-release-0.70/taskcoachlib/gui/dialog/editor.py",
 
line 411, in getCategoryWithIndex
     category = children[i]
IndexError: list index out of range

I'm sure there are plenty of such scenarios.

Actually, the reason I think all dialogs should be modal is that since 
the new, empty CommandHistoryLayer is pushed on the stack when the 
dialog is created, if two top-levels dialogs are created, the commands 
will be all messed up, and if you click OK in one of them and Cancel 
in the other, strange things will happen. Maybe it's possible to do 
the push elsewhere, I'll see about that.

Cheers,
Jérôme

Reply via email to