Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_operators/wm.py4
-rw-r--r--source/blender/windowmanager/intern/wm_files.c8
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c14
-rw-r--r--source/blender/windowmanager/wm_files.h1
4 files changed, 26 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index a7085e51bd3..bb17f5979be 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1273,11 +1273,15 @@ class WM_OT_copy_prev_settings(Operator):
else:
shutil.copytree(path_src, path_dst, symlinks=True)
+ # reload recent-files.txt
+ bpy.ops.wm.read_history()
+
# don't loose users work if they open the splash later.
if bpy.data.is_saved is bpy.data.is_dirty is False:
bpy.ops.wm.read_homefile()
else:
self.report({'INFO'}, "Reload Start-Up file to restore settings")
+
return {'FINISHED'}
return {'CANCELLED'}
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);