make screenshot poll for background mode.

This commit is contained in:
Campbell Barton 2013-06-27 06:21:10 +00:00
parent 929bba2bac
commit 35e92f54a1

@ -254,6 +254,13 @@ static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, '\0'); uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, '\0');
} }
static int screenshot_poll(bContext *C)
{
if (G.background)
return false;
return WM_operator_winactive(C);
}
void SCREEN_OT_screenshot(wmOperatorType *ot) void SCREEN_OT_screenshot(wmOperatorType *ot)
{ {
@ -266,7 +273,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
ot->exec = screenshot_exec; ot->exec = screenshot_exec;
ot->cancel = screenshot_cancel; ot->cancel = screenshot_cancel;
ot->ui = screenshot_draw; ot->ui = screenshot_draw;
ot->poll = WM_operator_winactive; ot->poll = screenshot_poll;
ot->flag = 0; ot->flag = 0;