Merge pull request #1147 from TranRed/subbutton

Added Subscribe option to split menu
This commit is contained in:
pajlada 2019-07-16 22:14:50 +02:00 committed by GitHub
commit 3ef77f4c84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -636,6 +636,16 @@ void Split::showViewerList()
viewerDock->activateWindow(); viewerDock->activateWindow();
} }
void Split::openSubPage()
{
ChannelPtr channel = this->getChannel();
if (auto twitchChannel = dynamic_cast<TwitchChannel *>(channel.get()))
{
QDesktopServices::openUrl(twitchChannel->subscriptionUrl());
}
}
void Split::copyToClipboard() void Split::copyToClipboard()
{ {
QApplication::clipboard()->setText(this->view_->getSelectedText()); QApplication::clipboard()->setText(this->view_->getSelectedText());

View file

@ -129,6 +129,7 @@ public slots:
void copyToClipboard(); void copyToClipboard();
void showSearch(); void showSearch();
void showViewerList(); void showViewerList();
void openSubPage();
void reloadChannelAndSubscriberEmotes(); void reloadChannelAndSubscriberEmotes();
}; };

View file

@ -284,9 +284,12 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
// sub menu // sub menu
auto moreMenu = new QMenu("More", this); auto moreMenu = new QMenu("More", this);
moreMenu->addAction("Show viewer list", this->split_, moreMenu->addAction("Show viewer list", this->split_,
&Split::showViewerList); &Split::showViewerList);
moreMenu->addAction("Subscribe", this->split_, &Split::openSubPage);
auto action = new QAction(this); auto action = new QAction(this);
action->setText("Notify when live"); action->setText("Notify when live");
action->setCheckable(true); action->setCheckable(true);