lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Untimely "save" dialog [Was: wxmsw-2.9.0 regression: crash whe


From: Greg Chicares
Subject: Re: [lmi] Untimely "save" dialog [Was: wxmsw-2.9.0 regression: crash when a messagebox should appear]
Date: Fri, 13 Mar 2009 16:54:58 +0000
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

On 2009-03-09 20:23Z, Vadim Zeitlin wrote:
>  Sorry for a longish post but there were several unrelated but not
> completely independent problems/bugs there so they can't be explained
> shortly nor can their explanation be completely separated. Nevertheless you
> can see this post as a sum of 2 almost independent parts: first one is
> about the "untimely prompt" and the second one is about the "zombie window"

Agreed. I believe that OTOH the changes can be applied incrementally,
so for the moment I'll address only the first one.

> On Mon, 09 Mar 2009 13:55:43 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> > In the "Comments" field, enter "xyz", then press OK. This
> GC> > messagebox appears:
> GC> > 
> GC> > Do you want to save changes to sample.ill?
> GC> > Yes   No   Cancel
> 
>  This problem should be fixed in normal case by the changes in
> http://trac.wxwidgets.org/changeset/59449 which basically remove the calls
> to OnSaveModified() from On{New,Open}Document() just as you suggested:
> they don't seem to make sense there as these methods are only ever called
> for the new documents which ought not to be saved in any case, even if they
> were marked as modified.
> 
>  Because of this, overriding OnNewDocument() in LMI now becomes unnecessary
> and so the following patch should be applied (with old code preserved
> inside "#if !wxCHECK_VERSION(2,9,0)" if you want it to continue to work
> with 2.8):

Applied 20090313T1621Z...with the "#if" guards you mentioned, because
we have not yet determined when the production system will be upgraded
to wx-2.9.0 . (But I'm using wx svn trunk these days, and it looks
just great, so I anticipate that we'll upgrade when wx publishes an
official release.)

BTW, for this particular class, this improvement resolves this issue:
  2000-03-30 Prompt to save changes when no changes made
            ^ [unwanted]
that was added to our offline tracker just about nine years ago.
So we're catching up.

Also BTW, a similar symptom can be observed with the corresponding
"census" class. The cause there may be different, so let's not try
to address that yet.

>  However the prompt still arises in the case when an error happens during
> the document opening. I am however not sure if this is a problem at all in
> this case: after all, the user did enter some data which you don't want to
> lose (this is the reason for calling Modify(true) in the first place) so

Agreed. The user may have spent considerable effort modifying many
input fields. To discard it all because one field is invalid would
be harsh.

> maybe he should be given the possibility to save the .ill file even if
> opening it failed? I'd like to hear your opinion about this. If you think
> this is useful we should do at least 2 things:
> 
> 1. Show the error message before the prompt for saving the file (as it's
>    very confusing otherwise)
> 2. Remove the "Cancel" button from the dialog as closing the view can't
>    be cancelled in this case
> 
> And if you don't think this is useful we need to decide whether it might
> still be useful in some other situations, in which case the dirty flag
> would need to be reset in LMI itself, or whether it can never be useful at
> all in which case it would make sense to handle this at wx level.

I'm thinking that we should redisplay the input dialog, and let the
user choose whether to cancel it or to amend the offending field.

This problem arises from a design flaw in lmi: input is validated
right after this dialog is closed (in the IllustrationView case).
If it were easy to remove that flaw, I would have done so already.
Because the problem is in code that I'm more familiar with, it's
better for me to try to fix it myself; then I'll be better able to
answer your question in the last line quoted above.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]