Part: [skip ci] explicitly open transaction when opening the Attachment dialog

This commit is contained in:
wmayer
2020-03-23 17:14:42 +01:00
parent d483cacfb1
commit c3d99ee5db

View File

@@ -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)
@@ -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()");