mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Merge pull request #529 from amnezia-vpn/bugfix/container-selection-after-cleanup-server
fixed first container selection on HomeContainersListView after server cleanup
This commit is contained in:
@@ -251,10 +251,9 @@ void ServersModel::addServer(const QJsonObject &server)
|
|||||||
|
|
||||||
void ServersModel::editServer(const QJsonObject &server)
|
void ServersModel::editServer(const QJsonObject &server)
|
||||||
{
|
{
|
||||||
beginResetModel();
|
|
||||||
m_settings->editServer(m_currentlyProcessedServerIndex, server);
|
m_settings->editServer(m_currentlyProcessedServerIndex, server);
|
||||||
m_servers = m_settings->serversArray();
|
m_servers.replace(m_currentlyProcessedServerIndex, m_settings->serversArray().at(m_currentlyProcessedServerIndex));
|
||||||
endResetModel();
|
emit dataChanged(index(m_currentlyProcessedServerIndex, 0), index(m_currentlyProcessedServerIndex, 0));
|
||||||
updateContainersModel();
|
updateContainersModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,9 +30,11 @@ ListView {
|
|||||||
target: ServersModel
|
target: ServersModel
|
||||||
|
|
||||||
function onCurrentlyProcessedServerIndexChanged() {
|
function onCurrentlyProcessedServerIndexChanged() {
|
||||||
|
if (ContainersModel.getDefaultContainer()) {
|
||||||
menuContent.checkCurrentItem()
|
menuContent.checkCurrentItem()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function checkCurrentItem() {
|
function checkCurrentItem() {
|
||||||
var item = menuContent.itemAtIndex(currentIndex)
|
var item = menuContent.itemAtIndex(currentIndex)
|
||||||
@@ -76,9 +78,8 @@ ListView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
ServersModel.setDefaultContainer(proxyContainersModel.mapToSource(index))
|
|
||||||
|
|
||||||
containersDropDown.menuVisible = false
|
containersDropDown.menuVisible = false
|
||||||
|
ServersModel.setDefaultContainer(proxyContainersModel.mapToSource(index))
|
||||||
} else {
|
} else {
|
||||||
if (!isSupported && isInstalled) {
|
if (!isSupported && isInstalled) {
|
||||||
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
|
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
|
||||||
|
|||||||
Reference in New Issue
Block a user