added separation for read/write and readonly servers for pageSettingsServerProtocols, PageSettingsServerServices, PageSettingsServerData
- added fields validations for pageSetupWizardCredentials
This commit is contained in:
parent
249be451f7
commit
2ef53c6df9
22 changed files with 466 additions and 325 deletions
|
@ -1,14 +1,12 @@
|
|||
#include "ServerListLogic.h"
|
||||
|
||||
#include "vpnconnection.h"
|
||||
#include "../models/servers_model.h"
|
||||
#include "../uilogic.h"
|
||||
#include "vpnconnection.h"
|
||||
|
||||
ServerListLogic::ServerListLogic(UiLogic *logic, QObject *parent):
|
||||
PageLogicBase(logic, parent),
|
||||
m_serverListModel{new ServersModel(m_settings, this)}
|
||||
ServerListLogic::ServerListLogic(UiLogic *logic, QObject *parent)
|
||||
: PageLogicBase(logic, parent), m_serverListModel { new ServersModel(m_settings, this) }
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ServerListLogic::onServerListPushbuttonDefaultClicked(int index)
|
||||
|
@ -31,19 +29,19 @@ int ServerListLogic::currServerIdx() const
|
|||
|
||||
void ServerListLogic::onUpdatePage()
|
||||
{
|
||||
const QJsonArray &servers = m_settings->serversArray();
|
||||
int defaultServer = m_settings->defaultServerIndex();
|
||||
QVector<ServerModelContent> serverListContent;
|
||||
for(int i = 0; i < servers.size(); i++) {
|
||||
ServerModelContent c;
|
||||
auto server = servers.at(i).toObject();
|
||||
c.desc = server.value(config_key::description).toString();
|
||||
c.address = server.value(config_key::hostName).toString();
|
||||
if (c.desc.isEmpty()) {
|
||||
c.desc = c.address;
|
||||
}
|
||||
c.isDefault = (i == defaultServer);
|
||||
serverListContent.push_back(c);
|
||||
}
|
||||
// qobject_cast<ServersModel*>(m_serverListModel)->setContent(serverListContent);
|
||||
// const QJsonArray &servers = m_settings->serversArray();
|
||||
// int defaultServer = m_settings->defaultServerIndex();
|
||||
// QVector<ServerModelContent> serverListContent;
|
||||
// for(int i = 0; i < servers.size(); i++) {
|
||||
// ServerModelContent c;
|
||||
// auto server = servers.at(i).toObject();
|
||||
// c.desc = server.value(config_key::description).toString();
|
||||
// c.address = server.value(config_key::hostName).toString();
|
||||
// if (c.desc.isEmpty()) {
|
||||
// c.desc = c.address;
|
||||
// }
|
||||
// c.isDefault = (i == defaultServer);
|
||||
// serverListContent.push_back(c);
|
||||
// }
|
||||
// qobject_cast<ServersModel*>(m_serverListModel)->setContent(serverListContent);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue