WM: Option to load startup w/o closing the splash

Not user visible, needed for switching templates.
This commit is contained in:
Campbell Barton
2017-03-14 21:05:00 +11:00
parent 4c5374d46a
commit 0ee1cdab7e

View File

@@ -1426,7 +1426,16 @@ static int wm_homefile_read_exec(bContext *C, wmOperator *op)
G.fileflags &= ~G_FILE_NO_UI;
}
return wm_homefile_read(C, op->reports, from_memory, filepath) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
if (wm_homefile_read(C, op->reports, from_memory, filepath)) {
/* Load a file but keep the splash open */
if (RNA_boolean_get(op->ptr, "use_splash")) {
WM_init_splash(C);
}
return OPERATOR_FINISHED;
}
else {
return OPERATOR_CANCELLED;
}
}
void WM_OT_read_homefile(wmOperatorType *ot)
@@ -1449,6 +1458,10 @@ void WM_OT_read_homefile(wmOperatorType *ot)
"Load user interface setup from the .blend file");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
/* So the splash can be kept open after loading a file (for templates). */
prop = RNA_def_boolean(ot->srna, "use_splash", true, "Splash", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
/* omit poll to run in background mode */
}