mirror of
https://github.com/tnodir/fort
synced 2024-11-15 13:06:36 +00:00
UI: TrayIcon: Send alert message for each event
This commit is contained in:
parent
08e826075b
commit
f990ecfc22
@ -176,8 +176,10 @@ TrayIcon::TrayIcon(QObject *parent) : QSystemTrayIcon(parent), m_ctrl(new TrayCo
|
|||||||
connect(confManager(), &ConfManager::confChanged, this, &TrayIcon::updateTrayMenu);
|
connect(confManager(), &ConfManager::confChanged, this, &TrayIcon::updateTrayMenu);
|
||||||
connect(confManager(), &ConfManager::iniUserChanged, this, &TrayIcon::setupByIniUser);
|
connect(confManager(), &ConfManager::iniUserChanged, this, &TrayIcon::setupByIniUser);
|
||||||
|
|
||||||
connect(confAppManager(), &ConfAppManager::appAlerted, this,
|
connect(confAppManager(), &ConfAppManager::appAlerted, this, [&] {
|
||||||
[&] { updateTrayIcon(/*alerted=*/true); });
|
updateTrayIcon(/*alerted=*/true);
|
||||||
|
sendAlertMessage();
|
||||||
|
});
|
||||||
|
|
||||||
connect(driverManager(), &DriverManager::isDeviceOpenedChanged, this,
|
connect(driverManager(), &DriverManager::isDeviceOpenedChanged, this,
|
||||||
&TrayIcon::updateTrayIconShape);
|
&TrayIcon::updateTrayIconShape);
|
||||||
@ -259,9 +261,7 @@ void TrayIcon::updateTrayIcon(bool alerted)
|
|||||||
m_alerted = alerted;
|
m_alerted = alerted;
|
||||||
m_animatedAlert = false;
|
m_animatedAlert = false;
|
||||||
|
|
||||||
sendAlertMessage();
|
|
||||||
updateAlertTimer();
|
updateAlertTimer();
|
||||||
|
|
||||||
updateTrayIconShape();
|
updateTrayIconShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -548,7 +548,7 @@ void TrayIcon::updateAppGroupActions()
|
|||||||
|
|
||||||
void TrayIcon::sendAlertMessage()
|
void TrayIcon::sendAlertMessage()
|
||||||
{
|
{
|
||||||
if (!(m_alerted && iniUser()->progNotifyMessage()))
|
if (!iniUser()->progNotifyMessage())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
windowManager()->showTrayMessage(tr("New program detected!"), WindowManager::TrayMessageAlert);
|
windowManager()->showTrayMessage(tr("New program detected!"), WindowManager::TrayMessageAlert);
|
||||||
|
Loading…
Reference in New Issue
Block a user