Adds option to mute ping sound for specific channels (#990)

Co-Authored-By: hemirt <hemirt@hemirt.com>
This commit is contained in:
hemirt
2019-05-10 22:36:37 +02:00
committed by pajlada
parent 9654650bee
commit c43c1dc207
9 changed files with 195 additions and 3 deletions
+18
View File
@@ -4,6 +4,7 @@
#include "controllers/accounts/AccountController.hpp"
#include "controllers/moderationactions/ModerationActions.hpp"
#include "controllers/notifications/NotificationController.hpp"
#include "controllers/pings/PingController.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
#include "singletons/Resources.hpp"
@@ -297,6 +298,23 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
moreMenu->addAction(action);
{
auto action = new QAction(this);
action->setText("Mute highlight sound");
action->setCheckable(true);
QObject::connect(moreMenu, &QMenu::aboutToShow, this, [action, this]() {
action->setChecked(getApp()->pings->isMuted(
this->split_->getChannel()->getName()));
});
action->connect(action, &QAction::triggered, this, [this]() {
getApp()->pings->toggleMuteChannel(
this->split_->getChannel()->getName());
});
moreMenu->addAction(action);
}
moreMenu->addSeparator();
moreMenu->addAction("Reconnect", this, SLOT(reconnect()));
moreMenu->addAction("Reload channel emotes", this,