mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca70a43d01 |
@@ -350,8 +350,6 @@ void AmneziaApplication::initControllers()
|
|||||||
&PageController::showPassphraseRequestDrawer);
|
&PageController::showPassphraseRequestDrawer);
|
||||||
connect(m_pageController.get(), &PageController::passphraseRequestDrawerClosed, m_installController.get(),
|
connect(m_pageController.get(), &PageController::passphraseRequestDrawerClosed, m_installController.get(),
|
||||||
&InstallController::setEncryptedPassphrase);
|
&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_importController.reset(new ImportController(m_serversModel, m_containersModel, m_settings));
|
||||||
m_engine->rootContext()->setContextProperty("ImportController", m_importController.get());
|
m_engine->rootContext()->setContextProperty("ImportController", m_importController.get());
|
||||||
|
|||||||
@@ -103,16 +103,6 @@ void ConnectionController::onConnectionStateChanged(Vpn::ConnectionState state)
|
|||||||
emit connectionStateChanged();
|
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()
|
void ConnectionController::onTranslationsUpdated()
|
||||||
{
|
{
|
||||||
// get translated text of current state
|
// get translated text of current state
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ public slots:
|
|||||||
QString getLastConnectionError();
|
QString getLastConnectionError();
|
||||||
void onConnectionStateChanged(Vpn::ConnectionState state);
|
void onConnectionStateChanged(Vpn::ConnectionState state);
|
||||||
|
|
||||||
void onCurrentContainerUpdated();
|
|
||||||
|
|
||||||
void onTranslationsUpdated();
|
void onTranslationsUpdated();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
@@ -283,12 +283,7 @@ void InstallController::updateContainer(QJsonObject config)
|
|||||||
m_serversModel->updateContainerConfig(container, config);
|
m_serversModel->updateContainerConfig(container, config);
|
||||||
m_protocolModel->updateModel(config);
|
m_protocolModel->updateModel(config);
|
||||||
|
|
||||||
if ((serverIndex == m_serversModel->getDefaultServerIndex())
|
emit updateContainerFinished(tr("Settings updated successfully"));
|
||||||
&& (container == m_containersModel->getDefaultContainer())) {
|
|
||||||
emit currentContainerUpdated();
|
|
||||||
} else {
|
|
||||||
emit updateContainerFinished(tr("Settings updated successfully"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ signals:
|
|||||||
void serverIsBusy(const bool isBusy);
|
void serverIsBusy(const bool isBusy);
|
||||||
void cancelInstallation();
|
void cancelInstallation();
|
||||||
|
|
||||||
void currentContainerUpdated();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void installServer(DockerContainer container, QJsonObject &config);
|
void installServer(DockerContainer container, QJsonObject &config);
|
||||||
void installContainer(DockerContainer container, QJsonObject &config);
|
void installContainer(DockerContainer container, QJsonObject &config);
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ PageType {
|
|||||||
textField.validator: IntValidator { bottom: 0 }
|
textField.validator: IntValidator { bottom: 0 }
|
||||||
|
|
||||||
textField.onEditingFinished: {
|
textField.onEditingFinished: {
|
||||||
console.log("1")
|
|
||||||
if (textFieldText === "") {
|
if (textFieldText === "") {
|
||||||
textFieldText = "0"
|
textFieldText = "0"
|
||||||
}
|
}
|
||||||
@@ -312,6 +311,12 @@ PageType {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
|
|
||||||
|
if (ConnectionController.isConnected) {
|
||||||
|
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
||||||
InstallController.updateContainer(AwgConfigModel.getConfig())
|
InstallController.updateContainer(AwgConfigModel.getConfig())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,6 +162,12 @@ PageType {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
|
|
||||||
|
if (ConnectionController.isConnected) {
|
||||||
|
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
||||||
InstallController.updateContainer(CloakConfigModel.getConfig())
|
InstallController.updateContainer(CloakConfigModel.getConfig())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,6 +390,12 @@ PageType {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
|
|
||||||
|
if (ConnectionController.isConnected) {
|
||||||
|
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
||||||
InstallController.updateContainer(OpenVpnConfigModel.getConfig())
|
InstallController.updateContainer(OpenVpnConfigModel.getConfig())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,6 +140,12 @@ PageType {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
|
|
||||||
|
if (ConnectionController.isConnected) {
|
||||||
|
PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
PageController.goToPage(PageEnum.PageSetupWizardInstalling);
|
||||||
InstallController.updateContainer(ShadowSocksConfigModel.getConfig())
|
InstallController.updateContainer(ShadowSocksConfigModel.getConfig())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user