mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-17 10:56:25 +00:00
fixed tray icon
This commit is contained in:
parent
2171ed455b
commit
964dacce52
@ -43,6 +43,7 @@ bool TrayIconNotifer::deinitialize()
|
|||||||
{
|
{
|
||||||
disconnect(m_trayIcon,SIGNAL(messageClicked()),this,SLOT(actionInvoked()));
|
disconnect(m_trayIcon,SIGNAL(messageClicked()),this,SLOT(actionInvoked()));
|
||||||
m_trayIcon = NULL;
|
m_trayIcon = NULL;
|
||||||
|
m_currentlyDisplaying = false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -52,16 +53,15 @@ bool TrayIconNotifer::deinitialize()
|
|||||||
void TrayIconNotifer::slotNotify( Notification notification )
|
void TrayIconNotifer::slotNotify( Notification notification )
|
||||||
{
|
{
|
||||||
m_notificationQue.append(notification);
|
m_notificationQue.append(notification);
|
||||||
qDebug() << notification << m_currentlyDisplaying;
|
displayNotification();
|
||||||
if(!m_currentlyDisplaying)
|
|
||||||
{
|
|
||||||
m_currentlyDisplaying = true;
|
|
||||||
displayNotification();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrayIconNotifer::displayNotification()
|
void TrayIconNotifer::displayNotification()
|
||||||
{
|
{
|
||||||
|
if(m_currentlyDisplaying)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(m_notificationQue.isEmpty())
|
if(m_notificationQue.isEmpty())
|
||||||
{
|
{
|
||||||
m_currentlyDisplaying = false;
|
m_currentlyDisplaying = false;
|
||||||
@ -80,19 +80,20 @@ void TrayIconNotifer::slotCloseNotificationByTimeout()
|
|||||||
if(n.isValid())
|
if(n.isValid())
|
||||||
{
|
{
|
||||||
closeNotification(n,NotificationEnums::CloseReasons::TIMED_OUT);
|
closeNotification(n,NotificationEnums::CloseReasons::TIMED_OUT);
|
||||||
|
m_currentlyDisplaying = false;
|
||||||
|
displayNotification();
|
||||||
}
|
}
|
||||||
displayNotification();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrayIconNotifer::actionInvoked()
|
void TrayIconNotifer::actionInvoked()
|
||||||
{
|
{
|
||||||
qDebug()<<"Traicon invoked"<<m_displayed;
|
|
||||||
|
|
||||||
Notification n = getActiveNotificationByID(m_displayed);
|
Notification n = getActiveNotificationByID(m_displayed);
|
||||||
if(n.isValid())
|
if(n.isValid())
|
||||||
{
|
{
|
||||||
snore()->d()->notificationActionInvoked(n);
|
snore()->d()->notificationActionInvoked(n);
|
||||||
closeNotification(n,NotificationEnums::CloseReasons::CLOSED);
|
closeNotification(n,NotificationEnums::CloseReasons::CLOSED);
|
||||||
|
m_currentlyDisplaying = false;
|
||||||
|
displayNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user