diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-14 15:15:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-14 15:15:51 +0300 |
commit | 5c7ea2e2dc120107145e7314119a82654280c010 (patch) | |
tree | 5d2d9b88ac3c30907bb7bb936c65be1f7311773c /src/gui/windows/serverdialog.cpp | |
parent | fc5a71f55255e7ff211efe80b33a2cd3dd89a8ea (diff) | |
download | mv-5c7ea2e2dc120107145e7314119a82654280c010.tar.gz mv-5c7ea2e2dc120107145e7314119a82654280c010.tar.bz2 mv-5c7ea2e2dc120107145e7314119a82654280c010.tar.xz mv-5c7ea2e2dc120107145e7314119a82654280c010.zip |
Add name for default server updates group.
Diffstat (limited to 'src/gui/windows/serverdialog.cpp')
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 04663de71..82d44c1b0 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -234,6 +234,7 @@ void ServerDialog::connectToSelectedServer() mServerInfo->registerUrl = server.registerUrl; mServerInfo->onlineListUrl = server.onlineListUrl; mServerInfo->supportUrl = server.supportUrl; + mServerInfo->defaultHostName = server.defaultHostName; mServerInfo->save = true; mServerInfo->persistentIp = server.persistentIp; mServerInfo->updateMirrors = server.updateMirrors; @@ -453,7 +454,7 @@ static void loadHostsGroup(const XmlNodePtr node, ServerInfo &server) { HostsGroup group; - group.name = XML::getProperty(node, + group.name = XML::langProperty(node, "name", // TRANSLATORS: unknown hosts group name _("Unknown")); @@ -560,41 +561,45 @@ void ServerDialog::loadServers(const bool addNew) server.port = defaultPortForServerType(server.type); } } - else if (!XmlHaveChildContent(subNode)) + else if (XmlHaveChildContent(subNode)) { - continue; - } - - if ((xmlNameEqual(subNode, "description") - && server.description.empty()) || (!lang.empty() - && xmlNameEqual(subNode, description2.c_str()))) - { - server.description = XmlChildContent(subNode); - } - else if (xmlNameEqual(subNode, "registerurl")) - { - server.registerUrl = XmlChildContent(subNode); - } - else if (xmlNameEqual(subNode, "onlineListUrl")) - { - server.onlineListUrl = XmlChildContent(subNode); - } - else if (xmlNameEqual(subNode, "support")) - { - server.supportUrl = XmlChildContent(subNode); - } - else if (xmlNameEqual(subNode, "persistentIp")) - { - std::string text = XmlChildContent(subNode); - server.persistentIp = (text == "1" || text == "true"); + if ((xmlNameEqual(subNode, "description") + && server.description.empty()) || (!lang.empty() + && xmlNameEqual(subNode, description2.c_str()))) + { + server.description = XmlChildContent(subNode); + } + else if (xmlNameEqual(subNode, "registerurl")) + { + server.registerUrl = XmlChildContent(subNode); + } + else if (xmlNameEqual(subNode, "onlineListUrl")) + { + server.onlineListUrl = XmlChildContent(subNode); + } + else if (xmlNameEqual(subNode, "support")) + { + server.supportUrl = XmlChildContent(subNode); + } + else if (xmlNameEqual(subNode, "persistentIp")) + { + std::string text = XmlChildContent(subNode); + server.persistentIp = (text == "1" || text == "true"); + } + else if (xmlNameEqual(subNode, "updateMirror")) + { + server.updateMirrors.push_back(XmlChildContent(subNode)); + } } - else if (xmlNameEqual(subNode, "updateMirror")) + if (xmlNameEqual(subNode, "updates")) { - server.updateMirrors.push_back(XmlChildContent(subNode)); + loadHostsGroup(subNode, server); } - else if (xmlNameEqual(subNode, "updates")) + else if (xmlNameEqual(subNode, "defaultUpdateHost")) { - loadHostsGroup(subNode, server); + server.defaultHostName = XML::langProperty( + // TRANSLATORS: default hosts group name + subNode, "name", _("default")); } } @@ -620,6 +625,7 @@ void ServerDialog::loadServers(const bool addNew) mServers[i].althostname = server.althostname; mServers[i].persistentIp = server.persistentIp; mServers[i].updateMirrors = server.updateMirrors; + mServers[i].defaultHostName = server.defaultHostName; mServers[i].updateHosts = server.updateHosts; mServers[i].packetVersion = server.packetVersion; mServersListModel->setVersionString(i, version); |