Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kuznetsov <kuzsasha@gmail.com>2012-03-16 21:37:45 +0400
committerAlexander Kuznetsov <kuzsasha@gmail.com>2012-03-16 21:37:45 +0400
commited44ddd816d3bcd9be2e2097e1087dcdbf9b91e1 (patch)
tree357e958f56adb04aa07e20af827c8d0b6ba5532f /source/blender
parent2caa507b7eaa7d55a0be7bda513f08ecfe4791f1 (diff)
Patch by Psy-Fi + my minor changes
Adds conformation on exit for windows. Needs to be enabled in user perf. Tried to edit blender.exe.manifest for more modern dialog look, but didn't work out.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c5
-rw-r--r--source/blender/windowmanager/intern/wm_window.c17
3 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 2243eb357fc..e014e18d07b 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -510,6 +510,7 @@ extern UserDef U; /* from blenkernel blender.c */
#define USER_SPLASH_DISABLE (1 << 27)
#define USER_HIDE_RECENT (1 << 28)
#define USER_SHOW_THUMBNAILS (1 << 29)
+#define USER_QUIT_PROMPT (1 << 30)
/* Auto-Keying mode */
/* AUTOKEY_ON is a bitflag */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 3673d21a9e6..7af1dfa9da9 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2369,6 +2369,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay",
"Time delay in 1/10 seconds before automatically opening sub level menus");
+ prop = RNA_def_property(srna, "quit_dialog", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_QUIT_PROMPT);
+ RNA_def_property_ui_text(prop, "Prompt Quit",
+ "Asks for confirmation when quitting through the window close button");
+
/* Toolbox click-hold delay */
prop = RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 7893ac2f639..4ccebf7a4ff 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -250,8 +250,25 @@ wmWindow *wm_window_copy(bContext *C, wmWindow *winorig)
/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
+ wmWindow *tmpwin;
bScreen *screen= win->screen;
+ /* first check if we have any non-temp remaining windows */
+ if((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved){
+ if(wm->windows.first) {
+ for(tmpwin = wm->windows.first; tmpwin; tmpwin = tmpwin->next){
+ if(tmpwin == win)
+ continue;
+ if(tmpwin->screen->temp == 0)
+ break;
+ }
+ if(tmpwin == NULL){
+ if(!GHOST_confirmQuit(win->ghostwin))
+ return;
+ }
+ }
+ }
+
BLI_remlink(&wm->windows, win);
wm_draw_window_clear(win);