You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
737 B

#include "notifications.hpp"
#include "systemnotification.h"
#include "mainwindow.hpp"
#include "ui_mainwindow.h"
#include <QApplication>
void notifications::notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon) {
if (!MainWindow::inst() || !MainWindow::inst()->valid()) return;
notifyNolog(title, body, icon);
MainWindow::inst()->ui->logBox->addItem(title + ": " + body);
}
void notifications::notifyNolog(QString title, QString body, QSystemTrayIcon::MessageIcon icon) {
if(icon == QSystemTrayIcon::Critical) {
QApplication::alert(MainWindow::inst());
}
SystemNotification().sendMessage(body, title, icon);
MainWindow::inst()->statusBar()->showMessage(title + ": " + body);
}