summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-04-19 11:47:28 -0600
committerJared Adams <jaxad0127@gmail.com>2009-04-19 11:47:28 -0600
commit4d6fd10b94d9c4fb2949272ffe1de1300f33405b (patch)
treedac84561f29e11055017cb57354f840e15ca508a
parent5201050a8822dd0a33ffa3a6e9fee7c73cb215de (diff)
downloadmana-4d6fd10b94d9c4fb2949272ffe1de1300f33405b.tar.gz
mana-4d6fd10b94d9c4fb2949272ffe1de1300f33405b.tar.bz2
mana-4d6fd10b94d9c4fb2949272ffe1de1300f33405b.tar.xz
mana-4d6fd10b94d9c4fb2949272ffe1de1300f33405b.zip
Make /query switch to the new tab
-rw-r--r--src/commandhandler.cpp2
-rw-r--r--src/gui/chat.cpp8
-rw-r--r--src/gui/chat.h2
3 files changed, 8 insertions, 4 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 81507791..ea0094c3 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -337,7 +337,7 @@ void CommandHandler::handleMsg(const std::string &args, ChatTab *tab)
}
void CommandHandler::handleQuery(const std::string &args, ChatTab *tab) {
- if (chatWindow->addWhisperTab(args))
+ if (chatWindow->addWhisperTab(args, true))
return;
tab->chatLog(strprintf(_("Cannont create a whisper tab for nick '%s'!"
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 7faf9bda..54b388db 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -454,7 +454,7 @@ void ChatWindow::whisper(const std::string &nick, std::string mes, bool own)
}
}
-ChatTab *ChatWindow::addWhisperTab(const std::string &nick)
+ChatTab *ChatWindow::addWhisperTab(const std::string &nick, bool switchTo)
{
std::string playerName = player_node->getName();
std::string tempNick = nick;
@@ -465,5 +465,9 @@ ChatTab *ChatWindow::addWhisperTab(const std::string &nick)
if (mWhispers[tempNick] || tempNick.compare(playerName) == 0)
return NULL;
- return mWhispers[tempNick] = new WhisperTab(nick);
+ ChatTab *ret = mWhispers[tempNick] = new WhisperTab(nick);
+
+ mChatTabs->setSelectedTab(ret);
+
+ return ret;
}
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 21f80f13..88dabb89 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -174,7 +174,7 @@ class ChatWindow : public Window,
void whisper(const std::string &nick, std::string mes,
bool own = false);
- ChatTab *addWhisperTab(const std::string &nick);
+ ChatTab *addWhisperTab(const std::string &nick, bool switchTo = false);
protected:
friend class ChatTab;