mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
b76f207158
Split out the actual filtering from the MultiFilterSortModel. Create a DiveFilter class that does the actual filtering. Currently, mobile and desktop have their own version of this class, though ultimately we may want to merge them. The idea here is that the trip-model and undo-commands have direct access to the filter-function and thus can take care of keeping track of the number of shown dives, etc. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
45 lines
808 B
C++
45 lines
808 B
C++
#ifndef FILTERWIDGET_2_H
|
|
#define FILTERWIDGET_2_H
|
|
|
|
#include <QWidget>
|
|
#include <QHideEvent>
|
|
#include <QShowEvent>
|
|
|
|
#include <memory>
|
|
|
|
#include "ui_filterwidget2.h"
|
|
#include "core/divefilter.h"
|
|
|
|
namespace Ui {
|
|
class FilterWidget2;
|
|
}
|
|
|
|
class FilterWidget2 : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit FilterWidget2(QWidget *parent = 0);
|
|
void updateFilter();
|
|
QString shownText();
|
|
|
|
protected:
|
|
void hideEvent(QHideEvent *event) override;
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
public slots:
|
|
void updatePlanned(int value);
|
|
void updateLogged(int value);
|
|
private slots:
|
|
void clearFilter();
|
|
void closeFilter();
|
|
void temperatureChanged();
|
|
|
|
private:
|
|
bool ignoreSignal;
|
|
bool isActive() const;
|
|
Ui::FilterWidget2 ui;
|
|
void filterDataChanged(const FilterData &data);
|
|
FilterData filterData;
|
|
};
|
|
|
|
#endif
|