lmi
[Top][All Lists]
Advanced

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

Re: [lmi] wx-2.9.2: undesired change in behavior of MRU list


From: Vadim Zeitlin
Subject: Re: [lmi] wx-2.9.2: undesired change in behavior of MRU list
Date: Tue, 19 Jul 2011 14:37:49 +0200

On Tue, 19 Jul 2011 10:17:43 +0000 Greg Chicares <address@hidden> wrote:

GC> In 'illustration_view.cpp', IllustrationView::OnCreate() can return false in
GC> a situation that isn't actually an error--namely, when the user begins to 
open
GC> a file, and then cancels. With wx-2.9.2, this produces an unwanted effect 
that
GC> was not observed with earlier versions.

 There was indeed a well-meaning but not quite correct change that results
in the behaviour you observe. I feel pretty stupid to have committed this
change myself without realizing that it could affect LMI, even if it's
quite obvious retrospectively.

GC> The first time I saw that messagebox, I thought "Oh no--it erased my file".
GC> Of course, it didn't, but I had quite a strong emotional reaction, and I'd
GC> like to spare our users that distress. What's the best way to accomplish 
that?

 Without changes to wx the only possibility I see is to intercept all menu
events corresponding to the MRU menu items and handle them in LMI itself,
i.e. copy wxDocManager::DoOpenMRUFile() logic without the removing-file-
from-MRU-if-it-failed-to-open part. I can make a patch doing this can be
useful.

 OTOH it seems clear that we need to do something at wx level to fix this
anyhow. One obvious change could be to only remove the file from MRU if it
couldn't be found and not just failed to be opened. This could still be
unwanted though, e.g. if you try to open a file on an external storage
device (some USB flash disk for example) when the device is not connected.
So even in this case it would be better to allow overriding the default
behaviour, whatever it is. And I don't think that asking the user is a good
idea neither because it can be annoying.

 So finally I think that we should modify wx to:

1(a) Not remove the file from MRU if it just failed to open.
 (b) Call a virtual function if a MRU file doesn't exist any longer. This
     function would remove the file from MRU by default but could be
     overridden to never do it or ask the user if he wans to do it.

Alternatively we could do

2. Just always call some virtual function when the file from MRU couldn't
   be opened, whether it was because it was not found or some other reason
   (and pass the flag indicating its existence, or not, to this function).

(1) is somewhat simpler while (2) is maximally flexible -- but maybe too
much so? What do you think?


 In any case, if you want to release a version using wx 2.9.2 none of the
above will help so a patch overriding MRU menu commands handling is needed
anyhow. Should I make it?

 Thanks,
VZ

reply via email to

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