mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-24 03:46:01 +03:00
Compare commits
1 Commits
improve_na
...
refactorin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca70a43d01 |
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -32,8 +32,6 @@ public slots:
|
||||
QString getLastConnectionError();
|
||||
void onConnectionStateChanged(Vpn::ConnectionState state);
|
||||
|
||||
void onCurrentContainerUpdated();
|
||||
|
||||
void onTranslationsUpdated();
|
||||
|
||||
signals:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user