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:
authorJulian Eisel <julian@blender.org>2020-11-22 21:21:30 +0300
committerJulian Eisel <julian@blender.org>2020-11-22 21:21:30 +0300
commit7bab87c119f4bef0c52cdadeb84a86336193296c (patch)
treebbc0d3a5fa37d18219ae921909933bd1e6920d4d /source/blender/windowmanager/intern/wm_files.c
parent4c01fbb564f5ada3f666af5ac36ca981667b3414 (diff)
Fix T82918: File menu "Save Copy" shows "Save As" in File Browser
Use a dynamic name/description based on the set properties. This makes it more clear what's going on and avoids confusion, as explained in the report.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 4706287a3a9..3ddac8babd4 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -2785,6 +2785,25 @@ static bool blend_save_check(bContext *UNUSED(C), wmOperator *op)
return false;
}
+static const char *wm_save_as_mainfile_get_name(wmOperatorType *ot, PointerRNA *ptr)
+{
+ if (RNA_boolean_get(ptr, "copy")) {
+ return CTX_IFACE_(ot->translation_context, "Save Copy");
+ }
+ return NULL;
+}
+
+static char *wm_save_as_mainfile_get_description(bContext *UNUSED(C),
+ wmOperatorType *UNUSED(ot),
+ PointerRNA *ptr)
+{
+ if (RNA_boolean_get(ptr, "copy")) {
+ return BLI_strdup(
+ "Save the current file in the desired location but do not make the saved file active");
+ }
+ return NULL;
+}
+
void WM_OT_save_as_mainfile(wmOperatorType *ot)
{
PropertyRNA *prop;
@@ -2795,6 +2814,8 @@ void WM_OT_save_as_mainfile(wmOperatorType *ot)
ot->invoke = wm_save_as_mainfile_invoke;
ot->exec = wm_save_as_mainfile_exec;
+ ot->get_name = wm_save_as_mainfile_get_name;
+ ot->get_description = wm_save_as_mainfile_get_description;
ot->check = blend_save_check;
/* omit window poll so this can work in background mode */