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 0361543cfb
commit 6c0f3bde92
31 changed files with 23 additions and 367 deletions

View File

@@ -92,20 +92,6 @@ TaskDlgFemConstraintInitialTemperature::TaskDlgFemConstraintInitialTemperature(
}
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintInitialTemperature::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Constraint initial temperature");
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 TaskDlgFemConstraintInitialTemperature::accept()
{
@@ -118,13 +104,6 @@ bool TaskDlgFemConstraintInitialTemperature::accept()
"App.ActiveDocument.%s.initialTemperature = \"%s\"",
name.c_str(),
parameterTemperature->get_temperature().c_str());
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
try {
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
if (!ConstraintView->getObject()->isValid()) {
throw Base::RuntimeError(ConstraintView->getObject()->getStatusString());
@@ -140,13 +119,4 @@ bool TaskDlgFemConstraintInitialTemperature::accept()
return true;
}
bool TaskDlgFemConstraintInitialTemperature::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintInitialTemperature.cpp"