[FEM] Use modal add/remove for more constraints (8/??)
Use the previously added superclass `TaskConstraintOnBoundary` for more constraints where it's usable. Currently done: TaskFemConstraintDisplacement TaskFemConstraintForce TaskFemConstraintSpring TaskFemConstraintFluidBoundary TaskFemConstraintHeatflux TaskFemConstraintFixed TaskFemConstraintTemperature TaskFemConstraintPressure Too different: TaskFemConstraintTransform (single selection) TaskFemConstraintContact (single selection, two fields) TaskFemConstraintPlaneRotation (single selection) (Other constraint tasks, which do not use `addToSelection`)
This commit is contained in:
@@ -59,7 +59,7 @@ using namespace Gui;
|
||||
/* TRANSLATOR FemGui::TaskFemConstraintPressure */
|
||||
|
||||
TaskFemConstraintPressure::TaskFemConstraintPressure(ViewProviderFemConstraintPressure *ConstraintView,QWidget *parent)
|
||||
: TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintPressure")
|
||||
: TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintPressure")
|
||||
{ //Note change "pressure" in line above to new constraint name
|
||||
proxy = new QWidget(this);
|
||||
ui = new Ui_TaskFemConstraintPressure();
|
||||
@@ -105,8 +105,10 @@ TaskFemConstraintPressure::TaskFemConstraintPressure(ViewProviderFemConstraintPr
|
||||
}
|
||||
|
||||
//Selection buttons
|
||||
connect(ui->btnAdd, SIGNAL(clicked()), this, SLOT(addToSelection()));
|
||||
connect(ui->btnRemove, SIGNAL(clicked()), this, SLOT(removeFromSelection()));
|
||||
connect(ui->btnAdd, SIGNAL(toggled(bool)),
|
||||
this, SLOT(_addToSelection(bool)));
|
||||
connect(ui->btnRemove, SIGNAL(toggled(bool)),
|
||||
this, SLOT(_removeFromSelection(bool)));
|
||||
|
||||
updateUI();
|
||||
}
|
||||
@@ -261,6 +263,12 @@ void TaskFemConstraintPressure::changeEvent(QEvent *)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskFemConstraintPressure::clearButtons(const SelectionChangeModes notThis)
|
||||
{
|
||||
if (notThis != refAdd) ui->btnAdd->setChecked(false);
|
||||
if (notThis != refRemove) ui->btnRemove->setChecked(false);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// TaskDialog
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
Reference in New Issue
Block a user