diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2008-01-15 21:54:38 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2008-01-15 21:54:38 +0300 |
commit | 6ce20f29686d0f17c5d00cad37cae268a2f52cf6 (patch) | |
tree | b026622aeab38f3bcdaf37ad248171ad6c4d005b /source/blender/windowmanager | |
parent | 34699061254dfd268135cd4abe2ebfcddd0e04ad (diff) |
* add exit app with CTRLKEY+QKEY.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 11 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 12 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_window.h | 1 |
4 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 423bcd51c8d..6bd7b492039 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -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); } /* ****************************************** */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index d1fce510433..05d27c1321a 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -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. */ diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 21c456fd51c..cde600eaeae 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -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; diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index 63fc0689cde..a9953725d80 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -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 */ |