Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ReverseEngineering: Issue #4473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the ReverseEngineering Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
  • Loading branch information
luzpaz authored and wwmayer committed Dec 1, 2020
1 parent 74ab516 commit 6715e62
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/Mod/ReverseEngineering/Gui/Command.cpp
Expand Up @@ -187,7 +187,7 @@ void CmdApproxPlane::activated(int)
<< "Base.Vector(" << base.x << "," << base.y << "," << base.z << "),"
<< "Base.Rotation(" << q0 << "," << q1 << "," << q2 << "," << q3 << "))" << std::endl;

openCommand("Fit plane");
openCommand(QT_TRANSLATE_NOOP("Command", "Fit plane"));
runCommand(Gui::Command::Doc, str.str().c_str());
commitCommand();
updateActive();
Expand Down Expand Up @@ -218,7 +218,7 @@ CmdApproxCylinder::CmdApproxCylinder()
void CmdApproxCylinder::activated(int)
{
std::vector<Mesh::Feature*> sel = getSelection().getObjectsOfType<Mesh::Feature>();
openCommand("Fit cylinder");
openCommand(QT_TRANSLATE_NOOP("Command", "Fit cylinder"));
for (auto it : sel) {
const Mesh::MeshObject& mesh = it->Mesh.getValue();
const MeshCore::MeshKernel& kernel = mesh.getKernel();
Expand Down Expand Up @@ -284,7 +284,7 @@ CmdApproxSphere::CmdApproxSphere()
void CmdApproxSphere::activated(int)
{
std::vector<Mesh::Feature*> sel = getSelection().getObjectsOfType<Mesh::Feature>();
openCommand("Fit sphere");
openCommand(QT_TRANSLATE_NOOP("Command", "Fit sphere"));
for (auto it : sel) {
const Mesh::MeshObject& mesh = it->Mesh.getValue();
const MeshCore::MeshKernel& kernel = mesh.getKernel();
Expand Down Expand Up @@ -332,7 +332,7 @@ void CmdApproxPolynomial::activated(int)
{
std::vector<Mesh::Feature*> sel = getSelection().getObjectsOfType<Mesh::Feature>();
App::Document* doc = App::GetApplication().getActiveDocument();
openCommand("Fit polynomial surface");
openCommand(QT_TRANSLATE_NOOP("Command", "Fit polynomial surface"));
for (auto it : sel) {
const Mesh::MeshObject& mesh = it->Mesh.getValue();
const MeshCore::MeshKernel& kernel = mesh.getKernel();
Expand Down Expand Up @@ -598,7 +598,7 @@ void CmdViewTriangulation::activated(int)
{
std::vector<App::DocumentObject*> obj = Gui::Selection().getObjectsOfType(Points::Structured::getClassTypeId());
addModule(App,"ReverseEngineering");
openCommand("View triangulation");
openCommand(QT_TRANSLATE_NOOP("Command", "View triangulation"));
try {
for (std::vector<App::DocumentObject*>::iterator it = obj.begin(); it != obj.end(); ++it) {
App::DocumentObjectT objT(*it);
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp
Expand Up @@ -153,7 +153,7 @@ void FitBSplineSurfaceWidget::on_makePlacement_clicked()
QString command = QString::fromLatin1("%1.addObject(\"App::Placement\", \"Placement\").Placement = %2")
.arg(document, argument);

Gui::Command::openCommand("Placement");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Placement"));
Gui::Command::runCommand(Gui::Command::Doc, "from FreeCAD import Base");
Gui::Command::runCommand(Gui::Command::Doc, command.toLatin1());
Gui::Command::commitCommand();
Expand Down Expand Up @@ -225,7 +225,7 @@ bool FitBSplineSurfaceWidget::accept()

Gui::WaitCursor wc;
Gui::Command::addModule(Gui::Command::App, "ReverseEngineering");
Gui::Command::openCommand("Fit B-Spline");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Fit B-Spline"));
Gui::Command::runCommand(Gui::Command::Doc, command.toLatin1());
Gui::Command::commitCommand();
Gui::Command::updateActive();
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/ReverseEngineering/Gui/Poisson.cpp
Expand Up @@ -98,7 +98,7 @@ bool PoissonWidget::accept()

Gui::WaitCursor wc;
Gui::Command::addModule(Gui::Command::App, "ReverseEngineering");
Gui::Command::openCommand("Poisson reconstruction");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Poisson reconstruction"));
Gui::Command::runCommand(Gui::Command::Doc, command.toLatin1());
Gui::Command::commitCommand();
Gui::Command::updateActive();
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/ReverseEngineering/Gui/SegmentationManual.cpp
Expand Up @@ -231,7 +231,7 @@ void SegmentationManual::createSegment()
return;
// delete all selected faces
App::Document* adoc = gdoc->getDocument();
gdoc->openCommand("Segmentation");
gdoc->openCommand(QT_TRANSLATE_NOOP("Command", "Segmentation"));

std::vector<Mesh::Feature*> meshes = adoc->getObjectsOfType<Mesh::Feature>();
bool selected = false;
Expand Down

0 comments on commit 6715e62

Please sign in to comment.