Sketcher: Issue #0004473: Expose openCommand() to translation

Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Sketcher Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
This commit is contained in:
luz paz
2020-11-28 13:27:00 -05:00
committed by wwmayer
parent d23c081047
commit 5effcc1983
9 changed files with 55 additions and 55 deletions

View File

@@ -204,7 +204,7 @@ void CmdSketcherNewSketch::activated(int iMsg)
// create Sketch on Face
std::string FeatName = getUniqueObjectName("Sketch");
openCommand("Create a new sketch on a face");
openCommand(QT_TRANSLATE_NOOP("Command", "Create a new sketch on a face"));
doCommand(Doc,"App.activeDocument().addObject('Sketcher::SketchObject', '%s')", FeatName.c_str());
if (mapmode < Attacher::mmDummy_NumberOfModes)
doCommand(Gui,"App.activeDocument().%s.MapMode = \"%s\"",FeatName.c_str(),AttachEngine::getModeName(mapmode).c_str());
@@ -235,7 +235,7 @@ void CmdSketcherNewSketch::activated(int iMsg)
std::string FeatName = getUniqueObjectName("Sketch");
openCommand("Create a new sketch");
openCommand(QT_TRANSLATE_NOOP("Command", "Create a new sketch"));
doCommand(Doc, "App.activeDocument().addObject('Sketcher::SketchObject', '%s')", FeatName.c_str());
doCommand(Doc,
"App.activeDocument().%s.Placement = App.Placement(App.Vector(%f, %f, %f), App.Rotation(%f, %f, %f, %f))",
@@ -485,7 +485,7 @@ void CmdSketcherReorientSketch::activated(int iMsg)
break;
}
openCommand("Reorient sketch");
openCommand(QT_TRANSLATE_NOOP("Command", "Reorient sketch"));
Gui::cmdAppObjectArgs(sketch,
"Placement = App.Placement(App.Vector(%f, %f, %f), App.Rotation(%f, %f, %f, %f))",
p.x, p.y, p.z, r[0], r[1], r[2], r[3]);
@@ -639,12 +639,12 @@ void CmdSketcherMapSketch::activated(int iMsg)
Gui::Selection().getAsPropertyLinkSubList(support);
std::string supportString = support.getPyReprString();
openCommand("Attach sketch");
openCommand(QT_TRANSLATE_NOOP("Command", "Attach sketch"));
Gui::cmdAppObjectArgs(sketch, "MapMode = \"%s\"",AttachEngine::getModeName(suggMapMode).c_str());
Gui::cmdAppObjectArgs(sketch, "Support = %s",supportString.c_str());
commitCommand();
} else {
openCommand("Detach sketch");
openCommand(QT_TRANSLATE_NOOP("Command", "Detach sketch"));
Gui::cmdAppObjectArgs(sketch, "MapMode = \"%s\"",AttachEngine::getModeName(suggMapMode).c_str());
Gui::cmdAppObjectArgs(sketch, "Support = None");
commitCommand();
@@ -784,7 +784,7 @@ void CmdSketcherMirrorSketch::activated(int iMsg)
refposid = smd.RefPosid;
App::Document* doc = App::GetApplication().getActiveDocument();
openCommand("Create a mirrored sketch for each selected sketch");
openCommand(QT_TRANSLATE_NOOP("Command", "Create a mirrored sketch for each selected sketch"));
for (std::vector<Gui::SelectionObject>::const_iterator it=selection.begin(); it != selection.end(); ++it) {
// create Sketch
@@ -883,7 +883,7 @@ void CmdSketcherMergeSketches::activated(int iMsg)
// create Sketch
std::string FeatName = getUniqueObjectName("Sketch");
openCommand("Merge sketches");
openCommand(QT_TRANSLATE_NOOP("Command", "Merge sketches"));
doCommand(Doc,"App.activeDocument().addObject('Sketcher::SketchObject', '%s')", FeatName.c_str());
Sketcher::SketchObject* mergesketch = static_cast<Sketcher::SketchObject*>(doc->getObject(FeatName.c_str()));

View File

@@ -134,7 +134,7 @@ void CmdSketcherToggleConstruction::activated(int iMsg)
}
// undo command open
openCommand("Toggle draft from/to draft");
openCommand(QT_TRANSLATE_NOOP("Command", "Toggle draft from/to draft"));
// go through the selected subelements
for (std::vector<std::string>::const_iterator it=SubNames.begin();it!=SubNames.end();++it){

View File

@@ -316,7 +316,7 @@ public:
resetPositionText();
try {
Gui::Command::openCommand("Add sketch line");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch line"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.LineSegment(App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
EditCurve[0].x,EditCurve[0].y,EditCurve[1].x,EditCurve[1].y,
geometryCreationMode==Construction?"True":"False");
@@ -490,7 +490,7 @@ public:
int firstCurve = getHighestCurveIndex() + 1;
try {
Gui::Command::openCommand("Add sketch box");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch box"));
Gui::Command::doCommand(Gui::Command::Doc,
"geoList = []\n"
"geoList.append(Part.LineSegment(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
@@ -978,7 +978,7 @@ public:
// issue the geometry
try {
// open the transaction
Gui::Command::openCommand("Add line to sketch wire");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add line to sketch wire"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.LineSegment(App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
EditCurve[0].x,EditCurve[0].y,EditCurve[1].x,EditCurve[1].y,
geometryCreationMode==Construction?"True":"False");
@@ -998,7 +998,7 @@ public:
}
try {
Gui::Command::openCommand("Add arc to sketch wire");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add arc to sketch wire"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.ArcOfCircle"
"(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f),%s)",
CenterPoint.x, CenterPoint.y, std::abs(arcRadius),
@@ -1441,7 +1441,7 @@ public:
resetPositionText();
try {
Gui::Command::openCommand("Add sketch arc");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch arc"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.ArcOfCircle"
"(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f),%s)",
CenterPoint.x, CenterPoint.y, sqrt(rx*rx + ry*ry),
@@ -1710,7 +1710,7 @@ public:
resetPositionText();
try {
Gui::Command::openCommand("Add sketch arc");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch arc"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.ArcOfCircle"
"(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f),%s)",
CenterPoint.x, CenterPoint.y, radius,
@@ -1979,7 +1979,7 @@ public:
resetPositionText();
try {
Gui::Command::openCommand("Add sketch circle");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch circle"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.Circle"
"(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%s)",
EditCurve[0].x, EditCurve[0].y,
@@ -2738,7 +2738,7 @@ private:
int currentgeoid = getHighestCurveIndex(); // index of the ellipse we just created
try {
Gui::Command::openCommand("Add sketch ellipse");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch ellipse"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.Ellipse"
"(App.Vector(%f,%f,0),App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
periapsis.x, periapsis.y,
@@ -3107,7 +3107,7 @@ public:
int currentgeoid = getHighestCurveIndex();
try {
Gui::Command::openCommand("Add sketch arc of ellipse");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch arc of ellipse"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.ArcOfEllipse"
"(Part.Ellipse(App.Vector(%f,%f,0),App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%f,%f),%s)",
@@ -3445,7 +3445,7 @@ public:
try {
Gui::Command::openCommand("Add sketch arc of hyperbola");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch arc of hyperbola"));
//Add arc of hyperbola, point and constrain point as focus2. We add focus2 for it to balance
//the intrinsic focus1, in order to balance out the intrinsic invisible focus1 when AOE is
@@ -3747,7 +3747,7 @@ public:
int currentgeoid = getHighestCurveIndex();
try {
Gui::Command::openCommand("Add sketch arc of Parabola");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch arc of Parabola"));
//Add arc of parabola
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.ArcOfParabola"
@@ -4070,7 +4070,7 @@ public:
// insert circle point for pole, defer internal alignment constraining.
try {
Gui::Command::openCommand("Add Pole circle");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add Pole circle"));
//Add pole
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),10),True)",
@@ -4131,7 +4131,7 @@ public:
// insert circle point for pole, defer internal alignment constraining.
try {
//Gui::Command::openCommand("Add Pole circle");
//Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add Pole circle"));
//Add pole
double guess = (EditCurve[1]-EditCurve[0]).Length()/6;
@@ -4223,7 +4223,7 @@ public:
try {
//Gui::Command::openCommand("Add B-spline curve");
//Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add B-spline curve"));
/*Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.BSplineCurve"
"(%s,%s),"
@@ -4686,7 +4686,7 @@ public:
resetPositionText();
try {
Gui::Command::openCommand("Add sketch circle");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch circle"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.Circle"
"(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%s)",
CenterPoint.x, CenterPoint.y,
@@ -4913,7 +4913,7 @@ public:
resetPositionText();
try {
Gui::Command::openCommand("Add sketch point");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch point"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addGeometry(Part.Point(App.Vector(%f,%f,0)))",
EditPoint.x,EditPoint.y);
@@ -5156,7 +5156,7 @@ public:
int currentgeoid= getHighestCurveIndex();
// create fillet at point
try {
Gui::Command::openCommand("Create fillet");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Create fillet"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "fillet(%d,%d,%f)", GeoId, PosId, radius);
if (construction) {
@@ -5232,7 +5232,7 @@ public:
// create fillet between lines
try {
Gui::Command::openCommand("Create fillet");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Create fillet"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "fillet(%d,%d,App.Vector(%f,%f,0),App.Vector(%f,%f,0),%f)",
firstCurve, secondCurve,
firstPos.x, firstPos.y,
@@ -5384,7 +5384,7 @@ public:
geom->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() ||
geom->getTypeId() == Part::GeomEllipse::getClassTypeId()) {
try {
Gui::Command::openCommand("Trim edge");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Trim edge"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "trim(%d,App.Vector(%f,%f,0))",
GeoId, onSketchPos.x, onSketchPos.y);
Gui::Command::commitCommand();
@@ -5655,7 +5655,7 @@ public:
}
} else if (Mode == STATUS_SEEK_Second) {
try {
Gui::Command::openCommand("Extend edge");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Extend edge"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "extend(%d, %f, %d)\n", // GeoId, increment, PointPos
BaseGeoId, Increment, ExtendFromStart ? Sketcher::start : Sketcher::end);
Gui::Command::commitCommand();
@@ -5871,7 +5871,7 @@ public:
(subName.size() > 6 && subName.substr(0,6) == "Vertex") ||
(subName.size() > 4 && subName.substr(0,4) == "Face")) {
try {
Gui::Command::openCommand("Add external geometry");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add external geometry"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addExternal(\"%s\",\"%s\")",
msg.pObjectName, msg.pSubName);
Gui::Command::commitCommand();
@@ -6052,7 +6052,7 @@ namespace SketcherGui {
if (obj->getTypeId() == Sketcher::SketchObject::getClassTypeId()) {
try {
Gui::Command::openCommand("Add carbon copy");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add carbon copy"));
Gui::cmdAppObjectArgs(sketchgui->getObject(), "carbonCopy(\"%s\",%s)",
msg.pObjectName, geometryCreationMode==Construction?"True":"False");
@@ -6233,7 +6233,7 @@ public:
}
try {
Gui::Command::openCommand("Add slot");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add slot"));
Gui::Command::doCommand(Gui::Command::Doc,
"geoList = []\n"
"geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f))\n"
@@ -6446,7 +6446,7 @@ public:
if (Mode==STATUS_End){
unsetCursor();
resetPositionText();
Gui::Command::openCommand("Add hexagon");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add hexagon"));
try {
Gui::Command::doCommand(Gui::Command::Doc,

View File

@@ -410,7 +410,7 @@ void CmdSketcherConvertToNURB::activated(int iMsg)
bool nurbsized = false;
openCommand("Convert to NURBS");
openCommand(QT_TRANSLATE_NOOP("Command", "Convert to NURBS"));
for (size_t i=0; i < SubNames.size(); i++) {
// only handle edges
@@ -476,7 +476,7 @@ void CmdSketcherIncreaseDegree::activated(int iMsg)
const std::vector<std::string> &SubNames = selection[0].getSubNames();
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());
openCommand("Increase spline degree");
openCommand(QT_TRANSLATE_NOOP("Command", "Increase spline degree"));
bool ignored = false;
@@ -551,7 +551,7 @@ void CmdSketcherDecreaseDegree::activated(int iMsg)
const std::vector<std::string> &SubNames = selection[0].getSubNames();
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());
openCommand("Decrease spline degree");
openCommand(QT_TRANSLATE_NOOP("Command", "Decrease spline degree"));
bool ignored = false;
@@ -644,7 +644,7 @@ void CmdSketcherIncreaseKnotMultiplicity::activated(int iMsg)
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());
openCommand("Increase knot multiplicity");
openCommand(QT_TRANSLATE_NOOP("Command", "Increase knot multiplicity"));
bool applied = false;
bool notaknot = true;
@@ -798,7 +798,7 @@ void CmdSketcherDecreaseKnotMultiplicity::activated(int iMsg)
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());
openCommand("Decrease knot multiplicity");
openCommand(QT_TRANSLATE_NOOP("Command", "Decrease knot multiplicity"));
bool applied = false;
bool notaknot = true;

View File

@@ -140,7 +140,7 @@ void CmdSketcherCloseShape::activated(int iMsg)
int GeoIdLast = -1;
// undo command open
openCommand("Add coincident constraint");
openCommand(QT_TRANSLATE_NOOP("Command", "Add coincident constraint"));
// go through the selected subelements
for (size_t i=0; i < (SubNames.size() - 1); i++) {
// only handle edges
@@ -246,7 +246,7 @@ void CmdSketcherConnect::activated(int iMsg)
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());
// undo command open
openCommand("Add coincident constraint");
openCommand(QT_TRANSLATE_NOOP("Command", "Add coincident constraint"));
// go through the selected subelements
for (unsigned int i=0; i<(SubNames.size()-1); i++ ) {
@@ -873,7 +873,7 @@ void CmdSketcherRestoreInternalAlignmentGeometry::activated(int iMsg)
int currentgeoid = Obj->getHighestCurveIndex();
try {
Gui::Command::openCommand("Exposing Internal Geometry");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Exposing Internal Geometry"));
Gui::cmdAppObjectArgs(Obj, "exposeInternalGeometry(%d)", GeoId);
int aftergeoid = Obj->getHighestCurveIndex();
@@ -1083,7 +1083,7 @@ void CmdSketcherSymmetry::activated(int iMsg)
geoIdList.insert(0, 1, '[');
geoIdList.append(1, ']');
Gui::Command::openCommand("Create symmetric geometry");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Create symmetric geometry"));
try{
Gui::cmdAppObjectArgs(Obj,
@@ -1225,7 +1225,7 @@ public:
resetPositionText();
int currentgeoid = static_cast<Sketcher::SketchObject *>(sketchgui->getObject())->getHighestCurveIndex();
Gui::Command::openCommand("Copy/clone/move geometry");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Copy/clone/move geometry"));
try{
if (Op != SketcherCopy::Move) {
@@ -1749,7 +1749,7 @@ public:
unsetCursor();
resetPositionText();
Gui::Command::openCommand("Create copy of geometry");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Create copy of geometry"));
try {
Gui::cmdAppObjectArgs(sketchgui->getObject(),
@@ -1969,7 +1969,7 @@ void CmdSketcherDeleteAllGeometry::activated(int iMsg)
Sketcher::SketchObject* Obj= vp->getSketchObject();
try {
Gui::Command::openCommand("Delete all geometry");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Delete all geometry"));
Gui::cmdAppObjectArgs(Obj, "deleteAllGeometry()");
Gui::Command::commitCommand();
}
@@ -2029,7 +2029,7 @@ void CmdSketcherDeleteAllConstraints::activated(int iMsg)
Sketcher::SketchObject* Obj= vp->getSketchObject();
try {
Gui::Command::openCommand("Delete All Constraints");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Delete All Constraints"));
Gui::cmdAppObjectArgs(Obj, "deleteAllConstraints()");
Gui::Command::commitCommand();
}

View File

@@ -152,7 +152,7 @@ void CmdSketcherSwitchVirtualSpace::activated(int iMsg)
Sketcher::SketchObject* Obj = sketchgui->getSketchObject();
// undo command open
openCommand("Toggle constraints to the other virtual space");
openCommand(QT_TRANSLATE_NOOP("Command", "Toggle constraints to the other virtual space"));
int successful = SubNames.size();
// go through the selected subelements
@@ -160,7 +160,7 @@ void CmdSketcherSwitchVirtualSpace::activated(int iMsg)
// only handle constraints
if (it->size() > 10 && it->substr(0,10) == "Constraint") {
int ConstrId = Sketcher::PropertyConstraintList::getIndexFromConstraintName(*it);
Gui::Command::openCommand("Update constraint's virtual space");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Update constraint's virtual space"));
try {
Gui::cmdAppObjectArgs(Obj, "toggleVirtualSpace(%d)", ConstrId);
}

View File

@@ -589,7 +589,7 @@ void DrawSketchHandler::createAutoConstraints(const std::vector<AutoConstraint>
if(createowncommand) {
// Open the Command
Gui::Command::openCommand("Add auto constraints");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add auto constraints"));
}
// Iterate through constraints

View File

@@ -619,7 +619,7 @@ void ConstraintView::swapNamedOfSelectedItems()
ss << "DummyConstraint" << rand();
std::string tmpname = ss.str();
Gui::Command::openCommand("Swap constraint names");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Swap constraint names"));
Gui::cmdAppObjectArgs(item1->sketch, "renameConstraint(%d, u'%s')",
item1->ConstraintNbr, tmpname.c_str());
Gui::cmdAppObjectArgs(item2->sketch, "renameConstraint(%d, u'%s')",
@@ -842,7 +842,7 @@ void TaskSketcherConstrains::on_listWidgetConstraints_itemChanged(QListWidgetIte
if (newName != currConstraintName && !basename.empty()) {
std::string escapedstr = Base::Tools::escapedUnicodeFromUtf8(newName.c_str());
Gui::Command::openCommand("Rename sketch constraint");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Rename sketch constraint"));
try {
Gui::cmdAppObjectArgs(sketch ,"renameConstraint(%d, u'%s')",
it->ConstraintNbr, escapedstr.c_str());
@@ -857,7 +857,7 @@ void TaskSketcherConstrains::on_listWidgetConstraints_itemChanged(QListWidgetIte
}
// update constraint virtual space status
Gui::Command::openCommand("Update constraint's virtual space");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Update constraint's virtual space"));
try {
Gui::cmdAppObjectArgs(sketch, "setVirtualSpace(%d, %s)",
it->ConstraintNbr,

View File

@@ -808,7 +808,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
Sketcher::PointPos PosId;
getSketchObject()->getGeoVertexIndex(edit->DragPoint, GeoId, PosId);
if (GeoId != Sketcher::Constraint::GeoUndef && PosId != Sketcher::none) {
getDocument()->openCommand("Drag Point");
getDocument()->openCommand(QT_TRANSLATE_NOOP("Command", "Drag Point"));
try {
Gui::cmdAppObjectArgs(getObject(), "movePoint(%i,%i,App.Vector(%f,%f,0),%i)"
,GeoId, PosId, x-xInit, y-yInit, 0);
@@ -839,7 +839,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
geo->getTypeId() == Part::GeomArcOfParabola::getClassTypeId()||
geo->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId()||
geo->getTypeId() == Part::GeomBSplineCurve::getClassTypeId()) {
getDocument()->openCommand("Drag Curve");
getDocument()->openCommand(QT_TRANSLATE_NOOP("Command", "Drag Curve"));
try {
Gui::cmdAppObjectArgs(getObject(), "movePoint(%i,%i,App.Vector(%f,%f,0),%i)"
,edit->DragCurve, Sketcher::none, x-xInit, y-yInit, relative ? 1 : 0);
@@ -861,7 +861,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
return true;
case STATUS_SKETCH_DragConstraint:
if (edit->DragConstraintSet.empty() == false) {
getDocument()->openCommand("Drag Constraint");
getDocument()->openCommand(QT_TRANSLATE_NOOP("Command", "Drag Constraint"));
auto idset = edit->DragConstraintSet;
for(int id : idset) {
moveConstraint(id, Base::Vector2d(x, y));
@@ -1037,7 +1037,7 @@ void ViewProviderSketch::editDoubleClicked(void)
// if its the right constraint
if (Constr->isDimensional()) {
Gui::Command::openCommand("Modify sketch constraints");
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Modify sketch constraints"));
EditDatumDialog editDatumDialog(this, id);
editDatumDialog.exec();
}