From 8a068ecd9dd6d41ba49f258107b09b98a8ea1a6d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 16 Jul 2011 00:45:25 +0300 Subject: Add hotkey to close selected chat tab. --- src/gui/chatwindow.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gui/chatwindow.cpp') 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(tab); + if (!whisper) + return; + + whisper->handleCommand("close", ""); +} + void ChatWindow::defaultTab() { if (mChatTabs) -- cgit v1.2.3-70-g09d2