Show notifications on Windows

Fixes #20
This commit is contained in:
Martin Briza 2017-03-09 18:26:12 +01:00
parent 35e73606fa
commit 6ca46439db
3 changed files with 10 additions and 1 deletions

View File

@ -84,6 +84,7 @@ macx {
win32 {
HEADERS += windrivemanager.h
SOURCES += windrivemanager.cpp
RESOURCES += windowsicon.qrc
# Until I find out how (or if it's even possible at all) to run a privileged process from an unprivileged one, the main binary will be privileged too
DISTFILES += windows.manifest

View File

@ -48,7 +48,10 @@ void Notifications::notify(const QString &title, const QString &body) {
#ifdef _WIN32
void Notifications::notify(const QString &title, const QString &body) {
Q_UNUSED(title); Q_UNUSED(body);
static QSystemTrayIcon *icon = new QSystemTrayIcon(QIcon(":/icon.ico"));
if (!icon->isVisible())
icon->show();
icon->showMessage(title, body);
}
#endif // _WIN32

5
app/windowsicon.qrc Normal file
View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file alias="icon.ico">assets/icon/mediawriter.ico</file>
</qresource>
</RCC>