aboutsummaryrefslogtreecommitdiff
path: root/notifications.cpp
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2022-02-06 20:42:01 +0100
committerMiquel Lionel <lionel@les-miquelots.net>2022-02-06 20:57:27 +0100
commitd5ad7202ea77e8a512073f9ce09b6c07e37d6305 (patch)
tree167141728086401a50a125a20997b61df41a2d2e /notifications.cpp
parenta01f8091c01889d7ca90938f56ae176a74da5590 (diff)
downloadkdeltachat-d5ad7202ea77e8a512073f9ce09b6c07e37d6305.tar.gz
kdeltachat-d5ad7202ea77e8a512073f9ce09b6c07e37d6305.zip
Move notifications to own header file
- also make a skel for files in /usr/, useful for sounds and notifyrc - build.sh use plain simple cp -r to copy the skel. also copies the knotifications5 in the current directory for qml.qrc embedding in case the app is used on android.
Diffstat (limited to 'notifications.cpp')
-rw-r--r--notifications.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/notifications.cpp b/notifications.cpp
new file mode 100644
index 0000000..712e37e
--- /dev/null
+++ b/notifications.cpp
@@ -0,0 +1,21 @@
+#include <KNotification>
+#include "notifications.h"
+
+DcNotifications::DcNotifications(QObject *parent)
+ : QObject{parent}
+{
+}
+
+void
+DcNotifications::send(QString event, QString pfpPath, QString title, QString message) {
+
+ KNotification *newMess = new KNotification(event);
+ newMess->setPixmap(QPixmap(pfpPath));
+ newMess->setIconName("chat.delta.KDeltaChat");
+ newMess->setComponentName("kdeltachat");
+ newMess->setTitle(title);
+ newMess->setText(message);
+ newMess->sendEvent();
+
+}
+//newMess->setPixmap(QPixmap(":/res/chat.delta.KDeltaChat.png"));