Skip to content

Commit

Permalink
updated settings without 'save and restart...'
Browse files Browse the repository at this point in the history
  • Loading branch information
ronoaer committed Sep 21, 2023
1 parent d4d6fba commit 2d7c49f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
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
4 changes: 4 additions & 0 deletions client/ui/qml/Pages2/PageProtocolCloakSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ PageType {
anchors.topMargin: 20

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

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

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

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

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

Expand Down

0 comments on commit 2d7c49f

Please sign in to comment.