diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/filterwidget2.cpp | 22 | ||||
-rw-r--r-- | desktop-widgets/filterwidget2.h | 6 | ||||
-rw-r--r-- | desktop-widgets/filterwidget2.ui | 260 |
3 files changed, 168 insertions, 120 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp index d120ffe4d..b2f74d742 100644 --- a/desktop-widgets/filterwidget2.cpp +++ b/desktop-widgets/filterwidget2.cpp @@ -18,6 +18,8 @@ FilterWidget2::FilterWidget2(QWidget* parent) ui->maxAirTemp->setValue(data.maxAirTemp); ui->minWaterTemp->setValue(data.minWaterTemp); ui->maxWaterTemp->setValue(data.maxWaterTemp); + ui->planned->setChecked(data.logged); + ui->planned->setChecked(data.planned); // TODO: unhide this when we discover how to search for equipment. ui->equipment->hide(); @@ -64,6 +66,11 @@ FilterWidget2::FilterWidget2(QWidget* parent) connect(ui->location, &QLineEdit::textChanged, this, &FilterWidget2::updateFilter); + + connect(ui->logged, SIGNAL(stateChanged(int)), this, SLOT(updateLogged(int))); + + connect(ui->planned, SIGNAL(stateChanged(int)), this, SLOT(updatePlanned(int))); + } void FilterWidget2::updateFilter() @@ -86,11 +93,26 @@ void FilterWidget2::updateFilter() data.location = ui->location->text().split(",", QString::SkipEmptyParts); data.equipment = ui->equipment->text().split(",", QString::SkipEmptyParts); data.invertFilter = ui->invertFilter->isChecked(); + data.logged = ui->logged->isChecked(); + data.planned = ui->planned->isChecked(); filterData = data; emit filterDataChanged(data); } +void FilterWidget2::updateLogged(int value) { + if (value == Qt::Unchecked) + ui->planned->setChecked(true); + updateFilter(); +} + +void FilterWidget2::updatePlanned(int value) { + if (value == Qt::Unchecked) + ui->logged->setChecked(true); + updateFilter(); +} + + void FilterWidget2::showEvent(QShowEvent *event) { QWidget::showEvent(event); diff --git a/desktop-widgets/filterwidget2.h b/desktop-widgets/filterwidget2.h index 80629f0cc..fba012095 100644 --- a/desktop-widgets/filterwidget2.h +++ b/desktop-widgets/filterwidget2.h @@ -27,6 +27,12 @@ protected: signals: void filterDataChanged(const FilterData& data); +public slots: + void updatePlanned(int value); + void updateLogged(int value); + + + private: std::unique_ptr<Ui::FilterWidget2> ui; FilterData filterData; diff --git a/desktop-widgets/filterwidget2.ui b/desktop-widgets/filterwidget2.ui index 978dafc6e..b8d5af48a 100644 --- a/desktop-widgets/filterwidget2.ui +++ b/desktop-widgets/filterwidget2.ui @@ -7,53 +7,34 @@ <x>0</x> <y>0</y> <width>510</width> - <height>320</height> + <height>349</height> </rect> </property> <property name="windowTitle"> <string>Form</string> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="3" column="1"> - <widget class="QLabel" name="label_12"> + <item row="8" column="1" colspan="4"> + <widget class="QLineEdit" name="tags"/> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="label_3"> <property name="text"> <string>Min</string> </property> </widget> </item> - <item row="2" column="4"> - <widget class="StarWidget" name="maxVisibility" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::TabFocus</enum> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QDoubleSpinBox" name="minWaterTemp"/> - </item> - <item row="2" column="2"> - <widget class="StarWidget" name="minVisibility" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::TabFocus</enum> + <item row="9" column="0"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>People</string> </property> </widget> </item> - <item row="7" column="0"> - <widget class="QLabel" name="label_7"> + <item row="3" column="3"> + <widget class="QLabel" name="label_13"> <property name="text"> - <string>Tags</string> + <string>Max</string> </property> </widget> </item> @@ -64,44 +45,17 @@ </property> </widget> </item> - <item row="1" column="2"> - <widget class="StarWidget" name="minRating" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::TabFocus</enum> - </property> - </widget> - </item> <item row="8" column="0"> - <widget class="QLabel" name="label_8"> - <property name="text"> - <string>People</string> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QLabel" name="label_13"> - <property name="text"> - <string>Max</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLabel" name="label_3"> + <widget class="QLabel" name="label_7"> <property name="text"> - <string>Min</string> + <string>Tags</string> </property> </widget> </item> - <item row="7" column="1" colspan="4"> - <widget class="QLineEdit" name="tags"/> + <item row="3" column="2"> + <widget class="QDoubleSpinBox" name="minWaterTemp"/> </item> - <item row="11" column="1" colspan="4"> + <item row="12" column="1" colspan="4"> <widget class="QCheckBox" name="invertFilter"> <property name="toolTip"> <string>Display dives that will not match the search, only applies to tags, people, location and equipment</string> @@ -118,32 +72,48 @@ </property> </widget> </item> - <item row="5" column="1" colspan="4"> - <widget class="QDateTimeEdit" name="from"/> + <item row="3" column="1"> + <widget class="QLabel" name="label_12"> + <property name="text"> + <string>Min</string> + </property> + </widget> </item> - <item row="8" column="1" colspan="4"> - <widget class="QLineEdit" name="people"/> + <item row="5" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>From</string> + </property> + </widget> </item> - <item row="1" column="4"> - <widget class="StarWidget" name="maxRating" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="6" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>To</string> </property> - <property name="focusPolicy"> - <enum>Qt::TabFocus</enum> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="label_17"> + <property name="text"> + <string>Min</string> </property> </widget> </item> <item row="3" column="4"> <widget class="QDoubleSpinBox" name="maxWaterTemp"/> </item> - <item row="10" column="0"> - <widget class="QLabel" name="labelEquipment"> + <item row="2" column="0"> + <widget class="QLabel" name="label_5"> <property name="text"> - <string>Equipment</string> + <string>Visibility</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="label_14"> + <property name="text"> + <string>Min</string> </property> </widget> </item> @@ -154,83 +124,133 @@ </property> </widget> </item> - <item row="9" column="0"> - <widget class="QLabel" name="label_9"> + <item row="10" column="1" colspan="4"> + <widget class="QLineEdit" name="location"/> + </item> + <item row="11" column="0"> + <widget class="QLabel" name="labelEquipment"> <property name="text"> - <string>Location</string> + <string>Equipment</string> </property> </widget> </item> - <item row="9" column="1" colspan="4"> - <widget class="QLineEdit" name="location"/> + <item row="4" column="2"> + <widget class="QDoubleSpinBox" name="minAirTemp"/> </item> - <item row="6" column="1" colspan="4"> - <widget class="QDateTimeEdit" name="to"/> + <item row="4" column="4"> + <widget class="QDoubleSpinBox" name="maxAirTemp"/> </item> - <item row="10" column="1" colspan="4"> + <item row="11" column="1" colspan="4"> <widget class="QLineEdit" name="equipment"/> </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_4"> + <item row="3" column="0"> + <widget class="QLabel" name="label_11"> <property name="text"> - <string>From</string> + <string>Water Temp</string> </property> </widget> </item> - <item row="6" column="0"> - <widget class="QLabel" name="label_6"> + <item row="9" column="1" colspan="4"> + <widget class="QLineEdit" name="people"/> + </item> + <item row="4" column="3"> + <widget class="QLabel" name="label_18"> <property name="text"> - <string>To</string> + <string>Max</string> </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_5"> + <item row="5" column="1" colspan="4"> + <widget class="QDateTimeEdit" name="from"/> + </item> + <item row="10" column="0"> + <widget class="QLabel" name="label_9"> <property name="text"> - <string>Visibility</string> + <string>Location</string> </property> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_11"> + <item row="6" column="1" colspan="4"> + <widget class="QDateTimeEdit" name="to"/> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_2"> <property name="text"> - <string>Water Temp</string> + <string>Air Temp</string> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLabel" name="label_14"> - <property name="text"> - <string>Min</string> + <item row="2" column="4"> + <widget class="StarWidget" name="maxVisibility" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> </property> </widget> </item> - <item row="4" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Air Temp</string> + <item row="2" column="2"> + <widget class="StarWidget" name="minVisibility" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> </property> </widget> </item> - <item row="4" column="1"> - <widget class="QLabel" name="label_17"> - <property name="text"> - <string>Min</string> + <item row="1" column="2"> + <widget class="StarWidget" name="minRating" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> </property> </widget> </item> - <item row="4" column="3"> - <widget class="QLabel" name="label_18"> - <property name="text"> - <string>Max</string> + <item row="1" column="4"> + <widget class="StarWidget" name="maxRating" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> </property> </widget> </item> - <item row="4" column="2"> - <widget class="QDoubleSpinBox" name="minAirTemp"/> + <item row="7" column="1"> + <widget class="QCheckBox" name="logged"> + <property name="text"> + <string>Logged</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> </item> - <item row="4" column="4"> - <widget class="QDoubleSpinBox" name="maxAirTemp"/> + <item row="7" column="2"> + <widget class="QCheckBox" name="planned"> + <property name="text"> + <string>Planned</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> </item> </layout> </widget> |