summaryrefslogtreecommitdiff
path: root/src/gui/windows/serverinfowindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-13 03:07:04 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-13 03:07:04 +0300
commite2b81d3e9adb1e101d3a28144a0a1f17d91ed958 (patch)
treeaed21d2330b91a58ea53c338b0eb01136f380613 /src/gui/windows/serverinfowindow.cpp
parentc44ee3cc262b5e6df7fff32273e9df5bf932c159 (diff)
downloadmv-e2b81d3e9adb1e101d3a28144a0a1f17d91ed958.tar.gz
mv-e2b81d3e9adb1e101d3a28144a0a1f17d91ed958.tar.bz2
mv-e2b81d3e9adb1e101d3a28144a0a1f17d91ed958.tar.xz
mv-e2b81d3e9adb1e101d3a28144a0a1f17d91ed958.zip
Show register and support url in server info window.
Diffstat (limited to 'src/gui/windows/serverinfowindow.cpp')
-rw-r--r--src/gui/windows/serverinfowindow.cpp55
1 files changed, 36 insertions, 19 deletions
diff --git a/src/gui/windows/serverinfowindow.cpp b/src/gui/windows/serverinfowindow.cpp
index 22931fa80..23e7a7e50 100644
--- a/src/gui/windows/serverinfowindow.cpp
+++ b/src/gui/windows/serverinfowindow.cpp
@@ -107,19 +107,27 @@ void ServerInfoWindow::showServerInfo()
if (type == ServerFreeType::Free)
{
// TRANSLATORS: server info comment
- mBrowserBox->addRow(_("Server with free license."));
+ mBrowserBox->addRow(_("##BServer with free license."));
}
else if (type == ServerFreeType::NonFree)
{
// TRANSLATORS: server info comment
- mBrowserBox->addRow(_("Server with non free license."));
+ mBrowserBox->addRow(_("##BServer with non free license."));
}
else if (type == ServerFreeType::Unknown ||
type == ServerFreeType::NotSet)
{
// TRANSLATORS: server info comment
- mBrowserBox->addRow(_("Server unknown licesne."));
+ mBrowserBox->addRow(_("##BServer unknown licesne."));
}
+ mBrowserBox->addRow("");
+ addServerComment(mServerInfo.supportUrl,
+ // TRANSLATORS: server info comment
+ _("Support url"));
+ addServerComment(mServerInfo.registerUrl,
+ // TRANSLATORS: server info comment
+ _("Register url"));
+
addSourcesList(mServerInfo.nonFreeSources,
// TRANSLATORS: server info non free comment
_("##BNon free sources"));
@@ -138,23 +146,32 @@ void ServerInfoWindow::addSourcesList(const std::vector<ServerUrlInfo> &list,
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);
+ addServerComment(info.url,
+ info.name);
}
mBrowserBox->addRow("");
}
}
+
+void ServerInfoWindow::addServerComment(const std::string &url,
+ const std::string &comment)
+{
+ std::string str;
+ if (!url.empty())
+ {
+ if (strStartWith(url, "http://") ||
+ strStartWith(url, "https://"))
+ {
+ str = strprintf("%s: @@%s|@@##0",
+ comment.c_str(),
+ url.c_str());
+ }
+ else
+ {
+ str = strprintf("%s: %s",
+ comment.c_str(),
+ url.c_str());
+ }
+ mBrowserBox->addRow(str);
+ }
+}