From 0ee1cdab7e5896d56c7c6d9681a427e386fa2ae9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Mar 2017 21:05:00 +1100 Subject: WM: Option to load startup w/o closing the splash Not user visible, needed for switching templates. --- source/blender/windowmanager/intern/wm_files.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 05d63869074..9e1a4e2e73f 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -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 */ } -- cgit v1.2.3