From 6303e605ef23003aabace85cde3f04574f1fb05c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Dec 2014 18:01:40 +0300 Subject: In whisper constructor allow separatly set nick and caption. --- src/gui/widgets/avatarlistbox.cpp | 3 ++- src/gui/widgets/tabs/chat/whispertab.cpp | 3 ++- src/gui/widgets/tabs/chat/whispertab.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index a351c7199..53e4684d4 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -470,8 +470,9 @@ void AvatarListBox::mousePressed(MouseEvent &event) { if (type == MapItemType::EMPTY && chatWindow) { + const std::string &name = model->getAvatarAt(selected)->getName(); const WhisperTab *const tab = chatWindow->addWhisperTab( - model->getAvatarAt(selected)->getName(), true); + name, name, true); if (tab) chatWindow->saveState(); } diff --git a/src/gui/widgets/tabs/chat/whispertab.cpp b/src/gui/widgets/tabs/chat/whispertab.cpp index 53712c6b2..5ca65f580 100644 --- a/src/gui/widgets/tabs/chat/whispertab.cpp +++ b/src/gui/widgets/tabs/chat/whispertab.cpp @@ -35,8 +35,9 @@ #include "debug.h" WhisperTab::WhisperTab(const Widget2 *const widget, + const std::string &caption, const std::string &nick) : - ChatTab(widget, nick, nick, nick, ChatTabType::WHISPER), + ChatTab(widget, caption, nick, nick, ChatTabType::WHISPER), mNick(nick) { setWhisperTabColors(); diff --git a/src/gui/widgets/tabs/chat/whispertab.h b/src/gui/widgets/tabs/chat/whispertab.h index 24fc2abe0..677e8b470 100644 --- a/src/gui/widgets/tabs/chat/whispertab.h +++ b/src/gui/widgets/tabs/chat/whispertab.h @@ -57,6 +57,7 @@ class WhisperTab final : public ChatTab * @param nick the name of the player this tab is whispering to */ WhisperTab(const Widget2 *const widget, + const std::string &caption, const std::string &nick); ~WhisperTab(); -- cgit v1.2.3-60-g2f50