Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 1,840 Lines • ▼ Show 20 Lines | wm_homefile_read(C, | ||||
| app_template, | app_template, | ||||
| NULL); | NULL); | ||||
| if (use_splash) { | if (use_splash) { | ||||
| WM_init_splash(C); | WM_init_splash(C); | ||||
| } | } | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static int wm_homefile_read_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | |||||
| { | |||||
| wmWindowManager *wm = CTX_wm_manager(C); | |||||
| if (U.uiflag & USER_SAVE_PROMPT && !wm->file_saved) { | |||||
| return WM_operator_confirm_message(C, op, "Changes in current file will be lost. Continue?"); | |||||
| } | |||||
| else { | |||||
| return wm_homefile_read_exec(C, op); | |||||
| } | |||||
| } | |||||
| void WM_OT_read_homefile(wmOperatorType *ot) | void WM_OT_read_homefile(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ot->name = "Reload Start-Up File"; | ot->name = "Reload Start-Up File"; | ||||
| ot->idname = "WM_OT_read_homefile"; | ot->idname = "WM_OT_read_homefile"; | ||||
| ot->description = "Open the default file (doesn't save the current file)"; | ot->description = "Open the default file (doesn't save the current file)"; | ||||
| ot->invoke = wm_homefile_read_invoke; | |||||
| ot->exec = wm_homefile_read_exec; | ot->exec = wm_homefile_read_exec; | ||||
| prop = RNA_def_string_file_path( | prop = RNA_def_string_file_path( | ||||
| ot->srna, "filepath", NULL, FILE_MAX, "File Path", "Path to an alternative start-up file"); | ot->srna, "filepath", NULL, FILE_MAX, "File Path", "Path to an alternative start-up file"); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN); | RNA_def_property_flag(prop, PROP_HIDDEN); | ||||
| /* So scripts can use an alternative start-up file without the UI */ | /* So scripts can use an alternative start-up file without the UI */ | ||||
| prop = RNA_def_boolean( | prop = RNA_def_boolean( | ||||
| ▲ Show 20 Lines • Show All 761 Lines • Show Last 20 Lines | |||||