Page MenuHome

Updated confirmQuit Dialog and Action
AbandonedPublic

Authored by Ron Tarrant (rivit) on Oct 23 2018, 6:52 PM.

Details

Summary

When Blender's Close button is clicked, the resulting dialog offers the user two options, Yes (quit without saving) or Cancel (go back to Blender).

This patch updates the dialog to ask if the user would like to save before quitting and offers three options: Yes (save, then quit), No (abandon changes and quit) or Cancel (go back to Blender).

Diff Detail

Event Timeline

Ron Tarrant (rivit) created this object with edit policy "Administrators".

I'm unfamiliar with this submission process, so I don't know who to fill in as reviewer(s).

Brecht Van Lommel (brecht) requested changes to this revision.Oct 23 2018, 7:01 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/windowmanager/intern/wm_window.c
425–433

These values are Windows specific, but this code is the same for all platforms.

I suggest to add a GHOST_TQuitEvent enum in GHOST_Types.h and then convert to the appropriate value in GHOST_SystemWin32::confirmQuit, to make it platform independent.

This revision now requires changes to proceed.Oct 23 2018, 7:01 PM

Thanks for the feedback, Brecht.
I've made the changes you suggested. Please get back to me if any other changes are necessary.
I'm assuming the Linux and Mac code won't be available to me on a Windows machine. Or is it? I looked, but didn't see it.

I'm not seeing the changes? You can use "Update Diff" on this page to upload the new diff.

The code for other platforms is also available in intern/ghost, but confirmQuit is only implemented for Windows currently so there is nothing to update.

    • added GHOST_TQuitEvent enum to GHOST_Types.h (to facilitate translating Windows dialog return values for use with multi-platform code)
  • rewrote the GHOST_SystemWin32::confirmQuit() in GHOST_SystemWin32.cpp (added dialog return value translation code)
  • rewrote wm_confirm_quit() function in wm_window.c (now uses GHOST_TQuitEvent enum values)

Sorry for the confusion. I posted the message before I uploaded the updated diff. It's there now.

Thanks for the update, it's close now.

intern/ghost/intern/GHOST_SystemWin32.cpp
1653

This should use GHOST_kYesSaveChanges instead of 0, and similar for the other cases.

source/blender/windowmanager/intern/wm_window.c
425

Remove outdated comments here.

Brecht Van Lommel (brecht) requested changes to this revision.Oct 24 2018, 12:17 PM
This revision now requires changes to proceed.Oct 24 2018, 12:17 PM
  • switch/case statement in GHOST_SystemWin32.cpp now uses GHOST_TQuitEvent (see GHOST_Types.h)

Hi!

Could you share a screenshot of how it would look? Just checking, since we already agreed on naming and position of the buttons for the Quit dialog in D3118.


I didn't realize this had been discussed (I'm new around here).

If you'd like me to conform to what's been decided, please let me know. Going by the mock-ups in the reference thread you cited, it's pretty close.

We went with a different design now, using a Blender quit dialog on all platforms so we can include image saving functionality.

We went with a different design now, using a Blender quit dialog on all platforms so we can include image saving functionality.

My sole concern was that the dialog give the additional option to save-n-quit. As long as that's there, abandoning this revision is absolutely fine. Thanks for letting me know.