mirror of
https://github.com/ysoftdevs/Testa.git
synced 2026-01-14 23:53:25 +01:00
Initial Testa commit
This commit is contained in:
19
notification.cpp
Normal file
19
notification.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
#include "notification.h"
|
||||
|
||||
static QSystemTrayIcon* sharedSystemTrayIcon;
|
||||
|
||||
void Notification::show(const std::string& title, const std::string& message)
|
||||
{
|
||||
if (sharedSystemTrayIcon == nullptr)
|
||||
sharedSystemTrayIcon = new QSystemTrayIcon();
|
||||
sharedSystemTrayIcon->show();
|
||||
sharedSystemTrayIcon->showMessage(QString::fromStdString(title), QString::fromStdString(message));
|
||||
}
|
||||
|
||||
void Notification::hide()
|
||||
{
|
||||
sharedSystemTrayIcon->hide();
|
||||
delete sharedSystemTrayIcon;
|
||||
}
|
||||
Reference in New Issue
Block a user