summaryrefslogtreecommitdiff
path: root/src/gui/widgets/chattab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-18 21:33:21 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-18 21:33:21 +0300
commit25907c03212110f10c910b0ef90a416dff450ca7 (patch)
treefa409f004887619041e19f06f289d5ecb1c89e59 /src/gui/widgets/chattab.cpp
parent772daf48072915d598014c25a33ff3dc96e43bce (diff)
downloadmanaplus-25907c03212110f10c910b0ef90a416dff450ca7.tar.gz
manaplus-25907c03212110f10c910b0ef90a416dff450ca7.tar.bz2
manaplus-25907c03212110f10c910b0ef90a416dff450ca7.tar.xz
manaplus-25907c03212110f10c910b0ef90a416dff450ca7.zip
Add option to show/hide guild online messages.
Disabled by default.
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r--src/gui/widgets/chattab.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 0742e0ae2..fd336e116 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -55,7 +55,8 @@ ChatTab::ChatTab(const Widget2 *const widget, const std::string &name) :
mScrollArea(new ScrollArea(mTextOutput, false)),
mAllowHightlight(true),
mRemoveNames(false),
- mNoAway(false)
+ mNoAway(false),
+ mShowOnline(false)
{
setCaption(name);
@@ -506,3 +507,15 @@ void ChatTab::playNewMessageSound()
{
sound.playGuiSound(SOUND_WHISPER);
}
+
+void ChatTab::showOnline(const std::string &nick,
+ const bool isOnline)
+{
+ if (!mShowOnline)
+ return;
+
+ if (isOnline)
+ chatLog(strprintf(_("%s is now Online."), nick.c_str()));
+ else
+ chatLog(strprintf(_("%s is now Offline."), nick.c_str()));
+}