Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Context not available. | |||||
| */ | */ | ||||
| static void wm_confirm_quit(bContext *C) | static void wm_confirm_quit(bContext *C) | ||||
| { | { | ||||
| int result; | |||||
| wmWindow *win = CTX_wm_window(C); | wmWindow *win = CTX_wm_window(C); | ||||
| if (GHOST_SupportsNativeDialogs() == 0) { | if (GHOST_SupportsNativeDialogs() == 0) { | ||||
| UI_popup_block_invoke(C, block_create_confirm_quit, NULL); | UI_popup_block_invoke(C, block_create_confirm_quit, NULL); | ||||
| } | } | ||||
| else if (GHOST_confirmQuit(win->ghostwin)) { | else { | ||||
| wm_exit_schedule_delayed(C); | result = GHOST_confirmQuit(win->ghostwin); | ||||
| switch (result) | |||||
| { | |||||
| case GHOST_kYesSaveChanges: /* 6 equates to IDYES, so save changes */ | |||||
brecht: Remove outdated comments here. | |||||
| WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, NULL); | |||||
| wm_exit_schedule_delayed(C); | |||||
| break; | |||||
| case GHOST_kNoDiscardChanges: /* 7 equates to IDNO, so discard changes */ | |||||
| wm_exit_schedule_delayed(C); | |||||
| break; | |||||
| case GHOST_kCancel: /* equates to IDCANCEL, so go back to Blender to continue working */ | |||||
| default: | |||||
Not Done Inline ActionsThese 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. brecht: These values are Windows specific, but this code is the same for all platforms.
I suggest to… | |||||
| break; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
Remove outdated comments here.