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
5 changed files with 15 additions and 1 deletions
@@ -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"));
+8
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 &&
+1
View File
@@ -144,6 +144,7 @@ public slots:
void showViewerList();
void openSubPage();
void reloadChannelAndSubscriberEmotes();
void reconnect();
};
} // namespace chatterino
+4 -1
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()))
{