2017-04-25 22:17:36 +02:00
|
|
|
#include "notifications.hpp"
|
|
|
|
|
|
|
|
#include "mainwindow.hpp"
|
2017-06-22 17:41:29 +02:00
|
|
|
#include "ui_mainwindow.h"
|
2017-04-25 22:17:36 +02:00
|
|
|
#include <QStatusBar>
|
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
void notifications::notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon) {
|
2017-06-22 17:41:29 +02:00
|
|
|
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) {
|
2017-05-22 15:56:47 +02:00
|
|
|
if (!MainWindow::inst()) return;
|
2017-05-09 17:26:00 +02:00
|
|
|
MainWindow::inst()->tray->showMessage(title, body, icon, 5000);
|
|
|
|
MainWindow::inst()->statusBar()->showMessage(title + ": " + body);
|
2017-04-25 22:17:36 +02:00
|
|
|
}
|