summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-26 12:39:39 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-26 12:39:39 +0300
commit5857f579da26ac21802679bce1777cd8337bd584 (patch)
tree455ab7a62d15f447bc3fec5388913c7886945682 /src/gui/serverdialog.cpp
parent298d8e2ef42eb2c60f1a2c24cf1aeb131dcded09 (diff)
downloadmv-5857f579da26ac21802679bce1777cd8337bd584.tar.gz
mv-5857f579da26ac21802679bce1777cd8337bd584.tar.bz2
mv-5857f579da26ac21802679bce1777cd8337bd584.tar.xz
mv-5857f579da26ac21802679bce1777cd8337bd584.zip
add support for separate online list.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 56ce6528a..9e3a46bf4 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -366,6 +366,7 @@ void ServerDialog::connectToSelectedServer()
mServerInfo->name = server.name;
mServerInfo->description = server.description;
mServerInfo->registerUrl = server.registerUrl;
+ mServerInfo->onlineListUrl = server.onlineListUrl;
mServerInfo->save = true;
if (chatLogger)
@@ -637,6 +638,11 @@ void ServerDialog::loadServers(const bool addNew)
server.registerUrl = reinterpret_cast<const char*>(
subNode->xmlChildrenNode->content);
}
+ else if (xmlNameEqual(subNode, "onlineListUrl"))
+ {
+ server.onlineListUrl = reinterpret_cast<const char*>(
+ subNode->xmlChildrenNode->content);
+ }
}
server.version.first = font->getWidth(version);
@@ -655,6 +661,7 @@ void ServerDialog::loadServers(const bool addNew)
mServers[i].version = server.version;
mServers[i].description = server.description;
mServers[i].registerUrl = server.registerUrl;
+ mServers[i].onlineListUrl = server.onlineListUrl;
mServersListModel->setVersionString(i, version);
found = true;
break;
@@ -677,10 +684,13 @@ void ServerDialog::loadCustomServers()
const std::string hostKey = "MostUsedServerName" + index;
const std::string typeKey = "MostUsedServerType" + index;
const std::string portKey = "MostUsedServerPort" + index;
+ const std::string onlineListUrlKey
+ = "MostUsedServerOnlineList" + index;
ServerInfo server;
server.name = config.getValue(nameKey, "");
server.description = config.getValue(descKey, "");
+ server.onlineListUrl = config.getValue(onlineListUrlKey, "");
server.hostname = config.getValue(hostKey, "");
server.type = ServerInfo::parseType(config.getValue(typeKey, ""));
@@ -738,9 +748,12 @@ void ServerDialog::saveCustomServers(const ServerInfo &currentServer,
const std::string hostKey = "MostUsedServerName" + num;
const std::string typeKey = "MostUsedServerType" + num;
const std::string portKey = "MostUsedServerPort" + num;
+ const std::string onlineListUrlKey
+ = "MostUsedServerOnlineList" + num;
config.setValue(nameKey, toString(server.name));
config.setValue(descKey, toString(server.description));
+ config.setValue(onlineListUrlKey, toString(server.onlineListUrl));
config.setValue(hostKey, toString(server.hostname));
config.setValue(typeKey, serverTypeToString(server.type));
config.setValue(portKey, toString(server.port));