diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fd6af721..4a3f73062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unversioned +- Minor: Added a keyboard shortcut (Ctrl+F5) for "Reconnect" (#2215) - Minor: Made `Try to find usernames without @ prefix` option still resolve usernames when special characters (commas, dots, (semi)colons, exclamation mark, question mark) are appended to them. (#2212) - Minor: Made usercard update user's display name (#2160) - Minor: Added placeholder text for message text input box. (#2143, #2149) diff --git a/src/widgets/settingspages/KeyboardSettingsPage.cpp b/src/widgets/settingspages/KeyboardSettingsPage.cpp index 737d093d3..5158c88ad 100644 --- a/src/widgets/settingspages/KeyboardSettingsPage.cpp +++ b/src/widgets/settingspages/KeyboardSettingsPage.cpp @@ -66,6 +66,7 @@ KeyboardSettingsPage::KeyboardSettingsPage() form->addRow(new QLabel("Ctrl + P"), new QLabel("Open Settings menu")); form->addRow(new QLabel("F5"), new QLabel("Reload subscriber and channel emotes")); + form->addRow(new QLabel("Ctrl + F5"), new QLabel("Reconnect channels")); form->addItem(new QSpacerItem(16, 16)); form->addRow(new QLabel("PageUp"), new QLabel("Scroll up")); diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index fa0174be9..865bb0725 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -118,6 +118,9 @@ Split::Split(QWidget *parent) // F5: reload emotes createShortcut(this, "F5", &Split::reloadChannelAndSubscriberEmotes); + // CTRL+F5: reconnect + createShortcut(this, "CTRL+F5", &Split::reconnect); + // F10 createShortcut(this, "F10", [] { auto *popup = new DebugPopup; @@ -850,6 +853,11 @@ void Split::reloadChannelAndSubscriberEmotes() } } +void Split::reconnect() +{ + this->getChannel()->reconnect(); +} + void Split::dragEnterEvent(QDragEnterEvent *event) { if (getSettings()->imageUploaderEnabled && diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index 7c60cacd0..8a2bb96b4 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -144,6 +144,7 @@ public slots: void showViewerList(); void openSubPage(); void reloadChannelAndSubscriberEmotes(); + void reconnect(); }; } // namespace chatterino diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index f9bdaa6b5..503787452 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -386,7 +386,10 @@ std::unique_ptr SplitHeader::createMainMenu() // reload / reconnect if (this->split_->getChannel()->canReconnect()) - menu->addAction("Reconnect", this, SLOT(reconnect())); + { + menu->addAction("Reconnect", this, SLOT(reconnect()), + QKeySequence("Ctrl+F5")); + } if (dynamic_cast(this->split_->getChannel().get())) {