Compare commits

...

1 Commits

Author SHA1 Message Date
vladimir.kuznetsov
ca70a43d01 Removed the ability to change protocol settings when the connection is active 2023-12-18 11:59:18 +07:00
9 changed files with 25 additions and 23 deletions

View File

@@ -350,8 +350,6 @@ void AmneziaApplication::initControllers()
&PageController::showPassphraseRequestDrawer);
connect(m_pageController.get(), &PageController::passphraseRequestDrawerClosed, m_installController.get(),
&InstallController::setEncryptedPassphrase);
connect(m_installController.get(), &InstallController::currentContainerUpdated, m_connectionController.get(),
&ConnectionController::onCurrentContainerUpdated);
m_importController.reset(new ImportController(m_serversModel, m_containersModel, m_settings));
m_engine->rootContext()->setContextProperty("ImportController", m_importController.get());

View File

@@ -103,16 +103,6 @@ void ConnectionController::onConnectionStateChanged(Vpn::ConnectionState state)
emit connectionStateChanged();
}
void ConnectionController::onCurrentContainerUpdated()
{
if (m_isConnected || m_isConnectionInProgress) {
emit reconnectWithUpdatedContainer(tr("Settings updated successfully, Reconnnection..."));
openConnection();
} else {
emit reconnectWithUpdatedContainer(tr("Settings updated successfully"));
}
}
void ConnectionController::onTranslationsUpdated()
{
// get translated text of current state

View File

@@ -32,8 +32,6 @@ public slots:
QString getLastConnectionError();
void onConnectionStateChanged(Vpn::ConnectionState state);
void onCurrentContainerUpdated();
void onTranslationsUpdated();
signals:

View File

@@ -283,12 +283,7 @@ void InstallController::updateContainer(QJsonObject config)
m_serversModel->updateContainerConfig(container, config);
m_protocolModel->updateModel(config);
if ((serverIndex == m_serversModel->getDefaultServerIndex())
&& (container == m_containersModel->getDefaultContainer())) {
emit currentContainerUpdated();
} else {
emit updateContainerFinished(tr("Settings updated successfully"));
}
emit updateContainerFinished(tr("Settings updated successfully"));
return;
}

View File

@@ -67,8 +67,6 @@ signals:
void serverIsBusy(const bool isBusy);
void cancelInstallation();
void currentContainerUpdated();
private:
void installServer(DockerContainer container, QJsonObject &config);
void installContainer(DockerContainer container, QJsonObject &config);

View File

@@ -105,7 +105,6 @@ PageType {
textField.validator: IntValidator { bottom: 0 }
textField.onEditingFinished: {
console.log("1")
if (textFieldText === "") {
textFieldText = "0"
}
@@ -312,6 +311,12 @@ PageType {
onClicked: {
forceActiveFocus()
if (ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(AwgConfigModel.getConfig())
}

View File

@@ -162,6 +162,12 @@ PageType {
onClicked: {
forceActiveFocus()
if (ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(CloakConfigModel.getConfig())
}

View File

@@ -390,6 +390,12 @@ PageType {
onClicked: {
forceActiveFocus()
if (ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(OpenVpnConfigModel.getConfig())
}

View File

@@ -140,6 +140,12 @@ PageType {
onClicked: {
forceActiveFocus()
if (ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
return
}
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
InstallController.updateContainer(ShadowSocksConfigModel.getConfig())
}