diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-09 20:36:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-09 20:36:58 +0300 |
commit | 76a67b908156124490210db74832f34d3ab3652e (patch) | |
tree | 23b3b01203460e0782ed3f9cc80b9e8b21c5cdd2 /src/gui | |
parent | ba33c1a780071c7b4aefd24ca6da2cc345d80527 (diff) | |
download | manaplus-76a67b908156124490210db74832f34d3ab3652e.tar.gz manaplus-76a67b908156124490210db74832f34d3ab3652e.tar.bz2 manaplus-76a67b908156124490210db74832f34d3ab3652e.tar.xz manaplus-76a67b908156124490210db74832f34d3ab3652e.zip |
Show server host name in window title.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windowmanager.cpp | 20 | ||||
-rw-r--r-- | src/gui/windowmanager.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index e8c7f2425..822b3b3e9 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -163,6 +163,26 @@ void WindowManager::initTitle() #endif } +void WindowManager::updateTitle() +{ + const std::string str = settings.serverName; + if (str.empty()) + { + settings.windowCaption = strprintf("%s %s", + branding.getStringValue("appName").c_str(), + SMALL_VERSION); + } + else + { + settings.windowCaption = strprintf("%s %s - %s", + branding.getStringValue("appName").c_str(), + SMALL_VERSION, + str.c_str()); + } + SDL::SetWindowTitle(mainGraphics->getWindow(), + settings.windowCaption.c_str()); +} + void WindowManager::setFramerate(const unsigned int fpsLimit) { if (!fpsLimit) diff --git a/src/gui/windowmanager.h b/src/gui/windowmanager.h index b100288fc..74fe1c2f1 100644 --- a/src/gui/windowmanager.h +++ b/src/gui/windowmanager.h @@ -76,6 +76,8 @@ namespace WindowManager void setIcon(); void deleteIcon(); + + void updateTitle(); } // namespace WindowManager #endif // GUI_WINDOWMANAGER_H |