Merge pull request #1440 from amnezia-vpn/feature/subscription-settings-page
feature/subscription settings page
This commit is contained in:
parent
7ccbfa48bc
commit
728b48044c
23 changed files with 466 additions and 81 deletions
52
client/ui/models/api/apiDevicesModel.h
Normal file
52
client/ui/models/api/apiDevicesModel.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
#ifndef APIDEVICESMODEL_H
|
||||
#define APIDEVICESMODEL_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QJsonArray>
|
||||
#include <QVector>
|
||||
|
||||
#include "settings.h"
|
||||
|
||||
class ApiDevicesModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Roles {
|
||||
OsVersionRole = Qt::UserRole + 1,
|
||||
SupportTagRole,
|
||||
CountryCodeRole,
|
||||
LastUpdateRole,
|
||||
IsCurrentDeviceRole
|
||||
};
|
||||
|
||||
explicit ApiDevicesModel(std::shared_ptr<Settings> settings, QObject *parent = nullptr);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
public slots:
|
||||
void updateModel(const QJsonArray &issuedConfigs);
|
||||
|
||||
protected:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
private:
|
||||
struct IssuedConfigInfo
|
||||
{
|
||||
QString installationUuid;
|
||||
QString workerLastUpdated;
|
||||
QString lastDownloaded;
|
||||
QString sourceType;
|
||||
QString osVersion;
|
||||
|
||||
QString countryName;
|
||||
QString countryCode;
|
||||
};
|
||||
|
||||
QVector<IssuedConfigInfo> m_issuedConfigs;
|
||||
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
};
|
||||
#endif // APIDEVICESMODEL_H
|
Loading…
Add table
Add a link
Reference in a new issue