From f990ecfc2248fbe79f4354e1190d6ea70cb66928 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Wed, 31 Jan 2024 16:29:37 +0300 Subject: [PATCH] UI: TrayIcon: Send alert message for each event --- src/ui/form/tray/trayicon.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui/form/tray/trayicon.cpp b/src/ui/form/tray/trayicon.cpp index 295b80cd..fa7fe994 100644 --- a/src/ui/form/tray/trayicon.cpp +++ b/src/ui/form/tray/trayicon.cpp @@ -176,8 +176,10 @@ TrayIcon::TrayIcon(QObject *parent) : QSystemTrayIcon(parent), m_ctrl(new TrayCo connect(confManager(), &ConfManager::confChanged, this, &TrayIcon::updateTrayMenu); connect(confManager(), &ConfManager::iniUserChanged, this, &TrayIcon::setupByIniUser); - connect(confAppManager(), &ConfAppManager::appAlerted, this, - [&] { updateTrayIcon(/*alerted=*/true); }); + connect(confAppManager(), &ConfAppManager::appAlerted, this, [&] { + updateTrayIcon(/*alerted=*/true); + sendAlertMessage(); + }); connect(driverManager(), &DriverManager::isDeviceOpenedChanged, this, &TrayIcon::updateTrayIconShape); @@ -259,9 +261,7 @@ void TrayIcon::updateTrayIcon(bool alerted) m_alerted = alerted; m_animatedAlert = false; - sendAlertMessage(); updateAlertTimer(); - updateTrayIconShape(); } @@ -548,7 +548,7 @@ void TrayIcon::updateAppGroupActions() void TrayIcon::sendAlertMessage() { - if (!(m_alerted && iniUser()->progNotifyMessage())) + if (!iniUser()->progNotifyMessage()) return; windowManager()->showTrayMessage(tr("New program detected!"), WindowManager::TrayMessageAlert);