From 2bc5d7a1bfaf32f5df3121bbc4d07b886cf9ffc3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Jun 2017 18:45:06 +0300 Subject: Add docs section for server in serverslist.xml --- src/gui/windows/serverdialog.cpp | 6 ++++++ src/gui/windows/serverinfowindow.cpp | 3 +++ src/net/serverinfo.h | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 95b40f03d..501557c8c 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -245,6 +245,7 @@ void ServerDialog::connectToSelectedServer() mServerInfo->updateHosts = server.updateHosts; mServerInfo->freeSources = server.freeSources; mServerInfo->nonFreeSources = server.nonFreeSources; + mServerInfo->docs = server.docs; settings.persistentIp = mServerInfo->persistentIp; settings.supportUrl = mServerInfo->supportUrl; @@ -668,6 +669,10 @@ void ServerDialog::loadServers(const bool addNew) { loadServerSources(subNode, server); } + else if (xmlNameEqual(subNode, "docs")) + { + loadServerSourcesList(subNode, server.docs); + } } server.version.first = font->getWidth(version); @@ -699,6 +704,7 @@ void ServerDialog::loadServers(const bool addNew) mServers[i].packetVersion = server.packetVersion; mServers[i].freeSources = server.freeSources; mServers[i].nonFreeSources = server.nonFreeSources; + mServers[i].docs = server.docs; mServersListModel->setVersionString(i, version); found = true; break; diff --git a/src/gui/windows/serverinfowindow.cpp b/src/gui/windows/serverinfowindow.cpp index d6f0c3cad..660dd0241 100644 --- a/src/gui/windows/serverinfowindow.cpp +++ b/src/gui/windows/serverinfowindow.cpp @@ -127,6 +127,9 @@ void ServerInfoWindow::showServerInfo() addSourcesList(mServerInfo.freeSources, // TRANSLATORS: server info non free comment _("##BFree sources")); + addSourcesList(mServerInfo.docs, + // TRANSLATORS: server info documentation comment + _("##BDocumentation")); } void ServerInfoWindow::addSourcesList(const std::vector &list, diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index 70ac3b716..2deccb04f 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -53,6 +53,7 @@ class ServerInfo final std::vector updateHosts; std::vector freeSources; std::vector nonFreeSources; + std::vector docs; uint16_t port; VersionString version; int packetVersion; @@ -75,6 +76,7 @@ class ServerInfo final updateHosts(), freeSources(), nonFreeSources(), + docs(), #ifdef TMWA_SUPPORT port(6901), #else // TMWA_SUPPORT @@ -104,6 +106,7 @@ class ServerInfo final updateHosts(info.updateHosts), freeSources(info.freeSources), nonFreeSources(info.nonFreeSources), + docs(info.docs), port(info.port), version(), packetVersion(info.packetVersion), @@ -133,6 +136,7 @@ class ServerInfo final updateHosts = info.updateHosts; freeSources = info.freeSources; nonFreeSources = info.nonFreeSources; + docs = info.docs; port = info.port; save = info.save; persistentIp = info.persistentIp; @@ -166,6 +170,7 @@ class ServerInfo final updateHosts.clear(); freeSources.clear(); nonFreeSources.clear(); + docs.clear(); version.first = 0; version.second.clear(); packetVersion = 0; -- cgit v1.2.3-70-g09d2