Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| printf("ok\n"); | printf("ok\n"); | ||||
| BKE_report(op->reports, RPT_INFO, "Startup file saved"); | BKE_report(op->reports, RPT_INFO, "Startup file saved"); | ||||
| BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_POST); | BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_POST); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void save_homefile_warning(bContext *C, wmOperator *op, wmWarningDetails *warning) | |||||
| { | |||||
| STRNCPY(warning->confirm_button, TIP_("Save")); | |||||
| warning->size = WM_WARNING_SIZE_LARGE; | |||||
| warning->position = WM_WARNING_POSITON_CENTER; | |||||
| warning->mouse_move_quit = false; | |||||
| } | |||||
| void WM_OT_save_homefile(wmOperatorType *ot) | void WM_OT_save_homefile(wmOperatorType *ot) | ||||
| { | { | ||||
| ot->name = "Save Startup File"; | ot->name = "Save Startup File"; | ||||
| ot->idname = "WM_OT_save_homefile"; | ot->idname = "WM_OT_save_homefile"; | ||||
| ot->description = "Make the current file the default .blend file"; | ot->description = "Make the current file the default .blend file"; | ||||
| ot->invoke = WM_operator_confirm; | ot->invoke = WM_operator_confirm; | ||||
| ot->exec = wm_homefile_write_exec; | ot->exec = wm_homefile_write_exec; | ||||
| ot->warning = save_homefile_warning; | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Write Preferences Operator | /** \name Write Preferences Operator | ||||
| * \{ */ | * \{ */ | ||||
| ▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
| ot->name = "Load Preferences"; | ot->name = "Load Preferences"; | ||||
| ot->idname = "WM_OT_read_userpref"; | ot->idname = "WM_OT_read_userpref"; | ||||
| ot->description = "Load last saved preferences"; | ot->description = "Load last saved preferences"; | ||||
| ot->invoke = WM_operator_confirm; | ot->invoke = WM_operator_confirm; | ||||
| ot->exec = wm_userpref_read_exec; | ot->exec = wm_userpref_read_exec; | ||||
| } | } | ||||
| void wm_userpref_read_factory_warning(bContext *C, wmOperator *op, wmWarningDetails *warning) | |||||
| { | |||||
| STRNCPY(warning->title, IFACE_("Load factory default preferences")); | |||||
| STRNCPY(warning->message, | |||||
| IFACE_("To make changes to preferences permanent, use \"Save Preferences\"")); | |||||
| STRNCPY(warning->confirm_button, TIP_("Load")); | |||||
| warning->icon = ALERT_ICON_BLENDER; | |||||
| warning->size = WM_WARNING_SIZE_LARGE; | |||||
| warning->position = WM_WARNING_POSITON_CENTER; | |||||
| warning->mouse_move_quit = false; | |||||
| } | |||||
| void WM_OT_read_factory_userpref(wmOperatorType *ot) | void WM_OT_read_factory_userpref(wmOperatorType *ot) | ||||
| { | { | ||||
| ot->name = "Load Factory Preferences"; | ot->name = "Load Factory Preferences"; | ||||
| ot->idname = "WM_OT_read_factory_userpref"; | ot->idname = "WM_OT_read_factory_userpref"; | ||||
| ot->description = | ot->description = | ||||
| "Load factory default preferences. " | "Load factory default preferences. " | ||||
| "To make changes to preferences permanent, use \"Save Preferences\""; | "To make changes to preferences permanent, use \"Save Preferences\""; | ||||
| ot->invoke = WM_operator_confirm; | ot->invoke = WM_operator_confirm; | ||||
| ot->exec = wm_userpref_read_exec; | ot->exec = wm_userpref_read_exec; | ||||
| ot->warning = wm_userpref_read_factory_warning; | |||||
| read_factory_reset_props(ot); | read_factory_reset_props(ot); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Read File History Operator | /** \name Read File History Operator | ||||
| ▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | |||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| read_factory_reset_props(ot); | read_factory_reset_props(ot); | ||||
| read_homefile_props(ot); | read_homefile_props(ot); | ||||
| /* omit poll to run in background mode */ | /* omit poll to run in background mode */ | ||||
| } | } | ||||
| void read_factory_warning(bContext *C, wmOperator *op, wmWarningDetails *warning) | |||||
| { | |||||
| STRNCPY(warning->title, "Load factory default startup file and preferences."); | |||||
| STRNCPY(warning->message, | |||||
| "To make changes permanent, use \"Save Startup File\" and \"Save Preferences\""); | |||||
| STRNCPY(warning->confirm_button, "Load"); | |||||
| warning->icon = ALERT_ICON_BLENDER; | |||||
| warning->size = WM_WARNING_SIZE_LARGE; | |||||
| warning->position = WM_WARNING_POSITON_CENTER; | |||||
| warning->mouse_move_quit = false; | |||||
| } | |||||
| void WM_OT_read_factory_settings(wmOperatorType *ot) | void WM_OT_read_factory_settings(wmOperatorType *ot) | ||||
| { | { | ||||
| ot->name = "Load Factory Settings"; | ot->name = "Load Factory Settings"; | ||||
| ot->idname = "WM_OT_read_factory_settings"; | ot->idname = "WM_OT_read_factory_settings"; | ||||
| ot->description = | ot->description = | ||||
| "Load factory default startup file and preferences. " | "Load factory default startup file and preferences. " | ||||
| "To make changes permanent, use \"Save Startup File\" and \"Save Preferences\""; | "To make changes permanent, use \"Save Startup File\" and \"Save Preferences\""; | ||||
| ot->invoke = WM_operator_confirm; | ot->invoke = WM_operator_confirm; | ||||
| ot->exec = wm_homefile_read_exec; | ot->exec = wm_homefile_read_exec; | ||||
| ot->warning = read_factory_warning; | |||||
| /* Omit poll to run in background mode. */ | /* Omit poll to run in background mode. */ | ||||
| read_factory_reset_props(ot); | read_factory_reset_props(ot); | ||||
| read_homefile_props(ot); | read_homefile_props(ot); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||