diff --git a/src/widgets/dialogs/SelectChannelDialog.cpp b/src/widgets/dialogs/SelectChannelDialog.cpp index a17c7022..df786bad 100644 --- a/src/widgets/dialogs/SelectChannelDialog.cpp +++ b/src/widgets/dialogs/SelectChannelDialog.cpp @@ -4,6 +4,7 @@ #include "providers/twitch/TwitchIrcServer.hpp" #include "singletons/Theme.hpp" #include "util/LayoutCreator.hpp" +#include "util/Shortcut.hpp" #include "widgets/Notebook.hpp" #include "widgets/dialogs/IrcConnectionEditor.hpp" #include "widgets/helper/NotebookTab.hpp" @@ -213,17 +214,24 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent) this->ui_.twitch.channel->setFocus(); // Shortcuts - auto *shortcut_ok = new QShortcut(QKeySequence("Return"), this); - QObject::connect(shortcut_ok, &QShortcut::activated, [=] { this->ok(); }); - auto *shortcut_cancel = new QShortcut(QKeySequence("Esc"), this); - QObject::connect(shortcut_cancel, &QShortcut::activated, - [=] { this->close(); }); + createWindowShortcut(this, "Return", [=] { + this->ok(); // + }); + createWindowShortcut(this, "Esc", [=] { + this->close(); // + }); // restore ui state // fourtf: enable when releasing irc if (getSettings()->enableExperimentalIrc) { this->ui_.notebook->selectIndex(getSettings()->lastSelectChannelTab); + createWindowShortcut(this, "Ctrl+Tab", [=] { + this->ui_.notebook->selectNextTab(); // + }); + createWindowShortcut(this, "CTRL+Shift+Tab", [=] { + this->ui_.notebook->selectPreviousTab(); // + }); } this->ui_.irc.servers->getTableView()->selectRow(