Skip to content

Commit

Permalink
Part: [skip ci] explicitly open transaction when opening the Attachme…
Browse files Browse the repository at this point in the history
…nt dialog
  • Loading branch information
wwmayer committed Mar 23, 2020
1 parent 28e40f8 commit bd0f5ca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Mod/Part/Gui/TaskAttacher.cpp
Expand Up @@ -1041,7 +1041,8 @@ TaskDlgAttacher::~TaskDlgAttacher()

void TaskDlgAttacher::open()
{

Gui::Document* document = Gui::Application::Instance->getDocument(ViewProvider->getObject()->getDocument());
document->openCommand("Edit attachment");
}

void TaskDlgAttacher::clicked(int)
Expand All @@ -1061,20 +1062,21 @@ bool TaskDlgAttacher::accept()
auto obj = ViewProvider->getObject();

//DeepSOIC: changed this to heavily rely on dialog constantly updating feature properties
if (pcAttach->AttachmentOffset.isTouched()){
//if (pcAttach->AttachmentOffset.isTouched()){
Base::Placement plm = pcAttach->AttachmentOffset.getValue();
double yaw, pitch, roll;
plm.getRotation().getYawPitchRoll(yaw,pitch,roll);
Gui::cmdAppObjectArgs(obj, "AttachmentOffset = App.Placement(App.Vector(%.10f, %.10f, %.10f), App.Rotation(%.10f, %.10f, %.10f))",
plm.getPosition().x, plm.getPosition().y, plm.getPosition().z, yaw, pitch, roll);
}
//}

Gui::cmdAppObjectArgs(obj, "MapReversed = %s", pcAttach->MapReversed.getValue() ? "True" : "False");

Gui::cmdAppObjectArgs(obj, "Support = %s", pcAttach->Support.getPyReprString().c_str());

Gui::cmdAppObjectArgs(obj, "MapMode = '%s'", AttachEngine::getModeName(eMapMode(pcAttach->MapMode.getValue())).c_str());
Gui::cmdAppObjectArgs(obj, "MapPathParameter = %f", pcAttach->MapPathParameter.getValue());

Gui::cmdAppObjectArgs(obj, "MapMode = '%s'", AttachEngine::getModeName(eMapMode(pcAttach->MapMode.getValue())).c_str());
Gui::cmdAppObject(obj, "recompute()");

Gui::cmdGuiDocument(obj, "resetEdit()");
Expand Down

0 comments on commit bd0f5ca

Please sign in to comment.