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