diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 14 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_files.h | 1 |
3 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 7152adb4a11..9cb46632198 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -602,6 +602,13 @@ int wm_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory return TRUE; } +int wm_history_read_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) +{ + /* TODO, read bookmarks */ + wm_read_history(); + return OPERATOR_FINISHED; +} + int wm_homefile_read_exec(bContext *C, wmOperator *op) { int from_memory = strcmp(op->type->idname, "WM_OT_read_factory_settings") == 0; @@ -637,7 +644,6 @@ void wm_read_history(void) } BLI_file_free_lines(lines); - } static void write_history(void) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index b27f014ccb3..b4a4e4612e3 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1906,6 +1906,19 @@ static void WM_OT_save_userpref(wmOperatorType *ot) ot->poll = WM_operator_winactive; } +static void WM_OT_read_history(wmOperatorType *ot) +{ + ot->name = "Reload History File"; + ot->idname = "WM_OT_read_history"; + ot->description = "Reloads history and bookmarks"; + + ot->invoke = WM_operator_confirm; + ot->exec = wm_history_read_exec; + + /* this operator is only used for loading settings from a previous blender install */ + ot->flag = OPTYPE_INTERNAL; +} + static void WM_OT_read_homefile(wmOperatorType *ot) { ot->name = "Reload Start-Up File"; @@ -4043,6 +4056,7 @@ void wm_operatortype_init(void) global_ops_hash = BLI_ghash_str_new("wm_operatortype_init gh"); WM_operatortype_append(WM_OT_window_duplicate); + WM_operatortype_append(WM_OT_read_history); WM_operatortype_append(WM_OT_read_homefile); WM_operatortype_append(WM_OT_read_factory_settings); WM_operatortype_append(WM_OT_save_homefile); diff --git a/source/blender/windowmanager/wm_files.h b/source/blender/windowmanager/wm_files.h index fe007e7f52f..9fda6801925 100644 --- a/source/blender/windowmanager/wm_files.h +++ b/source/blender/windowmanager/wm_files.h @@ -33,6 +33,7 @@ void wm_read_history(void); int wm_file_write(struct bContext *C, const char *target, int fileflags, struct ReportList *reports); +int wm_history_read_exec(bContext *C, wmOperator *op); int wm_homefile_read_exec(struct bContext *C, struct wmOperator *op); int wm_homefile_read(struct bContext *C, struct ReportList *reports, short from_memory); int wm_homefile_write_exec(struct bContext *C, struct wmOperator *op); |