+ use undo/redo for Fem constraint force dialog

This commit is contained in:
wmayer
2015-02-27 11:21:05 +01:00
parent 36e4758b72
commit 6721139630
3 changed files with 25 additions and 0 deletions

View File

@@ -329,6 +329,15 @@ TaskDlgFemConstraintForce::TaskDlgFemConstraintForce(ViewProviderFemConstraintFo
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintForce::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Constraint force");
Gui::Command::openCommand((const char*)msg.toUtf8());
}
}
bool TaskDlgFemConstraintForce::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -360,4 +369,14 @@ bool TaskDlgFemConstraintForce::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintForce::reject()
{
// roll back the changes
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintForce.cpp"