summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-16 00:45:25 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-16 00:45:25 +0300
commit8a068ecd9dd6d41ba49f258107b09b98a8ea1a6d (patch)
treef966d817a42a069fef3958f241ae256c255e6ef1 /src/gui
parentd074efe8597cbc21375c59d7e6ee17296b4c4899 (diff)
downloadmv-8a068ecd9dd6d41ba49f258107b09b98a8ea1a6d.tar.gz
mv-8a068ecd9dd6d41ba49f258107b09b98a8ea1a6d.tar.bz2
mv-8a068ecd9dd6d41ba49f258107b09b98a8ea1a6d.tar.xz
mv-8a068ecd9dd6d41ba49f258107b09b98a8ea1a6d.zip
Add hotkey to close selected chat tab.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chatwindow.cpp16
-rw-r--r--src/gui/chatwindow.h5
2 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 29ce3bace..c266374ef 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -396,6 +396,22 @@ void ChatWindow::nextTab()
mChatTabs->setSelectedTab(tab);
}
+void ChatWindow::closeTab()
+{
+ if (!mChatTabs)
+ return;
+
+ int idx = mChatTabs->getSelectedTabIndex();
+ Tab *tab = mChatTabs->getTabByIndex(idx);
+ if (!tab)
+ return;
+ WhisperTab *whisper = dynamic_cast<WhisperTab*>(tab);
+ if (!whisper)
+ return;
+
+ whisper->handleCommand("close", "");
+}
+
void ChatWindow::defaultTab()
{
if (mChatTabs)
diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h
index 05e039c60..b6a37ef79 100644
--- a/src/gui/chatwindow.h
+++ b/src/gui/chatwindow.h
@@ -130,6 +130,11 @@ class ChatWindow : public Window,
void nextTab();
/**
+ * Close current chat tab
+ */
+ void closeTab();
+
+ /**
* Switch to the default tab
*/
void defaultTab();