Standard "Save before close" dialog?

Hi, folks! Say, is there a “standard” or OTS “Save before close?” dialog (i.e., one that, if you click “yes,” will automatically look for changes, provide a save file dialog, etc.)? Same Q for a “Confirm close” dialog. Thanks!

Hi David,

Hi, folks! Say, is there a "standard" or OTS "Save before close?" dialog (i.e., one that, if you click "yes," will automatically look for changes, provide a save file dialog, etc.)? Same Q for a "Confirm close" dialog. Thanks!

Not that I am aware of.

I use pubsub message to set a status flag, e.g. in an EVT_TEXT handler for text controls (not perfect as if the user changes something and then changes back to the original entry this still considers it a change).

Then the onClose handler calls a method which checks that status flag, if it is not set then I let the close proceed if not I put a genericmessage dialog up where the user can select "save", which causes the save to be done and if it succeeds the dialog/app closes, if they select "don't save" then changes are rolled back and dialog/app closes and if they select "cancel" then I veto the event.

Werner

···

On 16/03/2012 02:14, David Goldsmith wrote:

Thanks, Werner; pubsub=?

···

On 3/16/12, werner <wbruhin@free.fr> wrote:

Hi David,

On 16/03/2012 02:14, David Goldsmith wrote:

Hi, folks! Say, is there a "standard" or OTS "Save before close?"
dialog (i.e., one that, if you click "yes," will automatically look
for changes, provide a save file dialog, etc.)? Same Q for a "Confirm
close" dialog. Thanks!

Not that I am aware of.

I use pubsub message to set a status flag, e.g. in an EVT_TEXT handler
for text controls (not perfect as if the user changes something and then
changes back to the original entry this still considers it a change).

Then the onClose handler calls a method which checks that status flag,
if it is not set then I let the close proceed if not I put a
genericmessage dialog up where the user can select "save", which causes
the save to be done and if it succeeds the dialog/app closes, if they
select "don't save" then changes are rolled back and dialog/app closes
and if they select "cancel" then I veto the event.

Werner

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
Note my address change and please update your address books. Thanks!

Thanks, Werner; pubsub=?

wx.lib.pubsub (also: http://pubsub.sourceforge.net )

an implementation of the "publish-subscribe" pattern -- a nice way to
set up communication between parts of your code that allows
de-coupling.

I don't know that I'd use it just for this, but if your using it in
the rest of your app it does make this sort of thing easy.

search the wiki for pubsub, and also look at some of the MVC/MVP docs
for discussion.

-Chris

···

On Fri, Mar 16, 2012 at 8:16 AM, David Goldsmith <eulergaussriemann@gmail.com> wrote:

On 3/16/12, werner <wbruhin@free.fr> wrote:

Hi David,

On 16/03/2012 02:14, David Goldsmith wrote:

Hi, folks! Say, is there a "standard" or OTS "Save before close?"
dialog (i.e., one that, if you click "yes," will automatically look
for changes, provide a save file dialog, etc.)? Same Q for a "Confirm
close" dialog. Thanks!

Not that I am aware of.

I use pubsub message to set a status flag, e.g. in an EVT_TEXT handler
for text controls (not perfect as if the user changes something and then
changes back to the original entry this still considers it a change).

Then the onClose handler calls a method which checks that status flag,
if it is not set then I let the close proceed if not I put a
genericmessage dialog up where the user can select "save", which causes
the save to be done and if it succeeds the dialog/app closes, if they
select "don't save" then changes are rolled back and dialog/app closes
and if they select "cancel" then I veto the event.

Werner

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
Note my address change and please update your address books. Thanks!

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Thanks, Chris! Hope you’re well, BTW; what’re you up to these days (shoot me an update off list…)

DG

···

On Fri, Mar 16, 2012 at 8:44 AM, Chris Barker chris.barker@noaa.gov wrote:

On Fri, Mar 16, 2012 at 8:16 AM, David Goldsmith > > eulergaussriemann@gmail.com wrote:

Thanks, Werner; pubsub=?

wx.lib.pubsub (also: http://pubsub.sourceforge.net )

an implementation of the “publish-subscribe” pattern – a nice way to

set up communication between parts of your code that allows

de-coupling.

I don’t know that I’d use it just for this, but if your using it in

the rest of your app it does make this sort of thing easy.

search the wiki for pubsub, and also look at some of the MVC/MVP docs

for discussion.

-Chris

On 3/16/12, werner wbruhin@free.fr wrote:

Hi David,

On 16/03/2012 02:14, David Goldsmith wrote:

Hi, folks! Say, is there a “standard” or OTS “Save before close?”

dialog (i.e., one that, if you click “yes,” will automatically look

for changes, provide a save file dialog, etc.)? Same Q for a "Confirm

close" dialog. Thanks!

Not that I am aware of.

I use pubsub message to set a status flag, e.g. in an EVT_TEXT handler

for text controls (not perfect as if the user changes something and then

changes back to the original entry this still considers it a change).

Then the onClose handler calls a method which checks that status flag,

if it is not set then I let the close proceed if not I put a

genericmessage dialog up where the user can select “save”, which causes

the save to be done and if it succeeds the dialog/app closes, if they

select “don’t save” then changes are rolled back and dialog/app closes

and if they select “cancel” then I veto the event.

Werner

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Note my address change and please update your address books. Thanks!

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Christopher Barker, Ph.D.

Oceanographer

Emergency Response Division

NOAA/NOS/OR&R (206) 526-6959 voice

7600 Sand Point Way NE (206) 526-6329 fax

Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Note my address change and please update your address books. Thanks!

David Goldsmith wrote:

Hi, folks! Say, is there a "standard" or OTS "Save before close?"
dialog (i.e., one that, if you click "yes," will automatically look
for changes, provide a save file dialog, etc.)? Same Q for a "Confirm
close" dialog. Thanks!

Actually, best practices today are not to have pointless dialogs like
that. 99% of the time, when I close, I want the app to close. It is a
complete waste of productivity to force me to address yet another dialog
in the vast majority of the cases. For the 1% of the time when the
close was accidental, the only cost is waiting for application to restart.

In my view, the same applies to "save before close". Microsoft OneNote
saves all changes immediately (or effectively so). As long as you have
"undo", that's a much better solution, because it speeds up the steady
state case.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Thanks for the input!

···

On Fri, Mar 16, 2012 at 9:59 AM, Tim Roberts timr@probo.com wrote:

David Goldsmith wrote:

Hi, folks! Say, is there a “standard” or OTS “Save before close?”

dialog (i.e., one that, if you click “yes,” will automatically look

for changes, provide a save file dialog, etc.)? Same Q for a "Confirm

close" dialog. Thanks!

Actually, best practices today are not to have pointless dialogs like

that. 99% of the time, when I close, I want the app to close. It is a

complete waste of productivity to force me to address yet another dialog

in the vast majority of the cases. For the 1% of the time when the

close was accidental, the only cost is waiting for application to restart.

In my view, the same applies to “save before close”. Microsoft OneNote

saves all changes immediately (or effectively so). As long as you have

“undo”, that’s a much better solution, because it speeds up the steady

state case.

Tim Roberts, timr@probo.com

Providenza & Boekelheide, Inc.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Note my address change and please update your address books. Thanks!