summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-27 07:32:02 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-27 07:32:02 -0600
commit9d68ee18a9d1f37cbdf4b984d6db72f7fc59cf51 (patch)
tree8928f298da71ff16f9177aa7227b9dcc97ae9d01 /src/gui/widgets
parent268e47c0d3791483f3d0066e24c6686c3c938da9 (diff)
downloadmana-client-9d68ee18a9d1f37cbdf4b984d6db72f7fc59cf51.tar.gz
mana-client-9d68ee18a9d1f37cbdf4b984d6db72f7fc59cf51.tar.bz2
mana-client-9d68ee18a9d1f37cbdf4b984d6db72f7fc59cf51.tar.xz
mana-client-9d68ee18a9d1f37cbdf4b984d6db72f7fc59cf51.zip
Add a close command to WhisperTab
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/chattab.cpp7
-rw-r--r--src/gui/widgets/chattab.h2
-rw-r--r--src/gui/widgets/whispertab.cpp9
-rw-r--r--src/gui/widgets/whispertab.h2
4 files changed, 19 insertions, 1 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 120d4e21..46116a37 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -290,7 +290,7 @@ void ChatTab::chatSend(std::string &msg)
}
else
{
- commandHandler->handleCommand(std::string(msg, 1));
+ handleCommand(std::string(msg, 1));
}
}
@@ -322,3 +322,8 @@ void ChatTab::sendChat(std::string &msg) {
return;
#endif
}
+
+void ChatTab::handleCommand(std::string msg)
+{
+ commandHandler->handleCommand(msg);
+}
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index a478abeb..14c4c130 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -108,6 +108,8 @@ class ChatTab : public Tab
virtual void sendChat(std::string &msg);
+ virtual void handleCommand(std::string msg);
+
ScrollArea *mScrollArea;
BrowserBox *mTextOutput;
//Recorder *mRecorder;
diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp
index ba469c00..8af8d427 100644
--- a/src/gui/widgets/whispertab.cpp
+++ b/src/gui/widgets/whispertab.cpp
@@ -55,6 +55,7 @@ WhisperTab::WhisperTab(const std::string &nick) :
WhisperTab::~WhisperTab()
{
+ chatWindow->removeWhisper(mNick);
}
void WhisperTab::sendChat(std::string &msg) {
@@ -76,3 +77,11 @@ void WhisperTab::sendChat(std::string &msg) {
chatLog(strprintf(_("%s: %s"), player_node->getName().c_str(),
msg.c_str()), BY_PLAYER, false);
}
+
+void WhisperTab::handleCommand(std::string msg)
+{
+ if (msg == "close")
+ delete this;
+ else
+ ChatTab::handleCommand(msg);
+}
diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h
index e3ebf0f3..6f9db1ee 100644
--- a/src/gui/widgets/whispertab.h
+++ b/src/gui/widgets/whispertab.h
@@ -48,6 +48,8 @@ class WhisperTab : public ChatTab
void sendChat(std::string &msg);
+ void handleCommand(std::string msg);
+
private:
std::string mNick;
};