* add exit app with CTRLKEY+QKEY.
authorNathan Letwory <nathan@letworyinteractive.com>
Tue, 15 Jan 2008 18:54:38 +0000 (18:54 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Tue, 15 Jan 2008 18:54:38 +0000 (18:54 +0000)
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_window.h

index 423bcd51c8dde6a850c497a7bde403ed16290eca..6bd7b4920392e3d28c8d8e015ff3b9afc861ff30 100644 (file)
@@ -78,6 +78,7 @@ static void wm_window_keymap(wmWindowManager *wm)
        WM_keymap_verify_item(&wm->windowkeymap, "WM_OT_window_duplicate", AKEY, KM_PRESS, 0, 0);
        WM_keymap_verify_item(&wm->windowkeymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_verify_item(&wm->windowkeymap, "WM_OT_window_fullscreen_toggle", FKEY, KM_PRESS, 0, 0);
+       WM_keymap_verify_item(&wm->windowkeymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
 }
 
 /* ****************************************** */
index d1fce510433d6c8f5f18d44567b98ed3aae0977d..05d27c1321abe798f5a39c091544125cd38296d1 100644 (file)
@@ -116,6 +116,16 @@ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot)
     ot->poll= WM_operator_winactive;
 }
 
+static void WM_OT_exit_blender(wmOperatorType *ot)
+{
+       ot->name= "Exit Blender";
+       ot->idname= "WM_OT_exit_blender";
+
+       ot->invoke= NULL; /* do confirm stuff */
+       ot->exec= wm_exit_blender_op;
+       ot->poll= WM_operator_winactive;
+}
+
 
 #define ADD_OPTYPE(opfunc)     ot= MEM_callocN(sizeof(wmOperatorType), "operatortype"); \
                                                        opfunc(ot);  \
@@ -136,6 +146,7 @@ void wm_operatortype_init(void)
        ADD_OPTYPE(WM_OT_window_duplicate);
        ADD_OPTYPE(WM_OT_save_homefile);
     ADD_OPTYPE(WM_OT_window_fullscreen_toggle);
+       ADD_OPTYPE(WM_OT_exit_blender);
 }
 
 /* wrapped to get property from a operator. */
index 21c456fd51c8d4ee26d5b0deb296ba64b0f2640d..cde600eaeae1b9be5414affb18c8c3c68c0b3061 100644 (file)
@@ -190,6 +190,18 @@ static void wm_window_close(bContext *C, wmWindow *win)
                WM_exit(C);
 }
        
+/* exit blender */
+int wm_exit_blender_op(bContext *C, wmOperator *op)
+{
+       wmWindow *win= C->wm->windows.first;
+       while(win) {
+               wm_window_close(C, win);
+               win= win->next;
+       }
+
+       return 1;
+}
+
 static void wm_window_open(wmWindowManager *wm, char *title, wmWindow *win)
 {
        GHOST_WindowHandle ghostwin;
index 63fc0689cdefb409a35c92be2d1d4dec73ad4d8f..a9953725d8040431031cb5819d6f45dfd081486a 100644 (file)
@@ -54,6 +54,7 @@ wmWindow      *wm_window_copy                 (bContext *C, wmWindow *winorig);
 /* *************** window operators ************** */
 int                    wm_window_duplicate_op  (bContext *C, wmOperator *op);
 int                    wm_window_fullscreen_toggle_op(bContext *C, wmOperator *op);
+int                    wm_exit_blender_op(bContext *C, wmOperator *op);
 
 
 #endif /* WM_WINDOW_H */