summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
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;