summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-12 23:02:11 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-12 23:02:11 +0300
commit5546a30788216ca9bab885cc97744ef8240dc32f (patch)
tree5de39ec4aee068d53e12807d31199481971bb3ef /src/gui
parent6b0ade8b1ba9d9364b889d93c37486a52840031e (diff)
downloadplus-5546a30788216ca9bab885cc97744ef8240dc32f.tar.gz
plus-5546a30788216ca9bab885cc97744ef8240dc32f.tar.bz2
plus-5546a30788216ca9bab885cc97744ef8240dc32f.tar.xz
plus-5546a30788216ca9bab885cc97744ef8240dc32f.zip
Add comments for unknown licensed and non free servers.
For non free: (NON FREE) for unknown: (UNKNOWN)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/models/serverslistmodel.h14
-rw-r--r--src/gui/windows/serverdialog.cpp5
2 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/models/serverslistmodel.h b/src/gui/models/serverslistmodel.h
index 935fd3422..206daa02a 100644
--- a/src/gui/models/serverslistmodel.h
+++ b/src/gui/models/serverslistmodel.h
@@ -31,6 +31,8 @@
#include "gui/models/listmodel.h"
+#include "utils/gettext.h"
+
/**
* Server and Port List Model
*/
@@ -68,6 +70,18 @@ class ServersListModel final : public ListModel
MutexLocker lock = mParent->lock();
const ServerInfo &server = mServers->at(elementIndex);
std::string myServer;
+ if (server.freeType == ServerFreeType::NonFree)
+ {
+ // TRANSLATORS: server license comment
+ myServer.append(_("(NON FREE)"));
+ myServer.append(" ");
+ }
+ else if (server.freeType == ServerFreeType::Unknown)
+ {
+ // TRANSLATORS: server license comment
+ myServer.append(_("(UNKNOWN)"));
+ myServer.append(" ");
+ }
myServer.append(server.hostname);
return myServer;
}
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 9600028b3..89a4774ee 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -240,6 +240,7 @@ void ServerDialog::connectToSelectedServer()
mServerInfo->defaultHostName = server.defaultHostName;
mServerInfo->save = true;
mServerInfo->persistentIp = server.persistentIp;
+ mServerInfo->freeType = server.freeType;
mServerInfo->updateMirrors = server.updateMirrors;
mServerInfo->packetVersion = server.packetVersion;
mServerInfo->updateHosts = server.updateHosts;
@@ -524,6 +525,9 @@ void ServerDialog::loadServers(const bool addNew)
serverNode, "type", "unknown");
ServerInfo server;
server.type = ServerInfo::parseType(type);
+ const std::string licenseType = XML::getProperty(
+ serverNode, "licenseType", "notset");
+ server.freeType = ServerInfo::parseFreeType(licenseType);
// Ignore unknown server types
if (server.type == ServerType::UNKNOWN)
@@ -630,6 +634,7 @@ void ServerDialog::loadServers(const bool addNew)
// Use the name listed in the server list
mServers[i].name = server.name;
mServers[i].type = server.type;
+ mServers[i].freeType = server.freeType;
mServers[i].version = server.version;
mServers[i].description = server.description;
mServers[i].registerUrl = server.registerUrl;