Reworked the interaction between models. Now only serversModel directly interacts with server config
This commit is contained in:
parent
f3f98a50ed
commit
b4c89ad58f
19 changed files with 412 additions and 290 deletions
|
|
@ -26,13 +26,10 @@ ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &s
|
|||
void ConnectionController::openConnection()
|
||||
{
|
||||
int serverIndex = m_serversModel->getDefaultServerIndex();
|
||||
ServerCredentials credentials =
|
||||
qvariant_cast<ServerCredentials>(m_serversModel->data(serverIndex, ServersModel::Roles::CredentialsRole));
|
||||
ServerCredentials credentials = m_serversModel->getServerCredentials(serverIndex);
|
||||
|
||||
DockerContainer container = m_containersModel->getDefaultContainer();
|
||||
QModelIndex containerModelIndex = m_containersModel->index(container);
|
||||
const QJsonObject &containerConfig =
|
||||
qvariant_cast<QJsonObject>(m_containersModel->data(containerModelIndex, ContainersModel::Roles::ConfigRole));
|
||||
const QJsonObject &containerConfig = m_containersModel->getContainerConfig(container);
|
||||
|
||||
if (container == DockerContainer::None) {
|
||||
emit connectionErrorOccurred(tr("VPN Protocols is not installed.\n Please install VPN container at first"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue