Remove most activate-deactivate

This commit is contained in:
theo-vt
2026-02-25 22:25:29 -05:00
parent 3076ce66be
commit 5c6bf5461d
39 changed files with 2 additions and 260 deletions
-10
View File
@@ -102,14 +102,4 @@ bool TaskDlgCreateNodeSet::reject()
void TaskDlgCreateNodeSet::helpRequested()
{}
void TaskDlgCreateNodeSet::activate()
{
param->attachSelection();
param->setSelectionGate();
}
void TaskDlgCreateNodeSet::deactivate()
{
param->detachSelection();
}
#include "moc_TaskDlgCreateNodeSet.cpp"
-3
View File
@@ -62,9 +62,6 @@ public:
/// is called by the framework if the user press the help button
void helpRequested() override;
void activate() override;
void deactivate() override;
/// returns for Close and Help button
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
-9
View File
@@ -273,13 +273,4 @@ bool TaskDlgFemConstraint::reject()
return true;
}
void TaskDlgFemConstraint::activate()
{
parameter->attachSelection();
}
void TaskDlgFemConstraint::deactivate()
{
parameter->detachSelection();
}
#include "moc_TaskFemConstraint.cpp"
-3
View File
@@ -112,9 +112,6 @@ public:
/// is called by the framework if the dialog is rejected (Cancel)
bool reject() override;
void activate() override;
void deactivate() override;
bool isAllowedAlterDocument() const override
{
return false;
-4
View File
@@ -626,14 +626,10 @@ void TaskMeasure::reset()
void TaskMeasure::activate()
{
updateSelectionType();
// engage the selectionObserver
attachSelection();
qApp->installEventFilter(this);
}
void TaskMeasure::deactivate()
{
Gui::Selection().setSelectionStyle(SelectionStyle::NormalSelection);
detachSelection();
qApp->removeEventFilter(this);
}
-9
View File
@@ -936,14 +936,5 @@ void TaskExtrusion::clicked(int id)
};
}
}
void TaskExtrusion::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskExtrusion::deactivate()
{
widget->detachSelection();
}
#include "moc_DlgExtrusion.cpp"
-2
View File
@@ -117,8 +117,6 @@ public:
bool accept() override;
bool reject() override;
void clicked(int) override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
-9
View File
@@ -1197,15 +1197,6 @@ bool TaskFilletEdges::reject()
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
return true;
}
void TaskFilletEdges::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskFilletEdges::deactivate()
{
widget->detachSelection();
}
// --------------------------------------------------------------
-2
View File
@@ -187,8 +187,6 @@ public:
void clicked(int) override;
bool accept() override;
bool reject() override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
@@ -1225,15 +1225,6 @@ bool TaskProjectionOnSurface::reject()
widget->reject();
return true;
}
void TaskProjectionOnSurface::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskProjectionOnSurface::deactivate()
{
widget->detachSelection();
}
void TaskProjectionOnSurface::clicked(int id)
{
@@ -1661,14 +1652,5 @@ bool TaskProjectOnSurface::reject()
resetEdit();
return true;
}
void TaskProjectOnSurface::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskProjectOnSurface::deactivate()
{
widget->detachSelection();
}
#include "moc_DlgProjectionOnSurface.cpp"
@@ -172,8 +172,6 @@ public:
bool accept() override;
bool reject() override;
void clicked(int id) override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
@@ -250,8 +248,6 @@ public:
public:
bool accept() override;
bool reject() override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
+2 -17
View File
@@ -528,19 +528,13 @@ void DlgRevolution::accept()
QDialog::accept();
}
void DlgRevolution::setSelectionGate()
{
if (filterSelection) {
filter = new EdgeSelection();
Gui::Selection().addSelectionGate(filter);
}
}
void DlgRevolution::onSelectLineClicked()
{
if (!filterSelection) {
filterSelection = true;
setSelectionGate();
filter = new EdgeSelection();
Gui::Selection().addSelectionGate(filter);
ui->selectLine->setText(tr("Selecting… (Line or Arc)"));
}
else {
@@ -677,14 +671,5 @@ bool TaskRevolution::accept()
widget->accept();
return (widget->result() == QDialog::Accepted);
}
void TaskRevolution::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskRevolution::deactivate()
{
widget->detachSelection();
}
#include "moc_DlgRevolution.cpp"
-3
View File
@@ -42,7 +42,6 @@ public:
explicit DlgRevolution(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~DlgRevolution() override;
void accept() override;
void setSelectionGate();
Base::Vector3d getDirection() const;
Base::Vector3d getPosition() const;
@@ -96,8 +95,6 @@ public:
public:
bool accept() override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
-9
View File
@@ -421,14 +421,5 @@ bool TaskMirroring::reject()
{
return widget->reject();
}
void TaskMirroring::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskMirroring::deactivate()
{
widget->detachSelection();
}
#include "moc_Mirroring.cpp"
-2
View File
@@ -73,8 +73,6 @@ public:
public:
bool accept() override;
bool reject() override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
-12
View File
@@ -1554,17 +1554,5 @@ bool TaskDlgAttacher::reject()
return true;
}
void TaskDlgAttacher::activate()
{
if (parameter) {
parameter->attachSelection();
}
}
void TaskDlgAttacher::deactivate()
{
if (parameter) {
parameter->detachSelection();
}
}
#include "moc_TaskAttacher.cpp"
-3
View File
@@ -215,9 +215,6 @@ public:
/// is called by the framework if the dialog is rejected (Cancel)
bool reject() override;
void activate() override;
void deactivate() override;
bool isAllowedAlterDocument() const override
{
return false;
-9
View File
@@ -545,14 +545,5 @@ bool TaskFaceAppearances::reject()
{
return widget->reject();
}
void TaskFaceAppearances::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskFaceAppearances::deactivate()
{
widget->detachSelection();
}
#include "moc_TaskFaceAppearances.cpp"
-2
View File
@@ -90,8 +90,6 @@ public:
bool accept() override;
bool reject() override;
void clicked(int) override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
-9
View File
@@ -644,14 +644,5 @@ bool TaskShapeBuilder::reject()
{
return widget->reject();
}
void TaskShapeBuilder::activate()
{
widget->setSelectionGate();
widget->attachSelection();
}
void TaskShapeBuilder::deactivate()
{
widget->detachSelection();
}
#include "moc_TaskShapeBuilder.cpp"
-2
View File
@@ -79,8 +79,6 @@ public:
bool accept() override;
bool reject() override;
void clicked(int) override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
@@ -432,14 +432,5 @@ bool TaskDlgBooleanParameters::reject()
return true;
}
void TaskDlgBooleanParameters::activate()
{
parameter->attachSelection();
}
void TaskDlgBooleanParameters::deactivate()
{
parameter->detachSelection();
}
#include "moc_TaskBooleanParameters.cpp"
@@ -112,8 +112,6 @@ public:
bool accept() override;
/// is called by the framework if the dialog is rejected (Cancel)
bool reject() override;
void activate() override;
void deactivate() override;
bool isAllowedAlterDocument() const override
{
@@ -513,14 +513,5 @@ bool TaskDlgDressUpParameters::reject()
getViewObject<ViewProviderDressUp>()->highlightReferences(false);
return TaskDlgFeatureParameters::reject();
}
void TaskDlgDressUpParameters::activate()
{
parameter->attachSelection();
parameter->setSelectionGate();
}
void TaskDlgDressUpParameters::deactivate()
{
parameter->detachSelection();
}
#include "moc_TaskDressUpParameters.cpp"
@@ -139,8 +139,6 @@ public:
/// is called by the framework if the dialog is accepted (Ok)
bool accept() override;
bool reject() override;
void activate() override;
void deactivate() override;
protected:
TaskDressUpParameters* parameter;
@@ -285,27 +285,5 @@ bool TaskDlgFeatureParameters::reject()
return true;
}
void TaskDlgFeatureParameters::activate()
{
std::vector<QWidget*> subwidgets = getDialogContent();
for (auto it : subwidgets) {
TaskSketchBasedParameters* param = qobject_cast<TaskSketchBasedParameters*>(it);
if (param) {
param->attachSelection();
}
}
}
void TaskDlgFeatureParameters::deactivate()
{
// detach the task panel from the selection to avoid to invoke
// eventually onAddSelection when the selection changes
std::vector<QWidget*> subwidgets = getDialogContent();
for (auto it : subwidgets) {
TaskSketchBasedParameters* param = qobject_cast<TaskSketchBasedParameters*>(it);
if (param) {
param->detachSelection();
}
}
}
#include "moc_TaskFeatureParameters.cpp"
@@ -156,8 +156,6 @@ public:
bool accept() override;
/// is called by the framework if the dialog is rejected (Cancel)
bool reject() override;
void activate() override;
void deactivate() override;
template<typename T = PartDesignGui::ViewProvider>
T* getViewObject() const
@@ -677,14 +677,6 @@ bool TaskDlgFeaturePick::reject()
accepted = false;
return true;
}
void TaskDlgFeaturePick::activate()
{
pick->attachSelection();
}
void TaskDlgFeaturePick::deactivate()
{
pick->detachSelection();
}
void TaskDlgFeaturePick::showExternal(bool val)
{
-3
View File
@@ -130,9 +130,6 @@ public:
/// is called by the framework if the dialog is rejected (Cancel)
bool reject() override;
void activate() override;
void deactivate() override;
bool isAllowedAlterDocument() const override
{
return false;
@@ -461,13 +461,5 @@ bool TaskDlgShapeBinder::reject()
}
return true;
}
void TaskDlgShapeBinder::activate()
{
parameter->attachSelection();
}
void TaskDlgShapeBinder::deactivate()
{
parameter->detachSelection();
}
#include "moc_TaskShapeBinder.cpp"
-2
View File
@@ -112,8 +112,6 @@ public:
bool accept() override;
/// is called by the framework if the dialog is rejected (Cancel)
bool reject() override;
void activate() override;
void deactivate() override;
protected:
TaskShapeBinder* parameter;
@@ -634,14 +634,5 @@ bool TaskDlgTransformedParameters::reject()
parameter->exitSelectionMode();
return TaskDlgFeatureParameters::reject();
}
void TaskDlgTransformedParameters::activate()
{
parameter->attachSelection();
}
void TaskDlgTransformedParameters::deactivate()
{
parameter->detachSelection();
}
#include "moc_TaskTransformedParameters.cpp"
@@ -236,9 +236,6 @@ public:
/// is called by the framework if the dialog is rejected (Cancel)
bool reject() override;
void activate() override;
void deactivate() override;
protected:
TaskTransformedParameters* parameter = nullptr;
TaskTransformedMessages* message = nullptr;
-17
View File
@@ -1031,23 +1031,6 @@ bool TaskFilling::reject()
return ok;
}
void TaskFilling::activate()
{
widget1->attachSelection();
widget1->setSelectionGate();
widget2->attachSelection();
widget2->setSelectionGate();
widget3->attachSelection();
widget3->setSelectionGate();
}
void TaskFilling::deactivate()
{
widget1->detachSelection();
widget2->detachSelection();
widget3->detachSelection();
}
} // namespace SurfaceGui
-2
View File
@@ -141,8 +141,6 @@ public:
void closed() override;
bool accept() override;
bool reject() override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
@@ -687,14 +687,6 @@ bool TaskGeomFillSurface::reject()
{
return widget->reject();
}
void TaskGeomFillSurface::activate()
{
widget->attachSelection();
}
void TaskGeomFillSurface::deactivate()
{
widget->detachSelection();
}
} // namespace SurfaceGui
@@ -129,8 +129,6 @@ public:
void open() override;
bool accept() override;
bool reject() override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
-9
View File
@@ -670,15 +670,6 @@ bool TaskSections::reject()
return ok;
}
void TaskSections::activate()
{
widget1->setSelectionGate();
widget1->attachSelection();
}
void TaskSections::deactivate()
{
widget1->detachSelection();
}
} // namespace SurfaceGui
-2
View File
@@ -132,8 +132,6 @@ public:
void open() override;
bool accept() override;
bool reject() override;
void activate() override;
void deactivate() override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{