From 29955bd5952eed45cc82f4a2bb3880c3af97f0b3 Mon Sep 17 00:00:00 2001 From: apa420 Date: Sat, 6 Oct 2018 16:58:41 +0200 Subject: [PATCH] Added functionality of making the flash taskbar last until chatterino is focused again --- src/providers/twitch/TwitchMessageBuilder.cpp | 9 +++++++-- src/singletons/Settings.hpp | 5 ++++- src/widgets/settingspages/HighlightingPage.cpp | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 7589d54d0..16c967b1a 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -788,8 +788,13 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg) } if (doAlert) { - QApplication::alert(getApp()->windows->getMainWindow().window(), - 2500); + if (getSettings()->longAlerts) { + QApplication::alert( + getApp()->windows->getMainWindow().window(), 0); + } else { + QApplication::alert( + getApp()->windows->getMainWindow().window(), 2500); + } } } } diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 5a2fae91a..491b0db81 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -117,7 +117,8 @@ public: BoolSetting enableLowercaseLink = {"/links/linkLowercase", true}; /// Ignored phrases - QStringSetting ignoredPhraseReplace = {"/ignore/ignoredPhraseReplace", "***"}; + QStringSetting ignoredPhraseReplace = {"/ignore/ignoredPhraseReplace", + "***"}; /// Ingored Users BoolSetting enableTwitchIgnoredUsers = {"/ignore/enableTwitchIgnoredUsers", @@ -143,6 +144,8 @@ public: "/highlighting/whisperHighlight/enableTaskbarFlashing", false}; QStringSetting highlightColor = {"/highlighting/color", "#4B282C"}; + BoolSetting longAlerts = {"/highlighting/alerts", false}; + /// Logging BoolSetting enableLogging = {"/logging/enabled", false}; diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index 8d8ce400d..eb49b3452 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -149,6 +149,9 @@ HighlightingPage::HighlightingPage() layout.append(createCheckBox(ALWAYS_PLAY, getSettings()->highlightAlwaysPlaySound)); + layout.append(createCheckBox( + "Flash taskbar only stops highlighting when chatterino is focused", + getSettings()->longAlerts)); } // ---- misc