WIP notification settings, doesn't actually work

This commit is contained in:
apa420
2018-08-09 15:41:03 +02:00
parent 7a9af4ae84
commit b68c7ded5f
11 changed files with 230 additions and 3 deletions
+15
View File
@@ -2,6 +2,7 @@
#include "Application.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/notifications/NotificationController.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "singletons/Resources.hpp"
@@ -154,6 +155,20 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
&Split::openInPopupPlayer);
#endif
menu->addAction("Open streamlink", this->split_, &Split::openInStreamlink);
auto action = new QAction(this);
action->setText("Notify when live");
action->setCheckable(true);
QObject::connect(menu.get(), &QMenu::aboutToShow, this, [action, this]() {
action->setChecked(getApp()->notifications->isChannelNotified(
this->split_->getChannel()->getName()));
});
action->connect(action, &QAction::triggered, this, [this]() {
getApp()->notifications->updateChannelNotification(
this->split_->getChannel()->getName());
});
menu->addAction(action);
menu->addSeparator();
menu->addAction("Reload channel emotes", this,
SLOT(menuReloadChannelEmotes()));