TD: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the TechDraw Wb. Ticket: https://tracker.freecadweb.org/view.php?id=4473
This commit is contained in:
@@ -129,7 +129,7 @@ void CmdTechDrawPageDefault::activated(int iMsg)
|
||||
QFileInfo tfi(templateFileName);
|
||||
if (tfi.isReadable()) {
|
||||
Gui::WaitCursor wc;
|
||||
openCommand("Drawing create page");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Drawing create page"));
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawPage','%s')",PageName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawSVGTemplate','%s')",TemplateName.c_str());
|
||||
|
||||
@@ -199,7 +199,7 @@ void CmdTechDrawPageTemplate::activated(int iMsg)
|
||||
QFileInfo tfi(templateFileName);
|
||||
if (tfi.isReadable()) {
|
||||
Gui::WaitCursor wc;
|
||||
openCommand("Drawing create page");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Drawing create page"));
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawPage','%s')",PageName.c_str());
|
||||
|
||||
// Create the Template Object to attach to the page
|
||||
@@ -353,7 +353,7 @@ void CmdTechDrawView::activated(int iMsg)
|
||||
Base::Vector3d projDir;
|
||||
|
||||
Gui::WaitCursor wc;
|
||||
openCommand("Create view");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create view"));
|
||||
std::string FeatName = getUniqueObjectName("View");
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewPart','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str());
|
||||
@@ -606,7 +606,7 @@ void CmdTechDrawProjectionGroup::activated(int iMsg)
|
||||
Base::Vector3d projDir;
|
||||
Gui::WaitCursor wc;
|
||||
|
||||
openCommand("Create Projection Group");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create Projection Group"));
|
||||
|
||||
std::string multiViewName = getUniqueObjectName("ProjGroup");
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawProjGroup','%s')",
|
||||
@@ -697,7 +697,7 @@ bool CmdTechDrawProjectionGroup::isActive(void)
|
||||
|
||||
// Gui::WaitCursor wc;
|
||||
|
||||
// openCommand("Create view");
|
||||
// openCommand(QT_TRANSLATE_NOOP("Command", "Create view"));
|
||||
// std::string FeatName = getUniqueObjectName("MultiView");
|
||||
// doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewMulti','%s')",FeatName.c_str());
|
||||
// App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str());
|
||||
@@ -828,7 +828,7 @@ void CmdTechDrawClipGroup::activated(int iMsg)
|
||||
std::string PageName = page->getNameInDocument();
|
||||
|
||||
std::string FeatName = getUniqueObjectName("Clip");
|
||||
openCommand("Create Clip");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create Clip"));
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewClip','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str());
|
||||
updateActive();
|
||||
@@ -901,7 +901,7 @@ void CmdTechDrawClipGroupAdd::activated(int iMsg)
|
||||
std::string ClipName = clip->getNameInDocument();
|
||||
std::string ViewName = view->getNameInDocument();
|
||||
|
||||
openCommand("ClipGroupAdd");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "ClipGroupAdd"));
|
||||
doCommand(Doc,"App.activeDocument().%s.ViewObject.Visibility = False",ViewName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",ClipName.c_str(),ViewName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.ViewObject.Visibility = True",ViewName.c_str());
|
||||
@@ -974,7 +974,7 @@ void CmdTechDrawClipGroupRemove::activated(int iMsg)
|
||||
std::string ClipName = clip->getNameInDocument();
|
||||
std::string ViewName = view->getNameInDocument();
|
||||
|
||||
openCommand("ClipGroupRemove");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "ClipGroupRemove"));
|
||||
doCommand(Doc,"App.activeDocument().%s.ViewObject.Visibility = False",ViewName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.removeView(App.activeDocument().%s)",ClipName.c_str(),ViewName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.ViewObject.Visibility = True",ViewName.c_str());
|
||||
@@ -1035,7 +1035,7 @@ void CmdTechDrawSymbol::activated(int iMsg)
|
||||
{
|
||||
std::string FeatName = getUniqueObjectName("Symbol");
|
||||
filename = Base::Tools::escapeEncodeFilename(filename);
|
||||
openCommand("Create Symbol");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create Symbol"));
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
doCommand(Doc,"f = open(unicode(\"%s\",'utf-8'),'r')",(const char*)filename.toUtf8());
|
||||
#else
|
||||
@@ -1099,7 +1099,7 @@ void CmdTechDrawDraftView::activated(int iMsg)
|
||||
draftItemsFound++;
|
||||
std::string FeatName = getUniqueObjectName("DraftView");
|
||||
std::string SourceName = (*it)->getNameInDocument();
|
||||
openCommand("Create DraftView");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create DraftView"));
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewDraft','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",
|
||||
FeatName.c_str(),SourceName.c_str());
|
||||
@@ -1174,7 +1174,7 @@ void CmdTechDrawArchView::activated(int iMsg)
|
||||
|
||||
std::string FeatName = getUniqueObjectName("ArchView");
|
||||
std::string SourceName = archObject->getNameInDocument();
|
||||
openCommand("Create ArchView");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create ArchView"));
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewArch','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),SourceName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str());
|
||||
@@ -1222,7 +1222,7 @@ void CmdTechDrawSpreadsheetView::activated(int iMsg)
|
||||
}
|
||||
std::string PageName = page->getNameInDocument();
|
||||
|
||||
openCommand("Create spreadsheet view");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create spreadsheet view"));
|
||||
std::string FeatName = getUniqueObjectName("Sheet");
|
||||
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewSpreadsheet','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),SpreadName.c_str());
|
||||
@@ -1343,7 +1343,7 @@ void CmdTechDrawExportPageDXF::activated(int iMsg)
|
||||
}
|
||||
|
||||
std::string PageName = page->getNameInDocument();
|
||||
openCommand("Save page to dxf");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Save page to dxf"));
|
||||
doCommand(Doc,"import TechDraw");
|
||||
fileName = Base::Tools::escapeEncodeFilename(fileName);
|
||||
doCommand(Doc,"TechDraw.writeDXFPage(App.activeDocument().%s,u\"%s\")",PageName.c_str(),(const char*)fileName.toUtf8());
|
||||
|
||||
Reference in New Issue
Block a user