diff --git a/fingerterm.pro b/fingerterm.pro index 789bcf5..b1deb62 100644 --- a/fingerterm.pro +++ b/fingerterm.pro @@ -1,5 +1,8 @@ QT = core gui qml quick dbus feedback +CONFIG += link_pkgconfig +PKGCONFIG += nemonotifications-qt5 + contains(MEEGO_EDITION,harmattan): { CONFIG += meegotouch } diff --git a/main.cpp b/main.cpp index 69232f3..99b11d0 100644 --- a/main.cpp +++ b/main.cpp @@ -51,6 +51,8 @@ int main(int argc, char *argv[]) QSettings *settings = new QSettings(QDir::homePath()+"/.config/FingerTerm/settings.ini", QSettings::IniFormat); defaultSettings(settings); + QCoreApplication::setApplicationName("Fingerterm"); + // fork the child process before creating QGuiApplication int socketM; int pid = forkpty(&socketM,NULL,NULL,NULL); diff --git a/rpm/fingerterm.spec b/rpm/fingerterm.spec index 8d83f71..1d8ae68 100644 --- a/rpm/fingerterm.spec +++ b/rpm/fingerterm.spec @@ -12,6 +12,7 @@ BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Qml) BuildRequires: pkgconfig(Qt5Quick) BuildRequires: pkgconfig(Qt0Feedback) +BuildRequires: pkgconfig(nemonotifications-qt5) >= 1.0.4 Requires: qt5-qtdeclarative-import-xmllistmodel Requires: qt5-qtdeclarative-import-window2 Requires: qt-components-qt5 diff --git a/util.cpp b/util.cpp index af4043b..4fa1109 100644 --- a/util.cpp +++ b/util.cpp @@ -34,6 +34,10 @@ #include +#ifdef MEEGO_EDITION_HARMATTAN +#include +#endif + Util::Util(QSettings *settings, QObject *parent) : QObject(parent), iAllowGestures(false), @@ -228,30 +232,30 @@ void Util::bellAlert() if(settingsValue("general/backgroundBellNotify").toBool() && !iWindow->hasFocus()) { - MRemoteAction act(MComponentData::instance()->serviceName(), - "/org/maemo/m", - "com.nokia.MApplicationIf", - "launch"); - MNotification notif(MNotification::ImReceivedEvent, "FingerTerm", "Terminal alert was received"); - notif.setImage("/usr/share/icons/hicolor/80x80/apps/fingerterm.png"); - notif.setAction(act); + Notification notif; + notif.setAppIcon("icon-l-terminal"); + notif.setUrgency(Notification::Normal); + notif.setExpireTimeout(0); + notif.setPreviewSummary(QCoreApplication::applicationName()); + // TODO: should be translated + notif.setPreviewBody("Terminal alert was received"); + notif.setRemoteAction(Notification::remoteAction("default", "", MComponentData::instance()->serviceName(), "/org/maemo/m", "com.nokia.MApplicationIf", "launch")); notif.publish(); - } else if( settingsValue("general/visualBell").toBool() ) { + } else +#endif //MEEGO_EDITION_HARMATTAN + if( settingsValue("general/visualBell").toBool() ) { emit visualBell(); } -#else - if( settingsValue("general/visualBell").toBool() ) - emit visualBell(); -#endif } void Util::clearNotifications() { #ifdef MEEGO_EDITION_HARMATTAN - QList notifs = MNotification::notifications(); - foreach(MNotification* n, notifs) { - if( n->remove() ) - delete n; + foreach( QObject *obj, Notification::notifications() ) { + if( Notification *notif = qobject_cast(obj) ) { + notif->close(); + } + delete obj; } #endif //MEEGO_EDITION_HARMATTAN }