From 66698e9d71c3ff900ff45a01051899f22399950f Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 18 Feb 2009 18:08:33 +0000 Subject: 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. --- source/blender/windowmanager/intern/wm_operators.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/windowmanager') 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; -- cgit v1.2.3