ServerContainers qml ui started to fix

This commit is contained in:
Pokamest Nikak 2021-09-10 22:19:00 +03:00
parent 40fa2d6779
commit 542f363e92
17 changed files with 837 additions and 507 deletions

View file

@ -0,0 +1,41 @@
#ifndef PROTOCOLS_MODEL_H
#define PROTOCOLS_MODEL_H
#include <QAbstractListModel>
#include <QJsonObject>
#include <vector>
#include <utility>
#include "settings.h"
#include "containers/containers_defs.h"
class ProtocolsModel : public QAbstractListModel
{
Q_OBJECT
public:
ProtocolsModel(QObject *parent = nullptr);
public:
enum SiteRoles {
NameRole = Qt::UserRole + 1,
DescRole,
isVpnTypeRole,
isOtherTypeRole,
isInstalledRole
};
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
void setSelectedServerIndex(int index);
void setSelectedDockerContainer(DockerContainer c);
protected:
QHash<int, QByteArray> roleNames() const override;
private:
int m_selectedServerIndex;
DockerContainer m_selectedDockerContainer;
Settings m_settings;
};
#endif // PROTOCOLS_MODEL_H