Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated settings without 'save and restart...' #337

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/ui/controllers/installController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,15 @@ void InstallController::removeCurrentlyProcessedServer()
emit removeCurrentlyProcessedServerFinished(tr("Server '") + serverName + tr("' was removed"));
}

void InstallController::updateContainerOnlyMemory(QJsonObject config)
{
const DockerContainer container = ContainerProps::containerFromString(config.value(config_key::container).toString());
auto modelIndex = m_containersModel->index(container);
m_containersModel->setData(modelIndex, config, ContainersModel::Roles::ConfigRole);

m_protocolModel->updateModel(config);
}

void InstallController::removeAllContainers()
{
int serverIndex = m_serversModel->getCurrentlyProcessedServerIndex();
Expand Down
1 change: 1 addition & 0 deletions client/ui/controllers/installController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public slots:
void scanServerForInstalledContainers();

void updateContainer(QJsonObject config);
void updateContainerOnlyMemory(QJsonObject config);

void removeCurrentlyProcessedServer();
void removeAllContainers();
Expand Down
5 changes: 5 additions & 0 deletions client/ui/qml/Pages2/PageProtocolCloakSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ PageType {
anchors.topMargin: 20

BackButtonType {
backButtonFunction: function() {
forceActiveFocus()
InstallController.updateContainerOnlyMemory(CloakConfigModel.getConfig())
PageController.closePage()
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ PageType {
anchors.topMargin: 20

BackButtonType {
backButtonFunction: function() {
forceActiveFocus()
InstallController.updateContainerOnlyMemory(OpenVpnConfigModel.getConfig())
PageController.closePage()
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ PageType {
anchors.topMargin: 20

BackButtonType {
backButtonFunction: function() {
forceActiveFocus()
InstallController.updateContainerOnlyMemory(ShadowSocksConfigModel.getConfig())
PageController.closePage()
}
}
}

Expand Down