Add Ctrl+F5 as a shortcut for reconnect() (#2215)

This commit is contained in:
mmb L 2020-11-22 21:28:07 +08:00 committed by GitHub
parent b79d5fa6f0
commit 44262ee2ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 1 deletions

View file

@ -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)

View file

@ -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"));

View file

@ -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 &&

View file

@ -144,6 +144,7 @@ public slots:
void showViewerList();
void openSubPage();
void reloadChannelAndSubscriberEmotes();
void reconnect();
};
} // namespace chatterino

View file

@ -386,7 +386,10 @@ std::unique_ptr<QMenu> 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<TwitchChannel *>(this->split_->getChannel().get()))
{