diff options
author | Ton Roosendaal <ton@blender.org> | 2009-02-18 21:08:33 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-02-18 21:08:33 +0300 |
commit | 66698e9d71c3ff900ff45a01051899f22399950f (patch) | |
tree | a01c5c21831e41742243ad2395c038e0a7d3c89b /source/blender/windowmanager | |
parent | 1a9e68bde5cfffda011297465474f5596d5bce84 (diff) |
2.5
Cleanup of saving code for Image window.
Little extra: added poll() check for buttons, greying out inactive
menu items or buttons. You can see it work in Image menu.
(Item 'save image' is grey when it wasn't saved, then you have to
use the 'save as' item).
Carefully designing poll checks is worth a trial once. :)
Do note that cpu time for polls should be totally minimal.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3729365694f..b310fb81216 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -357,7 +357,7 @@ static void untitled(char *name) } -static int wm_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) { RNA_string_set(op->ptr, "filename", G.sce); @@ -366,7 +366,7 @@ static int wm_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int wm_mainfile_exec(bContext *C, wmOperator *op) +static int wm_open_mainfile_exec(bContext *C, wmOperator *op) { char filename[FILE_MAX]; RNA_string_get(op->ptr, "filename", filename); @@ -385,8 +385,8 @@ static void WM_OT_open_mainfile(wmOperatorType *ot) ot->name= "Open Blender File"; ot->idname= "WM_OT_open_mainfile"; - ot->invoke= wm_mainfile_invoke; - ot->exec= wm_mainfile_exec; + ot->invoke= wm_open_mainfile_invoke; + ot->exec= wm_open_mainfile_exec; ot->poll= WM_operator_winactive; ot->flag= 0; |