mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
added saving the selected server and protocol to the config
This commit is contained in:
@@ -15,24 +15,27 @@ class ServersModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ServersModel(std::shared_ptr<Settings> settings, QObject *parent = nullptr);
|
||||
public:
|
||||
enum SiteRoles {
|
||||
enum ServersModelRoles {
|
||||
DescRole = Qt::UserRole + 1,
|
||||
AddressRole,
|
||||
IsDefaultRole
|
||||
};
|
||||
|
||||
void refresh();
|
||||
ServersModel(std::shared_ptr<Settings> settings, QObject *parent = nullptr);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
public slots:
|
||||
void setDefaultServerIndex(int index);
|
||||
int getDefaultServerIndex();
|
||||
|
||||
protected:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
private:
|
||||
QVector<ServerModelContent> m_data;
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user