Commit ec43d366 authored by mvogt's avatar mvogt

[fingerterm] Use libnemonotifications rather than MNotification

MNotification is no longer maintained.
parent d1463903
QT = core gui qml quick dbus feedback
CONFIG += link_pkgconfig
PKGCONFIG += nemonotifications-qt5
contains(MEEGO_EDITION,harmattan): {
CONFIG += meegotouch
}
......
......@@ -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);
......
......@@ -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
......
......@@ -34,6 +34,10 @@
#include <QFeedbackEffect>
#ifdef MEEGO_EDITION_HARMATTAN
#include <notification.h>
#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<MNotification*> notifs = MNotification::notifications();
foreach(MNotification* n, notifs) {
if( n->remove() )
delete n;
foreach( QObject *obj, Notification::notifications() ) {
if( Notification *notif = qobject_cast<Notification *>(obj) ) {
notif->close();
}
delete obj;
}
#endif //MEEGO_EDITION_HARMATTAN
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment