Fem: Use base class open and reject methods in constraint task panels

This commit is contained in:
marioalexis
2024-06-21 14:11:42 -03:00
parent 5548ba1c59
commit 6002a73fd7
31 changed files with 23 additions and 367 deletions

View File

@@ -37,6 +37,7 @@
#include <Gui/ViewProvider.h>
#include <Mod/Fem/App/FemConstraintForce.h>
#include <Mod/Fem/App/FemTools.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintForce.h"
#include "ui_TaskFemConstraintForce.h"
@@ -426,21 +427,6 @@ 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("Force load");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintForce::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -485,14 +471,4 @@ 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"