diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp
index d35fbd6af0..9e64dddb45 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp
+++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp
@@ -60,7 +60,7 @@ using namespace Gui;
/* TRANSLATOR FemGui::TaskFemConstraintFixed */
TaskFemConstraintFixed::TaskFemConstraintFixed(ViewProviderFemConstraintFixed *ConstraintView,QWidget *parent)
- : TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintFixed")
+ : TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintFixed")
{ //Note change "Fixed" in line above to new constraint name
proxy = new QWidget(this);
ui = new Ui_TaskFemConstraintFixed();
@@ -96,8 +96,10 @@ TaskFemConstraintFixed::TaskFemConstraintFixed(ViewProviderFemConstraintFixed *C
}
//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();
}
@@ -244,6 +246,12 @@ void TaskFemConstraintFixed::changeEvent(QEvent *)
{
}
+void TaskFemConstraintFixed::clearButtons(const SelectionChangeModes notThis)
+{
+ if (notThis != refAdd) ui->btnAdd->setChecked(false);
+ if (notThis != refRemove) ui->btnRemove->setChecked(false);
+}
+
//**************************************************************************
// TaskDialog
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.h b/src/Mod/Fem/Gui/TaskFemConstraintFixed.h
index 1660de7403..2ab61aac72 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.h
+++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.h
@@ -31,6 +31,7 @@
#include
#include "TaskFemConstraint.h"
+#include "TaskFemConstraintOnBoundary.h"
#include "ViewProviderFemConstraintFixed.h"
#include
@@ -40,7 +41,7 @@
class Ui_TaskFemConstraintFixed;
namespace FemGui {
-class TaskFemConstraintFixed : public TaskFemConstraint
+class TaskFemConstraintFixed : public TaskFemConstraintOnBoundary
{
Q_OBJECT
@@ -57,6 +58,7 @@ private Q_SLOTS:
protected:
bool event(QEvent *e);
void changeEvent(QEvent *e);
+ void clearButtons(const SelectionChangeModes notThis) override;
private:
void updateUI();
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.ui b/src/Mod/Fem/Gui/TaskFemConstraintFixed.ui
index 27162f1410..2ded773f6f 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.ui
+++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.ui
@@ -24,17 +24,23 @@
-
-
-
+
Add
+
+ true
+
-
-
+
Remove
+
+ true
+
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp
index 2146270d2f..17d182b96a 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp
+++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp
@@ -132,7 +132,7 @@ void initComboBox(QComboBox* combo, const std::vector& textItems, c
/* TRANSLATOR FemGui::TaskFemConstraintFluidBoundary */
TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemConstraintFluidBoundary *ConstraintView,QWidget *parent)
- : TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintFluidBoundary")
+ : TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintFluidBoundary")
, dimension(-1)
{
// we need a separate container widget to add all controls to
@@ -175,8 +175,10 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo
ui->checkReverse->blockSignals(true);
//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)));
// Get the feature data
Fem::ConstraintFluidBoundary* pcConstraint = static_cast(ConstraintView->getObject());
@@ -557,6 +559,9 @@ void TaskFemConstraintFluidBoundary::onButtonDirection(const bool pressed)
// sets the normal vector of the currently selecteed planar face as direction
Q_UNUSED(pressed)
+
+ clearButtons(none);
+
//get vector of selected objects of active document
std::vector selection = Gui::Selection().getSelectionEx();
if (selection.size() == 0) {
@@ -863,6 +868,12 @@ void TaskFemConstraintFluidBoundary::changeEvent(QEvent *e)
}
}
+void TaskFemConstraintFluidBoundary::clearButtons(const SelectionChangeModes notThis)
+{
+ if (notThis != refAdd) ui->btnAdd->setChecked(false);
+ if (notThis != refRemove) ui->btnRemove->setChecked(false);
+}
+
//**************************************************************************
//**************************************************************************
// TaskDialog
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h
index d388a92954..9c0036a246 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h
+++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h
@@ -31,6 +31,7 @@
#include
#include "TaskFemConstraint.h"
+#include "TaskFemConstraintOnBoundary.h"
#include "ViewProviderFemConstraintFluidBoundary.h"
#include
@@ -47,7 +48,7 @@ class ViewProvider;
namespace FemGui {
-class TaskFemConstraintFluidBoundary : public TaskFemConstraint
+class TaskFemConstraintFluidBoundary : public TaskFemConstraintOnBoundary
{
Q_OBJECT
@@ -92,6 +93,7 @@ private Q_SLOTS:
protected:
bool event(QEvent *e);
virtual void changeEvent(QEvent *e);
+ void clearButtons(const SelectionChangeModes notThis) override;
private:
void updateBoundaryTypeUI();
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.ui b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.ui
index 68f0af5b3a..ab044095d2 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.ui
+++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.ui
@@ -88,17 +88,23 @@
-
-
-
+
Add
+
+ true
+
-
-
+
Remove
+
+ true
+
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp
index 83e4986e19..014aaff8ea 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp
+++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp
@@ -70,7 +70,7 @@ using namespace Gui;
/* TRANSLATOR FemGui::TaskFemConstraintForce */
TaskFemConstraintForce::TaskFemConstraintForce(ViewProviderFemConstraintForce *ConstraintView,QWidget *parent)
- : TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintForce")
+ : TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintForce")
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
@@ -128,8 +128,10 @@ TaskFemConstraintForce::TaskFemConstraintForce(ViewProviderFemConstraintForce *C
ui->checkReverse->blockSignals(false);
//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();
}
@@ -315,6 +317,8 @@ void TaskFemConstraintForce::onButtonDirection(const bool pressed)
// sets the normal vector of the currently selecteed planar face as direction
Q_UNUSED(pressed)
+ clearButtons(none);
+
auto link = getDirection(Gui::Selection().getSelectionEx());
if (!link.first) {
QMessageBox::warning(this, tr("Wrong selection"), tr("Select an edge or a face, please."));
@@ -402,6 +406,12 @@ void TaskFemConstraintForce::changeEvent(QEvent *e)
}
}
+void TaskFemConstraintForce::clearButtons(const SelectionChangeModes notThis)
+{
+ if (notThis != refAdd) ui->btnAdd->setChecked(false);
+ if (notThis != refRemove) ui->btnRemove->setChecked(false);
+}
+
//**************************************************************************
//**************************************************************************
// TaskDialog
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.h b/src/Mod/Fem/Gui/TaskFemConstraintForce.h
index 893bb76364..5e56d2077e 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintForce.h
+++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.h
@@ -30,6 +30,7 @@
#include
#include "TaskFemConstraint.h"
+#include "TaskFemConstraintOnBoundary.h"
#include "ViewProviderFemConstraintForce.h"
#include
@@ -47,7 +48,7 @@ class ViewProvider;
namespace FemGui {
-class TaskFemConstraintForce : public TaskFemConstraint
+class TaskFemConstraintForce : public TaskFemConstraintOnBoundary
{
Q_OBJECT
@@ -71,6 +72,7 @@ private Q_SLOTS:
protected:
bool event(QEvent *e);
virtual void changeEvent(QEvent *e);
+ void clearButtons(const SelectionChangeModes notThis) override;
private:
std::pair getDirection(const std::vector&) const;
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.ui b/src/Mod/Fem/Gui/TaskFemConstraintForce.ui
index 047b5e9275..7ae0e5fbd0 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintForce.ui
+++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.ui
@@ -42,17 +42,23 @@
-
-
-
+
Add
+
+ true
+
-
-
+
Remove
+
+ true
+
@@ -94,7 +100,7 @@
-
-
-
+
Select a planar edge or face, then press this button
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp
index 90475d3151..7a853192c4 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp
+++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp
@@ -59,7 +59,7 @@ using namespace Gui;
/* TRANSLATOR FemGui::TaskFemConstraintHeatflux */
TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(ViewProviderFemConstraintHeatflux *ConstraintView,QWidget *parent)
- : TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintHeatflux")
+ : TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintHeatflux")
{
proxy = new QWidget(this);
ui = new Ui_TaskFemConstraintHeatflux();
@@ -130,8 +130,10 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(ViewProviderFemConstraintHe
}
//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)));
ui->if_ambienttemp->blockSignals(false);
//ui->if_facetemp->blockSignals(false);
@@ -375,6 +377,12 @@ void TaskFemConstraintHeatflux::changeEvent(QEvent *e)
}
}
+void TaskFemConstraintHeatflux::clearButtons(const SelectionChangeModes notThis)
+{
+ if (notThis != refAdd) ui->btnAdd->setChecked(false);
+ if (notThis != refRemove) ui->btnRemove->setChecked(false);
+}
+
//**************************************************************************
// TaskDialog
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h
index 272528b5a8..5d26530d4d 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h
+++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h
@@ -33,6 +33,7 @@
#include
#include "TaskFemConstraint.h"
+#include "TaskFemConstraintOnBoundary.h"
#include "ViewProviderFemConstraintHeatflux.h"
#include
@@ -43,7 +44,7 @@
class Ui_TaskFemConstraintHeatflux;
namespace FemGui {
-class TaskFemConstraintHeatflux : public TaskFemConstraint
+class TaskFemConstraintHeatflux : public TaskFemConstraintOnBoundary
{
Q_OBJECT
@@ -70,6 +71,7 @@ private Q_SLOTS:
protected:
bool event(QEvent *e);
virtual void changeEvent(QEvent *e);
+ void clearButtons(const SelectionChangeModes notThis) override;
private:
void updateUI();
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.ui b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.ui
index 7c78b140af..0fa4fdeeb2 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.ui
+++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.ui
@@ -24,17 +24,23 @@
-
-
-
+
Add
+
+ true
+
-
-
+
Remove
+
+ true
+
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp
index 776e04fa5e..a8a7621793 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp
+++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp
@@ -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
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.h b/src/Mod/Fem/Gui/TaskFemConstraintPressure.h
index 0fb3efee63..6088d0f961 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.h
+++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.h
@@ -33,6 +33,7 @@
#include
#include "TaskFemConstraint.h"
+#include "TaskFemConstraintOnBoundary.h"
#include "ViewProviderFemConstraintPressure.h"
#include
@@ -43,7 +44,7 @@
class Ui_TaskFemConstraintPressure;
namespace FemGui {
-class TaskFemConstraintPressure : public TaskFemConstraint
+class TaskFemConstraintPressure : public TaskFemConstraintOnBoundary
{
Q_OBJECT
@@ -63,6 +64,7 @@ private Q_SLOTS:
protected:
bool event(QEvent *e);
void changeEvent(QEvent *e);
+ void clearButtons(const SelectionChangeModes notThis) override;
private:
void updateUI();
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.ui b/src/Mod/Fem/Gui/TaskFemConstraintPressure.ui
index 844fe15dd6..ceb96b4737 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.ui
+++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.ui
@@ -24,17 +24,23 @@
-
-
-
+
Add
+
+ true
+
-
-
+
Remove
+
+ true
+
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp b/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp
index 005b56c591..3fea6102b6 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp
+++ b/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp
@@ -59,8 +59,8 @@ using namespace Gui;
/* TRANSLATOR FemGui::TaskFemConstraintSpring */
TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring *ConstraintView, QWidget *parent)
- : TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintSpring")
-{
+ : TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintSpring")
+{
proxy = new QWidget(this);
ui = new Ui_TaskFemConstraintSpring();
ui->setupUi(proxy);
@@ -95,7 +95,7 @@ TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring
ui->if_tan->setMaximum(FLOAT_MAX);
Base::Quantity ts = Base::Quantity((pcConstraint->tangentialStiffness.getValue()), Base::Unit::Stiffness);
ui->if_tan->setValue(ts);
-
+
/* */
ui->lw_references->clear();
@@ -107,8 +107,10 @@ TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring
}
//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 TaskFemConstraintSpring::changeEvent(QEvent *)
{
}
+void TaskFemConstraintSpring::clearButtons(const SelectionChangeModes notThis)
+{
+ if (notThis != refAdd) ui->btnAdd->setChecked(false);
+ if (notThis != refRemove) ui->btnRemove->setChecked(false);
+}
+
//**************************************************************************
// TaskDialog
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintSpring.h b/src/Mod/Fem/Gui/TaskFemConstraintSpring.h
index 08d515478a..b4554fb0bf 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintSpring.h
+++ b/src/Mod/Fem/Gui/TaskFemConstraintSpring.h
@@ -31,6 +31,7 @@
#include
#include "TaskFemConstraint.h"
+#include "TaskFemConstraintOnBoundary.h"
#include "ViewProviderFemConstraintSpring.h"
#include
@@ -41,7 +42,7 @@
class Ui_TaskFemConstraintSpring;
namespace FemGui {
-class TaskFemConstraintSpring : public TaskFemConstraint
+class TaskFemConstraintSpring : public TaskFemConstraintOnBoundary
{
Q_OBJECT
@@ -60,6 +61,7 @@ private Q_SLOTS:
protected:
bool event(QEvent *e);
void changeEvent(QEvent *e);
+ void clearButtons(const SelectionChangeModes notThis) override;
private:
void updateUI();
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintSpring.ui b/src/Mod/Fem/Gui/TaskFemConstraintSpring.ui
index 244619cde1..cc4b2ea63e 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintSpring.ui
+++ b/src/Mod/Fem/Gui/TaskFemConstraintSpring.ui
@@ -24,17 +24,23 @@
-
-
-
+
Add
+
+ true
+
-
-
+
Remove
+
+ true
+
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp
index a0089f3cf4..15a5672553 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp
+++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp
@@ -61,7 +61,7 @@ using namespace Gui;
/* TRANSLATOR FemGui::TaskFemConstraintTemperature */
TaskFemConstraintTemperature::TaskFemConstraintTemperature(ViewProviderFemConstraintTemperature *ConstraintView,QWidget *parent)
- : TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintTemperature")
+ : TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintTemperature")
{
proxy = new QWidget(this);
ui = new Ui_TaskFemConstraintTemperature();
@@ -120,8 +120,10 @@ TaskFemConstraintTemperature::TaskFemConstraintTemperature(ViewProviderFemConstr
}
//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();
}
@@ -316,6 +318,12 @@ void TaskFemConstraintTemperature::changeEvent(QEvent *)
// }
}
+void TaskFemConstraintTemperature::clearButtons(const SelectionChangeModes notThis)
+{
+ if (notThis != refAdd) ui->btnAdd->setChecked(false);
+ if (notThis != refRemove) ui->btnRemove->setChecked(false);
+}
+
//**************************************************************************
// TaskDialog
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h
index 17b1d3b4fc..c8a1e05ca7 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h
+++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h
@@ -33,6 +33,7 @@
#include
#include "TaskFemConstraint.h"
+#include "TaskFemConstraintOnBoundary.h"
#include "ViewProviderFemConstraintTemperature.h"
#include
@@ -43,7 +44,7 @@
class Ui_TaskFemConstraintTemperature;
namespace FemGui {
-class TaskFemConstraintTemperature : public TaskFemConstraint
+class TaskFemConstraintTemperature : public TaskFemConstraintOnBoundary
{
Q_OBJECT
@@ -66,6 +67,7 @@ private Q_SLOTS:
protected:
bool event(QEvent *e);
void changeEvent(QEvent *e);
+ void clearButtons(const SelectionChangeModes notThis) override;
private:
void updateUI();
diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.ui b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.ui
index 5180f72406..d36271a5d4 100644
--- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.ui
+++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.ui
@@ -24,17 +24,23 @@
-
-
-
+
Add
+
+ true
+
-
-
+
Remove
+
+ true
+