summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/serverinfowindow.cpp54
-rw-r--r--src/gui/windows/serverinfowindow.h3
2 files changed, 57 insertions, 0 deletions
diff --git a/src/gui/windows/serverinfowindow.cpp b/src/gui/windows/serverinfowindow.cpp
index 274fd97ce..22931fa80 100644
--- a/src/gui/windows/serverinfowindow.cpp
+++ b/src/gui/windows/serverinfowindow.cpp
@@ -103,4 +103,58 @@ void ServerInfoWindow::handleLink(const std::string &link,
void ServerInfoWindow::showServerInfo()
{
+ const ServerFreeTypeT type = mServerInfo.freeType;
+ if (type == ServerFreeType::Free)
+ {
+ // TRANSLATORS: server info comment
+ mBrowserBox->addRow(_("Server with free license."));
+ }
+ else if (type == ServerFreeType::NonFree)
+ {
+ // TRANSLATORS: server info comment
+ mBrowserBox->addRow(_("Server with non free license."));
+ }
+ else if (type == ServerFreeType::Unknown ||
+ type == ServerFreeType::NotSet)
+ {
+ // TRANSLATORS: server info comment
+ mBrowserBox->addRow(_("Server unknown licesne."));
+ }
+ addSourcesList(mServerInfo.nonFreeSources,
+ // TRANSLATORS: server info non free comment
+ _("##BNon free sources"));
+ addSourcesList(mServerInfo.freeSources,
+ // TRANSLATORS: server info non free comment
+ _("##BFree sources"));
+}
+
+void ServerInfoWindow::addSourcesList(const std::vector<ServerUrlInfo> &list,
+ const std::string &comment)
+{
+ if (!list.empty())
+ {
+ mBrowserBox->addRow("");
+ mBrowserBox->addRow(comment);
+ FOR_EACH (std::vector<ServerUrlInfo>::const_iterator, it, list)
+ {
+ const ServerUrlInfo &info = *it;
+ const std::string url = info.url;
+ std::string str;
+ if (strStartWith(url, "http://") ||
+ strStartWith(url, "https://"))
+ {
+ str = strprintf("%s: @@%s|@@##0",
+ info.name.c_str(),
+ url.c_str());
+ }
+ else
+ {
+ str = strprintf("%s: %s",
+ info.name.c_str(),
+ url.c_str());
+ }
+ mBrowserBox->addRow(str);
+ }
+ mBrowserBox->addRow("");
+ }
}
diff --git a/src/gui/windows/serverinfowindow.h b/src/gui/windows/serverinfowindow.h
index c0cf5c786..5165102cd 100644
--- a/src/gui/windows/serverinfowindow.h
+++ b/src/gui/windows/serverinfowindow.h
@@ -54,6 +54,9 @@ class ServerInfoWindow final : public Window,
protected:
void showServerInfo();
+ void addSourcesList(const std::vector<ServerUrlInfo> &list,
+ const std::string &comment);
+
private:
ServerInfo mServerInfo;
BrowserBox *mBrowserBox A_NONNULLPOINTER;