[Gui] UserEditMode : take into account in edit command

+ Mark strings for translation
This commit is contained in:
0penBrain
2021-05-13 08:36:37 +02:00
parent ef22c6ba1e
commit c6777b33e2
2 changed files with 7 additions and 6 deletions

View File

@@ -235,10 +235,10 @@ public:
//@{
protected:
const std::map <int, std::string> 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;

View File

@@ -31,6 +31,7 @@
#include <vector>
#include <Base/Type.h>
#include <Gui/Application.h>
/** @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)