added protocol settings pages and models for openvpn, cloak and shadowsocks

This commit is contained in:
vladimir.kuznetsov 2023-07-13 11:29:26 +09:00
parent a97417fd38
commit c13b9754eb
42 changed files with 2130 additions and 576 deletions

View file

@ -0,0 +1,39 @@
#ifndef SHADOWSOCKSCONFIGMODEL_H
#define SHADOWSOCKSCONFIGMODEL_H
#include <QAbstractListModel>
#include <QJsonObject>
#include "containers/containers_defs.h"
class ShadowSocksConfigModel : public QAbstractListModel
{
Q_OBJECT
public:
enum Roles {
PortRole = Qt::UserRole + 1,
CipherRole
};
explicit ShadowSocksConfigModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
public slots:
void updateModel(const QJsonObject &config);
QJsonObject getConfig();
protected:
QHash<int, QByteArray> roleNames() const override;
private:
DockerContainer m_container;
QJsonObject m_protocolConfig;
QJsonObject m_fullConfig;
};
#endif // SHADOWSOCKSCONFIGMODEL_H