From c37ae6c52273c01f634a0635c5255319f385e7fb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 13 Oct 2014 00:08:07 +0300 Subject: Add whisper tab and channel tab commands to autocomplete. --- src/gui/widgets/tabs/chat/channeltab.cpp | 6 ++++++ src/gui/widgets/tabs/chat/channeltab.h | 3 +++ src/gui/widgets/tabs/chat/whispertab.cpp | 5 +++++ src/gui/widgets/tabs/chat/whispertab.h | 4 ++++ 4 files changed, 18 insertions(+) (limited to 'src/gui/widgets/tabs') diff --git a/src/gui/widgets/tabs/chat/channeltab.cpp b/src/gui/widgets/tabs/chat/channeltab.cpp index 43ba86acf..6f7242578 100644 --- a/src/gui/widgets/tabs/chat/channeltab.cpp +++ b/src/gui/widgets/tabs/chat/channeltab.cpp @@ -72,3 +72,9 @@ bool ChannelTab::handleCommand(const std::string &restrict type, return true; } + +void ChannelTab::getAutoCompleteCommands(StringVect& commands) const +{ + commands.push_back("/close"); + commands.push_back(mChannelName); +} diff --git a/src/gui/widgets/tabs/chat/channeltab.h b/src/gui/widgets/tabs/chat/channeltab.h index 33ed49987..0bcfc425c 100644 --- a/src/gui/widgets/tabs/chat/channeltab.h +++ b/src/gui/widgets/tabs/chat/channeltab.h @@ -44,6 +44,9 @@ class ChannelTab final : public ChatTab bool handleCommand(const std::string &restrict type, const std::string &restrict args) override final; + + void getAutoCompleteCommands(StringVect& commands) + const override final; }; #endif // GUI_WIDGETS_TABS_CHAT_CHANNELTAB_H diff --git a/src/gui/widgets/tabs/chat/whispertab.cpp b/src/gui/widgets/tabs/chat/whispertab.cpp index e1740d808..20354cc69 100644 --- a/src/gui/widgets/tabs/chat/whispertab.cpp +++ b/src/gui/widgets/tabs/chat/whispertab.cpp @@ -115,6 +115,11 @@ void WhisperTab::getAutoCompleteList(StringVect &names) const names.push_back(mNick); } +void WhisperTab::getAutoCompleteCommands(StringVect& commands) const +{ + commands.push_back("/close"); +} + void WhisperTab::setWhisperTabColors() { setTabColors(Theme::WHISPER_TAB); diff --git a/src/gui/widgets/tabs/chat/whispertab.h b/src/gui/widgets/tabs/chat/whispertab.h index 4e9f091df..2ad8ca03d 100644 --- a/src/gui/widgets/tabs/chat/whispertab.h +++ b/src/gui/widgets/tabs/chat/whispertab.h @@ -48,6 +48,10 @@ class WhisperTab final : public ChatTab friend class ChatWindow; void getAutoCompleteList(StringVect &names) const override final; + + void getAutoCompleteCommands(StringVect& commands) + const override final; + /** * Constructor. * -- cgit v1.2.3-60-g2f50