Sketcher: Redesign of Constraint settings
========================================= => The old controltab is substituted by: direct controls (buttons on the constraint widget) and a settings dialog that is independently fired via a button with a settings icon This makes more space for the list of constraints and generates a lower amount of confussion regarding the old tab names and functions. Direct control ensures that the most used operations are at hand, while other less changed settings are moved to the settings dialog. => Direct controls One time visibility to match the list selection can be triggered from a new button "Visibility" This button has drop selections for visibility selections, which are checkable items (currently only one option, but more are envisaged). The one option currently is the "visibility tracking" functionality. This is a "shortcut" to the option in the settings panel to save unnecessary clicks in typical operations. => Settings dialog This dialog is live, in that changes to settings are immediatedly propagated to the list control and visibility.
This commit is contained in:
@@ -47,6 +47,7 @@ set(SketcherGui_UIC_SRCS
|
||||
SketchRectangularArrayDialog.ui
|
||||
SketcherRegularPolygonDialog.ui
|
||||
ConstraintMultiFilterDialog.ui
|
||||
ConstraintSettingsDialog.ui
|
||||
)
|
||||
|
||||
if(BUILD_QT5)
|
||||
@@ -120,6 +121,8 @@ SET(SketcherGui_SRCS
|
||||
SketcherRegularPolygonDialog.cpp
|
||||
ConstraintMultiFilterDialog.h
|
||||
ConstraintMultiFilterDialog.cpp
|
||||
ConstraintSettingsDialog.h
|
||||
ConstraintSettingsDialog.cpp
|
||||
TaskDlgEditSketch.cpp
|
||||
TaskDlgEditSketch.h
|
||||
ViewProviderPython.cpp
|
||||
|
||||
136
src/Mod/Sketcher/Gui/ConstraintSettingsDialog.cpp
Normal file
136
src/Mod/Sketcher/Gui/ConstraintSettingsDialog.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2021 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <QPixmap>
|
||||
# include <QDialog>
|
||||
#endif
|
||||
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
#include "ui_ConstraintSettingsDialog.h"
|
||||
#include "ConstraintSettingsDialog.h"
|
||||
|
||||
using namespace SketcherGui;
|
||||
|
||||
ConstraintSettingsDialog::ConstraintSettingsDialog(void)
|
||||
: QDialog(Gui::getMainWindow()), ui(new Ui_ConstraintSettingsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
{ // in case any signal is connected before this
|
||||
QSignalBlocker block(this);
|
||||
loadSettings();
|
||||
snapshotInitialSettings();
|
||||
}
|
||||
|
||||
QObject::connect(
|
||||
ui->filterInternalAlignment, SIGNAL(stateChanged(int)),
|
||||
this , SLOT (on_filterInternalAlignment_stateChanged(int))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->extendedInformation, SIGNAL(stateChanged(int)),
|
||||
this , SLOT (on_extendedInformation_stateChanged(int))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->visualisationTrackingFilter, SIGNAL(stateChanged(int)),
|
||||
this , SLOT (on_visualisationTrackingFilter_stateChanged(int))
|
||||
);
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::saveSettings()
|
||||
{
|
||||
ui->extendedInformation->onSave();
|
||||
ui->filterInternalAlignment->onSave();
|
||||
ui->visualisationTrackingFilter->onSave();
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::loadSettings()
|
||||
{
|
||||
ui->extendedInformation->onRestore();
|
||||
ui->filterInternalAlignment->onRestore();
|
||||
ui->visualisationTrackingFilter->onRestore();
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::snapshotInitialSettings()
|
||||
{
|
||||
auto isChecked = [] (auto prefwidget) {return prefwidget->checkState() == Qt::Checked;};
|
||||
|
||||
extendedInformation = isChecked(ui->extendedInformation);
|
||||
filterInternalAlignment = isChecked(ui->filterInternalAlignment);
|
||||
visualisationTrackingFilter = isChecked(ui->visualisationTrackingFilter);
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::restoreInitialSettings()
|
||||
{
|
||||
auto restoreCheck = [] (auto prefwidget, bool initialvalue) {
|
||||
if( initialvalue != (prefwidget->checkState() == Qt::Checked)) // if the state really changed
|
||||
initialvalue ? prefwidget->setCheckState(Qt::Checked) : prefwidget->setCheckState(Qt::Unchecked);
|
||||
};
|
||||
|
||||
restoreCheck(ui->extendedInformation, extendedInformation);
|
||||
restoreCheck(ui->filterInternalAlignment, filterInternalAlignment);
|
||||
restoreCheck(ui->visualisationTrackingFilter, visualisationTrackingFilter);
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::accept()
|
||||
{
|
||||
saveSettings();
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::reject()
|
||||
{
|
||||
restoreInitialSettings();
|
||||
saveSettings();
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::on_filterInternalAlignment_stateChanged(int state)
|
||||
{
|
||||
ui->filterInternalAlignment->onSave();
|
||||
Q_EMIT emit_filterInternalAlignment_stateChanged(state);
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::on_visualisationTrackingFilter_stateChanged(int state)
|
||||
{
|
||||
ui->visualisationTrackingFilter->onSave();
|
||||
Q_EMIT emit_visualisationTrackingFilter_stateChanged(state);
|
||||
}
|
||||
|
||||
void ConstraintSettingsDialog::on_extendedInformation_stateChanged(int state)
|
||||
{
|
||||
ui->extendedInformation->onSave();
|
||||
Q_EMIT emit_extendedInformation_stateChanged(state);
|
||||
}
|
||||
|
||||
ConstraintSettingsDialog::~ConstraintSettingsDialog()
|
||||
{
|
||||
}
|
||||
|
||||
#include "moc_ConstraintSettingsDialog.cpp"
|
||||
70
src/Mod/Sketcher/Gui/ConstraintSettingsDialog.h
Normal file
70
src/Mod/Sketcher/Gui/ConstraintSettingsDialog.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2021 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SKETCHERGUI_ConstraintSettingsDialog_H
|
||||
#define SKETCHERGUI_ConstraintSettingsDialog_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "ConstraintFilters.h"
|
||||
|
||||
namespace SketcherGui {
|
||||
|
||||
using namespace ConstraintFilter;
|
||||
|
||||
class Ui_ConstraintSettingsDialog;
|
||||
class ConstraintSettingsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConstraintSettingsDialog(void);
|
||||
~ConstraintSettingsDialog();
|
||||
|
||||
Q_SIGNALS:
|
||||
void emit_filterInternalAlignment_stateChanged(int);
|
||||
void emit_extendedInformation_stateChanged(int);
|
||||
void emit_visualisationTrackingFilter_stateChanged(int);
|
||||
|
||||
public Q_SLOTS:
|
||||
void accept();
|
||||
void reject();
|
||||
void on_filterInternalAlignment_stateChanged(int state);
|
||||
void on_extendedInformation_stateChanged(int state);
|
||||
void on_visualisationTrackingFilter_stateChanged(int state);
|
||||
|
||||
private:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void snapshotInitialSettings();
|
||||
void restoreInitialSettings();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_ConstraintSettingsDialog> ui;
|
||||
bool extendedInformation;
|
||||
bool filterInternalAlignment;
|
||||
bool visualisationTrackingFilter;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // SKETCHERGUI_ConstraintSettingsDialog_H
|
||||
195
src/Mod/Sketcher/Gui/ConstraintSettingsDialog.ui
Normal file
195
src/Mod/Sketcher/Gui/ConstraintSettingsDialog.ui
Normal file
@@ -0,0 +1,195 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SketcherGui::ConstraintSettingsDialog</class>
|
||||
<widget class="QWidget" name="SketcherGui::ConstraintSettingsDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::WindowModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>275</width>
|
||||
<height>215</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Constraint widget settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>List control</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="1" column="0">
|
||||
<widget class="Gui::PrefCheckBox" name="filterInternalAlignment">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Internal alignments will be hidden</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide internal alignment</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>HideInternalAlignment</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="Gui::PrefCheckBox" name="extendedInformation">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Extended information will be added to the list</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Extended information</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ExtendedConstraintInformation</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>3D view control</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="Gui::PrefCheckBox" name="visualisationTrackingFilter">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Constraint visualisation tracks filter selection so that filtered out constraints are hidden</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show only filtered constraints</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>VisualisationTrackingFilter</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item alignment="Qt::AlignHCenter">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SketcherGui::ConstraintSettingsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SketcherGui::ConstraintSettingsDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -58,6 +58,7 @@
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
#include "ConstraintMultiFilterDialog.h"
|
||||
#include "ConstraintSettingsDialog.h"
|
||||
|
||||
using namespace SketcherGui;
|
||||
using namespace Gui::TaskView;
|
||||
@@ -642,6 +643,8 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) :
|
||||
ui->listWidgetConstraints->setEditTriggers(QListWidget::EditKeyPressed);
|
||||
//QMetaObject::connectSlotsByName(this);
|
||||
|
||||
createVisibilityButtonActions();
|
||||
|
||||
// connecting the needed signals
|
||||
QObject::connect(
|
||||
ui->comboBoxFilter, SIGNAL(currentIndexChanged(int)),
|
||||
@@ -671,14 +674,6 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) :
|
||||
ui->listWidgetConstraints, SIGNAL(onUpdateActiveStatus(QListWidgetItem *, bool)),
|
||||
this , SLOT (on_listWidgetConstraints_updateActiveStatus(QListWidgetItem *, bool))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->filterInternalAlignment, SIGNAL(stateChanged(int)),
|
||||
this , SLOT (on_filterInternalAlignment_stateChanged(int))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->extendedInformation, SIGNAL(stateChanged(int)),
|
||||
this , SLOT (on_extendedInformation_stateChanged(int))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->showAllButton, SIGNAL(clicked(bool)),
|
||||
this , SLOT (on_showAllButton_clicked(bool))
|
||||
@@ -695,23 +690,29 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) :
|
||||
ui->listWidgetConstraints, SIGNAL(emitShowSelection3DVisibility()),
|
||||
this , SLOT (on_listWidgetConstraints_emitShowSelection3DVisibility())
|
||||
);
|
||||
QObject::connect(
|
||||
ui->visualisationTrackingFilter, SIGNAL(stateChanged(int)),
|
||||
this , SLOT (on_visualisationTrackingFilter_stateChanged(int))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->multipleFilterButton, SIGNAL(clicked(bool)),
|
||||
this , SLOT (on_multipleFilterButton_clicked(bool))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->settingsDialogButton, SIGNAL(clicked(bool)),
|
||||
this , SLOT (on_settingsDialogButton_clicked(bool))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->visibilityButton, SIGNAL(clicked(bool)),
|
||||
this , SLOT (on_visibilityButton_clicked(bool))
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
ui->visibilityButton->actions()[0], SIGNAL(changed()),
|
||||
this , SLOT (on_visibilityButton_trackingaction_changed())
|
||||
);
|
||||
|
||||
connectionConstraintsChanged = sketchView->signalConstraintsChanged.connect(
|
||||
boost::bind(&SketcherGui::TaskSketcherConstrains::slotConstraintsChanged, this));
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
this->ui->filterInternalAlignment->onRestore();
|
||||
this->ui->extendedInformation->onRestore();
|
||||
|
||||
multiFilterStatus.set(); // Match 'All' selection, all bits set.
|
||||
|
||||
slotConstraintsChanged();
|
||||
@@ -719,11 +720,27 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) :
|
||||
|
||||
TaskSketcherConstrains::~TaskSketcherConstrains()
|
||||
{
|
||||
this->ui->filterInternalAlignment->onSave();
|
||||
this->ui->extendedInformation->onSave();
|
||||
connectionConstraintsChanged.disconnect();
|
||||
}
|
||||
|
||||
|
||||
void TaskSketcherConstrains::createVisibilityButtonActions()
|
||||
{
|
||||
QAction* action = new QAction(QString::fromLatin1("Show only filtered Constraints"),this);
|
||||
|
||||
action->setCheckable(true);
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
|
||||
bool visibilityTracksFilter = hGrp->GetBool("VisualisationTrackingFilter",false);
|
||||
|
||||
{
|
||||
QSignalBlocker block(this);
|
||||
action->setChecked(visibilityTracksFilter);
|
||||
}
|
||||
|
||||
ui->visibilityButton->addAction(action);
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::updateSelectionFilter()
|
||||
{
|
||||
// Snapshot current selection
|
||||
@@ -738,7 +755,8 @@ void TaskSketcherConstrains::updateSelectionFilter()
|
||||
void TaskSketcherConstrains::updateList()
|
||||
{
|
||||
// enforce constraint visibility
|
||||
bool visibilityTracksFilter = ui->visualisationTrackingFilter->isChecked();
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
|
||||
bool visibilityTracksFilter = hGrp->GetBool("VisualisationTrackingFilter",false);
|
||||
|
||||
if(visibilityTracksFilter)
|
||||
change3DViewVisibilityToTrackFilter(); // it will call slotConstraintChanged via update mechanism
|
||||
@@ -766,6 +784,26 @@ void TaskSketcherConstrains::on_multipleFilterButton_clicked(bool)
|
||||
}
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::on_settingsDialogButton_clicked(bool)
|
||||
{
|
||||
ConstraintSettingsDialog cs;
|
||||
|
||||
QObject::connect(
|
||||
&cs, SIGNAL(emit_filterInternalAlignment_stateChanged(int)),
|
||||
this , SLOT (on_filterInternalAlignment_stateChanged(int))
|
||||
);
|
||||
QObject::connect(
|
||||
&cs, SIGNAL(emit_extendedInformation_stateChanged(int)),
|
||||
this , SLOT (on_extendedInformation_stateChanged(int))
|
||||
);
|
||||
QObject::connect(
|
||||
&cs, SIGNAL(emit_visualisationTrackingFilter_stateChanged(int)),
|
||||
this , SLOT (on_visualisationTrackingFilter_stateChanged(int))
|
||||
);
|
||||
|
||||
cs.exec(); // The dialog reacted on any change, so the result of running the dialog is already reflected on return.
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::changeFilteredVisibility(bool show, ActionTarget target)
|
||||
{
|
||||
assert(sketchView);
|
||||
@@ -934,14 +972,43 @@ void TaskSketcherConstrains::on_filterInternalAlignment_stateChanged(int state)
|
||||
|
||||
void TaskSketcherConstrains::on_visualisationTrackingFilter_stateChanged(int state)
|
||||
{
|
||||
if(state)
|
||||
// Synchronise button drop state
|
||||
{
|
||||
QSignalBlocker block(this);
|
||||
|
||||
if(ui->visibilityButton->actions()[0]->isChecked() != (state == Qt::Checked))
|
||||
ui->visibilityButton->actions()[0]->setChecked(state);
|
||||
}
|
||||
|
||||
if(state == Qt::Checked)
|
||||
change3DViewVisibilityToTrackFilter();
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::on_visibilityButton_trackingaction_changed()
|
||||
{
|
||||
// synchronise VisualisationTrackingFilter parameter
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
|
||||
bool visibilityTracksFilter = hGrp->GetBool("VisualisationTrackingFilter",false);
|
||||
|
||||
bool bstate = ui->visibilityButton->actions()[0]->isChecked();
|
||||
|
||||
if(visibilityTracksFilter != bstate) {
|
||||
hGrp->SetBool("VisualisationTrackingFilter", bstate);
|
||||
}
|
||||
|
||||
// Act
|
||||
if(bstate)
|
||||
change3DViewVisibilityToTrackFilter();
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::on_visibilityButton_clicked(bool)
|
||||
{
|
||||
change3DViewVisibilityToTrackFilter();
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::on_extendedInformation_stateChanged(int state)
|
||||
{
|
||||
Q_UNUSED(state);
|
||||
this->ui->extendedInformation->onSave();
|
||||
slotConstraintsChanged();
|
||||
}
|
||||
|
||||
@@ -1150,7 +1217,9 @@ bool TaskSketcherConstrains::isConstraintFiltered(QListWidgetItem * item)
|
||||
const Sketcher::Constraint * constraint = vals[it->ConstraintNbr];
|
||||
|
||||
int Filter = ui->comboBoxFilter->currentIndex();
|
||||
bool hideInternalAlignment = this->ui->filterInternalAlignment->isChecked();
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
|
||||
bool hideInternalAlignment = hGrp->GetBool("HideInternalAlignment",false);
|
||||
|
||||
bool visible = true;
|
||||
bool showAll = (Filter == FilterValue::All);
|
||||
|
||||
@@ -94,6 +94,7 @@ private:
|
||||
void changeFilteredVisibility(bool show, ActionTarget target = ActionTarget::All);
|
||||
void updateSelectionFilter();
|
||||
void updateList();
|
||||
void createVisibilityButtonActions();
|
||||
|
||||
template <class T>
|
||||
bool isFilter(T filterValue);
|
||||
@@ -109,11 +110,14 @@ public Q_SLOTS:
|
||||
void on_filterInternalAlignment_stateChanged(int state);
|
||||
void on_extendedInformation_stateChanged(int state);
|
||||
void on_visualisationTrackingFilter_stateChanged(int state);
|
||||
void on_visibilityButton_trackingaction_changed();
|
||||
void on_visibilityButton_clicked(bool);
|
||||
void on_showAllButton_clicked(bool);
|
||||
void on_hideAllButton_clicked(bool);
|
||||
void on_listWidgetConstraints_emitShowSelection3DVisibility();
|
||||
void on_listWidgetConstraints_emitHideSelection3DVisibility();
|
||||
void on_multipleFilterButton_clicked(bool);
|
||||
void on_settingsDialogButton_clicked(bool);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>357</width>
|
||||
<width>405</width>
|
||||
<height>388</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -30,6 +30,12 @@
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Filter:</string>
|
||||
</property>
|
||||
@@ -37,6 +43,12 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBoxFilter">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -194,49 +206,34 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settingsDialogButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/Sketcher.qrc">
|
||||
<normaloff>:/icons/dialogs/Sketcher_Settings.svg</normaloff>:/icons/dialogs/Sketcher_Settings.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>95</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="visualisationTab">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>View</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="showAllButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>135</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -248,17 +245,11 @@
|
||||
<string>Show Listed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="hideAllButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>10</y>
|
||||
<width>135</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -270,132 +261,39 @@
|
||||
<string>Hide Listed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="automationTab">
|
||||
<property name="toolTip">
|
||||
<string>Controls visualisation in the 3D view</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Automation</string>
|
||||
</attribute>
|
||||
<widget class="Gui::PrefCheckBox" name="visualisationTrackingFilter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>271</width>
|
||||
<height>36</height>
|
||||
</rect>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="visibilityButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Constraint visualisation tracks filter selection so that filtered out constraints are hidden</string>
|
||||
<string>Restricts 3D visibility to the listed elements</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show only filtered constraints</string>
|
||||
<string>Restrict Visibility</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::MenuButtonPopup</enum>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>VisualisationTrackingFilter</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher</cstring>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextOnly</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="controlTab">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Controls widget list behaviour</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>List</string>
|
||||
</attribute>
|
||||
<widget class="Gui::PrefCheckBox" name="extendedInformation">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>30</y>
|
||||
<width>189</width>
|
||||
<height>36</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Extended information will be added to the list</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Extended information</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ExtendedConstraintInformation</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Gui::PrefCheckBox" name="filterInternalAlignment">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>189</width>
|
||||
<height>36</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Internal alignments will be hidden</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide internal alignment</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>HideInternalAlignment</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ConstraintView" name="listWidgetConstraints">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="modelColumn">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -404,17 +302,14 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConstraintView</class>
|
||||
<extends>QListWidget</extends>
|
||||
<header location="global">QListWidget</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="Resources/Sketcher.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user