From c6777b33e27f632af058782aee386a266e8110a6 Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Thu, 13 May 2021 08:36:37 +0200 Subject: [PATCH] [Gui] UserEditMode : take into account in edit command + Mark strings for translation --- src/Gui/Application.h | 8 ++++---- src/Gui/Command.h | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Gui/Application.h b/src/Gui/Application.h index bab862f4f0..edc46d52ed 100644 --- a/src/Gui/Application.h +++ b/src/Gui/Application.h @@ -235,10 +235,10 @@ public: //@{ protected: const std::map userEditModes { - {0, "Default"}, - {1, "Transform"}, - {2, "Cutting"}, - {3, "Color"} + {0, QT_TRANSLATE_NOOP("EditMode", "Default")}, + {1, QT_TRANSLATE_NOOP("EditMode", "Transform")}, + {2, QT_TRANSLATE_NOOP("EditMode", "Cutting")}, + {3, QT_TRANSLATE_NOOP("EditMode", "Color")} }; int userEditMode = userEditModes.begin()->first; diff --git a/src/Gui/Command.h b/src/Gui/Command.h index c3f7a2c982..1660f54079 100644 --- a/src/Gui/Command.h +++ b/src/Gui/Command.h @@ -31,6 +31,7 @@ #include #include +#include /** @defgroup CommandMacros Helper macros for running commands through Python interpreter */ //@{ @@ -179,8 +180,8 @@ auto __obj = _obj;\ if(__obj && __obj->getNameInDocument()) {\ Gui::Command::doCommand(Gui::Command::Gui,\ - "Gui.ActiveDocument.setEdit(App.getDocument('%s').getObject('%s'))",\ - __obj->getDocument()->getName(), __obj->getNameInDocument());\ + "Gui.ActiveDocument.setEdit(App.getDocument('%s').getObject('%s'), %i)",\ + __obj->getDocument()->getName(), __obj->getNameInDocument(), Gui::Application::Instance->getUserEditMode());\ }\ }while(0)