Cleaner flashing code (#774)
This commit is contained in:
@@ -180,13 +180,7 @@ void NotificationController::getFakeTwitchChannelLiveStatus(
|
||||
getApp()->notifications->playSound();
|
||||
}
|
||||
if (getSettings()->notificationFlashTaskbar) {
|
||||
if (getSettings()->longAlerts) {
|
||||
QApplication::alert(
|
||||
getApp()->windows->getMainWindow().window(), 0);
|
||||
} else {
|
||||
QApplication::alert(
|
||||
getApp()->windows->getMainWindow().window(), 2500);
|
||||
}
|
||||
getApp()->windows->sendAlert();
|
||||
}
|
||||
}
|
||||
return Success;
|
||||
|
||||
@@ -408,14 +408,7 @@ void TwitchChannel::setLive(bool newLiveStatus)
|
||||
getApp()->notifications->playSound();
|
||||
}
|
||||
if (getSettings()->notificationFlashTaskbar) {
|
||||
if (getSettings()->longAlerts) {
|
||||
QApplication::alert(
|
||||
getApp()->windows->getMainWindow().window(), 0);
|
||||
} else {
|
||||
QApplication::alert(
|
||||
getApp()->windows->getMainWindow().window(),
|
||||
2500);
|
||||
}
|
||||
getApp()->windows->sendAlert();
|
||||
}
|
||||
}
|
||||
auto live = makeSystemMessage(this->getName() + " is live");
|
||||
|
||||
@@ -788,13 +788,7 @@ void TwitchMessageBuilder::parseHighlights(bool isPastMsg)
|
||||
}
|
||||
|
||||
if (doAlert) {
|
||||
if (getSettings()->longAlerts) {
|
||||
QApplication::alert(
|
||||
getApp()->windows->getMainWindow().window(), 0);
|
||||
} else {
|
||||
QApplication::alert(
|
||||
getApp()->windows->getMainWindow().window(), 2500);
|
||||
}
|
||||
getApp()->windows->sendAlert();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,6 +444,16 @@ void WindowManager::save()
|
||||
file.flush();
|
||||
}
|
||||
|
||||
void WindowManager::sendAlert()
|
||||
{
|
||||
int flashDuration = 2500;
|
||||
if (getSettings()->longAlerts) {
|
||||
flashDuration = 0;
|
||||
}
|
||||
QApplication::alert(getApp()->windows->getMainWindow().window(),
|
||||
flashDuration);
|
||||
}
|
||||
|
||||
void WindowManager::encodeNodeRecusively(SplitNode *node, QJsonObject &obj)
|
||||
{
|
||||
switch (node->getType()) {
|
||||
|
||||
@@ -61,6 +61,8 @@ public:
|
||||
|
||||
pajlada::Signals::NoArgSignal wordFlagsChanged;
|
||||
|
||||
void sendAlert();
|
||||
|
||||
private:
|
||||
void encodeNodeRecusively(SplitContainer::Node *node, QJsonObject &obj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user