Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com> Co-authored-by: nerix <nerixdev@outlook.de>
This commit is contained in:
@@ -541,59 +541,64 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
h->getDisplaySequence(HotkeyCategory::Split,
|
||||
"openSubscriptionPage"));
|
||||
|
||||
auto *action = new QAction(this);
|
||||
action->setText("Notify when live");
|
||||
action->setCheckable(true);
|
||||
|
||||
auto notifySeq = h->getDisplaySequence(
|
||||
HotkeyCategory::Split, "setChannelNotification", {{"toggle"}});
|
||||
if (notifySeq.isEmpty())
|
||||
{
|
||||
notifySeq = h->getDisplaySequence(HotkeyCategory::Split,
|
||||
"setChannelNotification",
|
||||
{std::vector<QString>()});
|
||||
// this makes a full std::optional<> with an empty vector inside
|
||||
auto *action = new QAction(this);
|
||||
action->setText("Notify when live");
|
||||
action->setCheckable(true);
|
||||
|
||||
auto notifySeq = h->getDisplaySequence(
|
||||
HotkeyCategory::Split, "setChannelNotification", {{"toggle"}});
|
||||
if (notifySeq.isEmpty())
|
||||
{
|
||||
notifySeq = h->getDisplaySequence(HotkeyCategory::Split,
|
||||
"setChannelNotification",
|
||||
{std::vector<QString>()});
|
||||
// this makes a full std::optional<> with an empty vector inside
|
||||
}
|
||||
action->setShortcut(notifySeq);
|
||||
|
||||
QObject::connect(
|
||||
moreMenu, &QMenu::aboutToShow, this, [action, this]() {
|
||||
action->setChecked(
|
||||
getApp()->getNotifications()->isChannelNotified(
|
||||
this->split_->getChannel()->getName(),
|
||||
Platform::Twitch));
|
||||
});
|
||||
QObject::connect(action, &QAction::triggered, this, [this]() {
|
||||
getApp()->getNotifications()->updateChannelNotification(
|
||||
this->split_->getChannel()->getName(), Platform::Twitch);
|
||||
});
|
||||
|
||||
moreMenu->addAction(action);
|
||||
}
|
||||
action->setShortcut(notifySeq);
|
||||
|
||||
QObject::connect(moreMenu, &QMenu::aboutToShow, this, [action, this]() {
|
||||
action->setChecked(getApp()->getNotifications()->isChannelNotified(
|
||||
this->split_->getChannel()->getName(), Platform::Twitch));
|
||||
});
|
||||
QObject::connect(action, &QAction::triggered, this, [this]() {
|
||||
getApp()->getNotifications()->updateChannelNotification(
|
||||
this->split_->getChannel()->getName(), Platform::Twitch);
|
||||
});
|
||||
|
||||
moreMenu->addAction(action);
|
||||
}
|
||||
|
||||
if (twitchChannel)
|
||||
{
|
||||
auto *action = new QAction(this);
|
||||
action->setText("Mute highlight sounds");
|
||||
action->setCheckable(true);
|
||||
|
||||
auto notifySeq = h->getDisplaySequence(
|
||||
HotkeyCategory::Split, "setHighlightSounds", {{"toggle"}});
|
||||
if (notifySeq.isEmpty())
|
||||
{
|
||||
notifySeq = h->getDisplaySequence(HotkeyCategory::Split,
|
||||
"setHighlightSounds",
|
||||
{std::vector<QString>()});
|
||||
auto *action = new QAction(this);
|
||||
action->setText("Mute highlight sounds");
|
||||
action->setCheckable(true);
|
||||
|
||||
auto notifySeq = h->getDisplaySequence(
|
||||
HotkeyCategory::Split, "setHighlightSounds", {{"toggle"}});
|
||||
if (notifySeq.isEmpty())
|
||||
{
|
||||
notifySeq = h->getDisplaySequence(HotkeyCategory::Split,
|
||||
"setHighlightSounds",
|
||||
{std::vector<QString>()});
|
||||
}
|
||||
action->setShortcut(notifySeq);
|
||||
|
||||
QObject::connect(
|
||||
moreMenu, &QMenu::aboutToShow, this, [action, this]() {
|
||||
action->setChecked(getSettings()->isMutedChannel(
|
||||
this->split_->getChannel()->getName()));
|
||||
});
|
||||
QObject::connect(action, &QAction::triggered, this, [this]() {
|
||||
getSettings()->toggleMutedChannel(
|
||||
this->split_->getChannel()->getName());
|
||||
});
|
||||
|
||||
moreMenu->addAction(action);
|
||||
}
|
||||
action->setShortcut(notifySeq);
|
||||
|
||||
QObject::connect(moreMenu, &QMenu::aboutToShow, this, [action, this]() {
|
||||
action->setChecked(getSettings()->isMutedChannel(
|
||||
this->split_->getChannel()->getName()));
|
||||
});
|
||||
QObject::connect(action, &QAction::triggered, this, [this]() {
|
||||
getSettings()->toggleMutedChannel(
|
||||
this->split_->getChannel()->getName());
|
||||
});
|
||||
|
||||
moreMenu->addAction(action);
|
||||
}
|
||||
|
||||
moreMenu->addSeparator();
|
||||
|
||||
Reference in New Issue
Block a user