From 7628f2bbb6de87fcd11d32e087c65eab8fa0bd7c Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 1 May 2017 16:16:49 +0200 Subject: [PATCH] Revert "Sketcher: Edit Controls' checkboxes to independently hide/show driving/non-driving constraints" This reverts commit 03a9d58db6c7d11c60446bd9b9e2dec14795f37e. --- src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp | 26 +-------------- src/Mod/Sketcher/Gui/TaskSketcherGeneral.h | 3 -- src/Mod/Sketcher/Gui/TaskSketcherGeneral.ui | 35 ++------------------ src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 16 ++------- src/Mod/Sketcher/Gui/ViewProviderSketch.h | 3 -- 5 files changed, 6 insertions(+), 77 deletions(-) diff --git a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp index 050c8b3ba3..3be9277de7 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp @@ -56,10 +56,6 @@ SketcherGeneralWidget::SketcherGeneralWidget(QWidget *parent) this, SIGNAL(emitToggleAutoconstraints(int))); connect(ui->renderingOrder->model(), SIGNAL(layoutChanged()), this, SLOT(renderOrderChanged())); - connect(ui->checkBoxHideDrivenConstraints, SIGNAL(stateChanged(int)), - this, SLOT(constraintcheckboxes_stateChanged(int))); - connect(ui->checkBoxHideDrivingConstraints, SIGNAL(stateChanged(int)), - this, SLOT(constraintcheckboxes_stateChanged(int))); } SketcherGeneralWidget::~SketcherGeneralWidget() @@ -112,9 +108,6 @@ void SketcherGeneralWidget::loadSettings() newItem->setData(Qt::UserRole, QVariant(lowid)); newItem->setText(lowid==1?tr("Normal Geometry"):lowid==2?tr("Construction Geometry"):tr("External Geometry")); ui->renderingOrder->insertItem(2,newItem); - - ui->checkBoxHideDrivenConstraints->onRestore(); - ui->checkBoxHideDrivingConstraints->onRestore(); } void SketcherGeneralWidget::toggleGridView(bool on) @@ -162,14 +155,6 @@ void SketcherGeneralWidget::renderOrderChanged() emitrenderOrderChanged(); } -void SketcherGeneralWidget::constraintcheckboxes_stateChanged(int state) -{ - Q_UNUSED(state); - emithideconstraints(ui->checkBoxHideDrivingConstraints->isChecked(),ui->checkBoxHideDrivenConstraints->isChecked()); - ui->checkBoxHideDrivenConstraints->onSave(); - ui->checkBoxHideDrivingConstraints->onSave(); -} - // ---------------------------------------------------------------------------- TaskSketcherGeneral::TaskSketcherGeneral(ViewProviderSketch *sketchView) @@ -202,13 +187,9 @@ TaskSketcherGeneral::TaskSketcherGeneral(ViewProviderSketch *sketchView) QObject::connect( widget, SIGNAL(emitrenderOrderChanged()), - this , SLOT (renderOrderChanged()) + this , SLOT (renderOrderChanged()) ); - QObject::connect( - widget, SIGNAL(emithideconstraints(bool,bool)), - this , SLOT (hideconstraints(bool,bool)) - ); Gui::Selection().Attach(this); widget->loadSettings(); @@ -261,9 +242,4 @@ void TaskSketcherGeneral::renderOrderChanged() sketchView->updateColor(); } -void TaskSketcherGeneral::hideconstraints(bool hidedriving, bool hidedriven) -{ - sketchView->showConstraints(hidedriving,hidedriven); -} - #include "moc_TaskSketcherGeneral.cpp" diff --git a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h index 32a2c433ef..3aea413478 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h @@ -56,14 +56,12 @@ Q_SIGNALS: void emitSetGridSize(double); void emitToggleAutoconstraints(int); void emitrenderOrderChanged(); - void emithideconstraints(bool,bool); public Q_SLOTS: void toggleGridView(bool on); void setGridSize(double val); void toggleGridSnap(int state); void renderOrderChanged(); - void constraintcheckboxes_stateChanged(int state); protected: void changeEvent(QEvent *e); @@ -93,7 +91,6 @@ public Q_SLOTS: void toggleGridSnap(int state); void toggleAutoconstraints(int state); void renderOrderChanged(); - void hideconstraints(bool hidedriving, bool hidedriven); private: ViewProviderSketch *sketchView; diff --git a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.ui b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.ui index df9083b69f..3d149cf744 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.ui +++ b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.ui @@ -6,8 +6,8 @@ 0 0 - 229 - 284 + 194 + 228 @@ -80,32 +80,6 @@ - - - - Hide driving constraints - - - HideDrivingConstraints - - - Mod/Sketcher - - - - - - - Hide reference constraints - - - HideDrivenConstraints - - - Mod/Sketcher - - - @@ -134,11 +108,6 @@ QWidget
Gui/PrefWidgets.h
- - Gui::PrefCheckBox - QCheckBox -
Gui/PrefWidgets.h
-
diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index a51d084716..d8a49760d5 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -4797,8 +4797,8 @@ void ViewProviderSketch::rebuildConstraintsVisual(void) SoSwitch *drivingsw = new SoSwitch(); SoSwitch *drivensw = new SoSwitch(); - drivingsw->whichChild = hGrpp->GetBool("HideDrivingConstraints", false)?SO_SWITCH_NONE:SO_SWITCH_ALL; - drivensw->whichChild = hGrpp->GetBool("HideDrivenConstraints", false)?SO_SWITCH_NONE:SO_SWITCH_ALL; + drivingsw->whichChild = hGrpp->GetBool("DrivingConstraintsVisible", true)?SO_SWITCH_ALL:SO_SWITCH_NONE; + drivensw->whichChild = hGrpp->GetBool("DrivenConstraintsVisible", true)?SO_SWITCH_ALL:SO_SWITCH_NONE; drivingsw->ref(); drivensw->ref(); @@ -5890,19 +5890,9 @@ Base::Placement ViewProviderSketch::getPlacement() { return Plz; } -void ViewProviderSketch::showRestoreInformationLayer() -{ +void ViewProviderSketch::showRestoreInformationLayer() { visibleInformationChanged = true ; draw(false,false); } -void ViewProviderSketch::showConstraints(bool hidedriving, bool hidedriven) -{ - SoSwitch *drivingsw = static_cast(edit->constrGroup->getChild(0)); - SoSwitch *drivensw = static_cast(edit->constrGroup->getChild(1)); - - drivingsw->whichChild = hidedriving?SO_SWITCH_NONE:SO_SWITCH_ALL; - drivensw->whichChild = hidedriven?SO_SWITCH_NONE:SO_SWITCH_ALL; -} - diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index 7676d1f167..995bdc6186 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -125,9 +125,6 @@ public: /// Show/Hide nodes from information layer void showRestoreInformationLayer(); - /// Show/Hide constraints - void showConstraints(bool hidedriving = false, bool hidedriven = false); - /** @name handler control */ //@{ /// sets an DrawSketchHandler in control