2019-03-09 21:32:16 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef TAB_DIVE_SITE_H
|
|
|
|
#define TAB_DIVE_SITE_H
|
|
|
|
|
|
|
|
#include "TabBase.h"
|
|
|
|
#include "ui_TabDiveSite.h"
|
2019-03-12 16:28:43 +00:00
|
|
|
#include "qt-models/divelocationmodel.h"
|
2019-03-09 21:32:16 +00:00
|
|
|
|
|
|
|
class TabDiveSite : public TabBase {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
TabDiveSite(QWidget *parent = 0);
|
|
|
|
void updateData() override;
|
|
|
|
void clear() override;
|
2019-03-13 19:58:25 +00:00
|
|
|
private slots:
|
|
|
|
void add();
|
2019-03-13 20:36:31 +00:00
|
|
|
void diveSiteAdded(struct dive_site *, int idx);
|
2019-03-13 20:56:41 +00:00
|
|
|
void diveSiteChanged(struct dive_site *ds, int field);
|
2019-03-19 18:52:54 +00:00
|
|
|
void on_purgeUnused_clicked();
|
2019-03-24 16:11:29 +00:00
|
|
|
void on_filterText_textChanged(const QString &text);
|
2019-04-12 14:12:15 +00:00
|
|
|
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
2019-03-09 21:32:16 +00:00
|
|
|
private:
|
|
|
|
Ui::TabDiveSite ui;
|
2019-03-12 16:28:43 +00:00
|
|
|
DiveSiteSortedModel model;
|
2019-05-05 10:18:04 +00:00
|
|
|
QVector<dive_site *> selectedDiveSites();
|
2019-04-12 14:12:15 +00:00
|
|
|
void updateFilter();
|
|
|
|
void hideEvent(QHideEvent *) override;
|
|
|
|
void showEvent(QShowEvent *) override;
|
2019-03-09 21:32:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|