reordered elements in the split-header drop-down

This commit is contained in:
fourtf 2018-10-09 19:04:18 +02:00
parent 770e36c10c
commit 2b1c5113d4

View file

@ -184,16 +184,17 @@ void SplitHeader::initializeLayout()
std::unique_ptr<QMenu> SplitHeader::createMainMenu() std::unique_ptr<QMenu> SplitHeader::createMainMenu()
{ {
// top level menu
auto menu = std::make_unique<QMenu>(); auto menu = std::make_unique<QMenu>();
menu->addAction("Change channel", this->split_, &Split::changeChannel, menu->addAction("Change channel", this->split_, &Split::changeChannel,
QKeySequence("Ctrl+R")); QKeySequence("Ctrl+R"));
menu->addAction("Move", this->split_, &Split::explainMoving);
menu->addAction("Add/Split", this->split_, &Split::explainSplitting);
menu->addAction("Close", this->split_, &Split::deleteFromContainer, menu->addAction("Close", this->split_, &Split::deleteFromContainer,
QKeySequence("Ctrl+W")); QKeySequence("Ctrl+W"));
menu->addSeparator(); menu->addSeparator();
menu->addAction("How to move", this->split_, &Split::explainMoving);
menu->addAction("How to add/split", this->split_, &Split::explainSplitting);
menu->addSeparator();
menu->addAction("Popup", this->split_, &Split::popup); menu->addAction("Popup", this->split_, &Split::popup);
menu->addAction("Viewer list", this->split_, &Split::showViewerList);
menu->addAction("Search", this->split_, &Split::showSearch, menu->addAction("Search", this->split_, &Split::showSearch,
QKeySequence("Ctrl+F")); QKeySequence("Ctrl+F"));
menu->addSeparator(); menu->addSeparator();
@ -210,18 +211,26 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
} }
}); });
#endif #endif
menu->addAction("Open in browser", this->split_, &Split::openInBrowser); menu->addAction("Open in browser", this->split_, &Split::openInBrowser);
#ifndef USEWEBENGINE #ifndef USEWEBENGINE
menu->addAction("Open player in browser", this->split_, menu->addAction("Open player in browser", this->split_,
&Split::openBrowserPlayer); &Split::openBrowserPlayer);
#endif #endif
menu->addAction("Open streamlink", this->split_, &Split::openInStreamlink); menu->addAction("Open in streamlink", this->split_,
&Split::openInStreamlink);
menu->addSeparator();
// sub menu
auto moreMenu = new QMenu("More", this);
moreMenu->addAction("Show viewer list", this->split_,
&Split::showViewerList);
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);
QObject::connect(menu.get(), &QMenu::aboutToShow, this, [action, this]() { QObject::connect(moreMenu, &QMenu::aboutToShow, this, [action, this]() {
action->setChecked(getApp()->notifications->isChannelNotified( action->setChecked(getApp()->notifications->isChannelNotified(
this->split_->getChannel()->getName(), Platform::Twitch)); this->split_->getChannel()->getName(), Platform::Twitch));
}); });
@ -230,16 +239,20 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
this->split_->getChannel()->getName(), Platform::Twitch); this->split_->getChannel()->getName(), Platform::Twitch);
}); });
menu->addAction(action); moreMenu->addAction(action);
menu->addSeparator(); moreMenu->addSeparator();
menu->addAction("Reload channel emotes", this, SLOT(reloadChannelEmotes())); moreMenu->addAction("Reconnect", this, SLOT(reconnect()));
menu->addAction("Reload subscriber emotes", this, moreMenu->addAction("Reload channel emotes", this,
SLOT(reloadSubscriberEmotes())); SLOT(reloadChannelEmotes()));
menu->addAction("Reconnect", this, SLOT(reconnect())); moreMenu->addAction("Reload subscriber emotes", this,
menu->addAction("Clear messages", this->split_, &Split::clear); SLOT(reloadSubscriberEmotes()));
// menu->addSeparator(); moreMenu->addSeparator();
// menu->addAction("Show changelog", this, SLOT(menuShowChangelog())); moreMenu->addAction("Clear messages", this->split_, &Split::clear);
// moreMenu->addSeparator();
// moreMenu->addAction("Show changelog", this,
// SLOT(moreMenuShowChangelog()));
menu->addMenu(moreMenu);
return menu; return menu;
} }