diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-11 15:33:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-11 15:34:01 +0300 |
commit | 8de44a41862b3a0ff714e68169b6443a2a06b3aa (patch) | |
tree | 758d165a415b45dc15737948d7e74aae38da4a58 /src/gui | |
parent | 890fd4c9ceab089de688b00acf5163d795ccec4a (diff) | |
download | mv-8de44a41862b3a0ff714e68169b6443a2a06b3aa.tar.gz mv-8de44a41862b3a0ff714e68169b6443a2a06b3aa.tar.bz2 mv-8de44a41862b3a0ff714e68169b6443a2a06b3aa.tar.xz mv-8de44a41862b3a0ff714e68169b6443a2a06b3aa.zip |
Add chat command for select general tab.
New chat command: /generaltab
Aloases: /general
/generalchattab
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 49ef73907..c3b78f066 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -374,6 +374,24 @@ void ChatWindow::nextTab() mChatTabs->setSelectedTabByIndex(tab); } +void ChatWindow::selectGeneralTab() +{ + if (!mChatTabs) + return; + + int sz = mChatTabs->getNumberOfTabs(); + for (int f = 0; f < sz; f ++) + { + ChatTab *const tab = dynamic_cast<ChatTab*>( + mChatTabs->getTabByIndex(f)); + if (tab && tab->getType() == ChatTabType::INPUT) + { + mChatTabs->setSelectedTab(tab); + break; + } + } +} + void ChatWindow::closeTab() const { if (!mChatTabs) diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index 7287410d9..d4dfa602d 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -285,6 +285,8 @@ class ChatWindow final : public Window, bool isTabPresent(const ChatTab *const tab) const A_WARN_UNUSED; + void selectGeneralTab(); + void attributeChanged(const int id, const int oldVal, const int newVal) override final; |