Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2009-12-04 22:07:25 +0300
committerMartin Poirier <theeth@yahoo.com>2009-12-04 22:07:25 +0300
commite9b7482b6a0b340a7045e55809cfe88500c04d1b (patch)
tree4abdab8a41474ac2ef084938c9d56b777059b7f6 /source
parentf21ec890815fb1527b433e6e11e9cba5bf962f17 (diff)
Save_Mainfile operator only needs window for invoke. Removed poll function and replace by a check in invoke that cancels if no window is present.
Makes it possible to be called in background mode.
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 793250f390e..9cee2140fc7 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1555,6 +1555,10 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
char name[FILE_MAX];
+ /* cancel if no active window */
+ if (CTX_wm_window(C) == NULL)
+ return OPERATOR_CANCELLED;
+
save_set_compress(op);
BLI_strncpy(name, G.sce, FILE_MAX);
@@ -1577,7 +1581,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
ot->invoke= wm_save_mainfile_invoke;
ot->exec= wm_save_as_mainfile_exec;
- ot->poll= WM_operator_winactive;
+ ot->poll= NULL;
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file.");