Revert "Sketcher: Edit Controls' checkboxes to independently hide/show driving/non-driving constraints"

This reverts commit cfd217071bbe83a44b3601b3df294924a9f3dc8d.
This commit is contained in:
wmayer
2017-05-01 16:16:49 +02:00
parent 57cfa6d836
commit 2cb39de755
5 changed files with 6 additions and 77 deletions

View File

@@ -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"

View File

@@ -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;

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>229</width>
<height>284</height>
<width>194</width>
<height>228</height>
</rect>
</property>
<property name="windowTitle">
@@ -80,32 +80,6 @@
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxHideDrivingConstraints">
<property name="text">
<string>Hide driving constraints</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>HideDrivingConstraints</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxHideDrivenConstraints">
<property name="text">
<string>Hide reference constraints</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>HideDrivenConstraints</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
@@ -134,11 +108,6 @@
<extends>QWidget</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@@ -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<SoSwitch *>(edit->constrGroup->getChild(0));
SoSwitch *drivensw = static_cast<SoSwitch *>(edit->constrGroup->getChild(1));
drivingsw->whichChild = hidedriving?SO_SWITCH_NONE:SO_SWITCH_ALL;
drivensw->whichChild = hidedriven?SO_SWITCH_NONE:SO_SWITCH_ALL;
}

View File

@@ -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