diff options
Diffstat (limited to 'desktop-widgets/filterwidget2.cpp')
-rw-r--r-- | desktop-widgets/filterwidget2.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp index 9eb4f733b..028f774f1 100644 --- a/desktop-widgets/filterwidget2.cpp +++ b/desktop-widgets/filterwidget2.cpp @@ -96,6 +96,10 @@ FilterWidget2::FilterWidget2(QWidget* parent) : QWidget(parent) // Update temperature fields if user changes temperature-units in preferences. connect(qPrefUnits::instance(), &qPrefUnits::temperatureChanged, this, &FilterWidget2::temperatureChanged); connect(qPrefUnits::instance(), &qPrefUnits::unit_systemChanged, this, &FilterWidget2::temperatureChanged); + + // Update counts if dives were added / removed + connect(MultiFilterSortModel::instance(), &MultiFilterSortModel::countsChanged, + this, &FilterWidget2::countsChanged); } void FilterWidget2::temperatureChanged() @@ -161,7 +165,11 @@ void FilterWidget2::hideEvent(QHideEvent *event) void FilterWidget2::filterDataChanged(const FilterData &data) { MultiFilterSortModel::instance()->filterDataChanged(data); + countsChanged(); +} +void FilterWidget2::countsChanged() +{ ui.filterText->setText(tr("%L1/%L2 shown").arg(MultiFilterSortModel::instance()->divesDisplayed) .arg(dive_table.nr)); } |