subsurface/desktop-widgets/divecomputermanagementdialog.h
Berthold Stoeger 215e5a4544 desktop: make divecomputer table sortable
Add a small proxy-model on top of DiveComputerModel so that clicking
on table headers makes the table sortable.

The UI feature here is not as important as the fact that the UI does
its own sorting and we can keep the device-table in the core sorted
differently.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-11 08:35:20 -07:00

32 lines
743 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef DIVECOMPUTERMANAGEMENTDIALOG_H
#define DIVECOMPUTERMANAGEMENTDIALOG_H
#include "ui_divecomputermanagementdialog.h"
#include "qt-models/divecomputermodel.h"
#include <QDialog>
#include <memory>
class QModelIndex;
class DiveComputerManagementDialog : public QDialog {
Q_OBJECT
public:
static DiveComputerManagementDialog *instance();
void init();
public
slots:
void tryRemove(const QModelIndex &index);
void accept();
void reject();
private:
explicit DiveComputerManagementDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
Ui::DiveComputerManagementDialog ui;
std::unique_ptr<DiveComputerModel> model;
DiveComputerSortedModel proxyModel;
};
#endif // DIVECOMPUTERMANAGEMENTDIALOG_H