diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-20 12:19:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-21 21:09:08 +0300 |
commit | c483cf600e74e7d38a7c0cc7d80435e97040c76c (patch) | |
tree | ba33088840361d3393398d6c9d52ebcfc894dd06 /src/gui | |
parent | 11619eed54e7b9df06c01cae46bd22aadc3f8dc7 (diff) | |
download | plus-c483cf600e74e7d38a7c0cc7d80435e97040c76c.tar.gz plus-c483cf600e74e7d38a7c0cc7d80435e97040c76c.tar.bz2 plus-c483cf600e74e7d38a7c0cc7d80435e97040c76c.tar.xz plus-c483cf600e74e7d38a7c0cc7d80435e97040c76c.zip |
Add channel name to chat tabs.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/battletab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/chattab.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/chattab.h | 10 | ||||
-rw-r--r-- | src/gui/widgets/gmtab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/guildchattab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tradetab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/whispertab.cpp | 2 |
7 files changed, 18 insertions, 8 deletions
diff --git a/src/gui/widgets/battletab.cpp b/src/gui/widgets/battletab.cpp index b888945a8..96e964b67 100644 --- a/src/gui/widgets/battletab.cpp +++ b/src/gui/widgets/battletab.cpp @@ -38,7 +38,7 @@ #include "debug.h" BattleTab::BattleTab(const Widget2 *const widget) : - ChatTab(widget, _("Battle")) + ChatTab(widget, _("Battle"), "") { if (config.getBoolValue("showChatHistory")) loadFromLogFile("#Battle"); diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index ae18740a9..2b360789a 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -49,14 +49,16 @@ static const unsigned int MAX_WORD_SIZE = 50; -ChatTab::ChatTab(const Widget2 *const widget, const std::string &name) : +ChatTab::ChatTab(const Widget2 *const widget, const std::string &name, + const std::string &channel) : Tab(widget), mTextOutput(new BrowserBox(this, BrowserBox::AUTO_WRAP)), mScrollArea(new ScrollArea(mTextOutput, false)), mAllowHightlight(true), mRemoveNames(false), mNoAway(false), - mShowOnline(false) + mShowOnline(false), + mChannelName(channel) { setCaption(name); diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 24afffc0f..0ac55811d 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -32,6 +32,9 @@ class ScrollArea; +const std::string GENERAL_CHANNEL = "\000\000\000"; +const std::string TRADE_CHANNEL = "\000\000\001"; + /** * A tab for the chat window. This is special to ease chat handling. */ @@ -54,7 +57,8 @@ class ChatTab : public Tab /** * Constructor. */ - ChatTab(const Widget2 *const widget, const std::string &name); + ChatTab(const Widget2 *const widget, const std::string &name, + const std::string &channel); A_DELETE_COPY(ChatTab) @@ -171,6 +175,9 @@ class ChatTab : public Tab virtual void playNewMessageSound(); + std::string getChannelName() + { return mChannelName; } + protected: friend class ChatWindow; friend class WhisperWindow; @@ -195,6 +202,7 @@ class ChatTab : public Tab bool mRemoveNames; bool mNoAway; bool mShowOnline; + std::string mChannelName; }; extern ChatTab *localChatTab; diff --git a/src/gui/widgets/gmtab.cpp b/src/gui/widgets/gmtab.cpp index d129c9043..9a28622a9 100644 --- a/src/gui/widgets/gmtab.cpp +++ b/src/gui/widgets/gmtab.cpp @@ -32,7 +32,7 @@ #include "debug.h" GmTab::GmTab(const Widget2 *const widget) : - ChatTab(widget, _("GM")) + ChatTab(widget, _("GM"), "") { setTabColor(&getThemeColor(Theme::GM_CHAT_TAB), &getThemeColor(Theme::GM_CHAT_TAB_OUTLINE)); diff --git a/src/gui/widgets/guildchattab.cpp b/src/gui/widgets/guildchattab.cpp index c960b4798..5917fbda4 100644 --- a/src/gui/widgets/guildchattab.cpp +++ b/src/gui/widgets/guildchattab.cpp @@ -37,7 +37,7 @@ #include "debug.h" GuildChatTab::GuildChatTab(const Widget2 *const widget) : - ChatTab(widget, _("Guild")) + ChatTab(widget, _("Guild"), "") { setTabColor(&getThemeColor(Theme::GUILD_CHAT_TAB), &getThemeColor(Theme::GUILD_CHAT_TAB_OUTLINE)); diff --git a/src/gui/widgets/tradetab.cpp b/src/gui/widgets/tradetab.cpp index 96a45e339..380b11f06 100644 --- a/src/gui/widgets/tradetab.cpp +++ b/src/gui/widgets/tradetab.cpp @@ -36,7 +36,7 @@ #include "debug.h" TradeTab::TradeTab(const Widget2 *const widget) : - ChatTab(widget, _("Trade")) + ChatTab(widget, _("Trade"), TRADE_CHANNEL) { } diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp index 58219f019..95c2fa505 100644 --- a/src/gui/widgets/whispertab.cpp +++ b/src/gui/widgets/whispertab.cpp @@ -34,7 +34,7 @@ #include "debug.h" WhisperTab::WhisperTab(const Widget2 *const widget, const std::string &nick) : - ChatTab(widget, nick), + ChatTab(widget, nick, ""), mNick(nick) { setWhisperTabColors(); |