Files
amnezia-client/client/ui/models/containers_model.h
T

40 lines
869 B
C++
Raw Normal View History

2021-09-10 22:19:00 +03:00
#ifndef CONTAINERS_MODEL_H
#define CONTAINERS_MODEL_H
2021-09-09 20:15:44 +03:00
#include <QAbstractListModel>
#include <QJsonObject>
#include <vector>
#include <utility>
2021-09-10 22:19:00 +03:00
#include "settings.h"
2021-09-09 20:15:44 +03:00
#include "containers/containers_defs.h"
2021-09-10 22:19:00 +03:00
class ContainersModel : public QAbstractListModel
2021-09-09 20:15:44 +03:00
{
Q_OBJECT
public:
2021-09-10 22:19:00 +03:00
ContainersModel(QObject *parent = nullptr);
2021-09-09 20:15:44 +03:00
public:
enum SiteRoles {
NameRole = Qt::UserRole + 1,
DescRole,
2021-09-10 22:19:00 +03:00
isVpnTypeRole,
isOtherTypeRole,
isInstalledRole
2021-09-09 20:15:44 +03:00
};
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
2021-09-10 22:19:00 +03:00
void setSelectedServerIndex(int index);
2021-09-09 20:15:44 +03:00
protected:
QHash<int, QByteArray> roleNames() const override;
private:
2021-09-10 22:19:00 +03:00
int m_selectedServerIndex;
Settings m_settings;
2021-09-09 20:15:44 +03:00
};
2021-09-10 22:19:00 +03:00
#endif // CONTAINERS_MODEL_H