summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-06 15:57:43 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-06 15:57:43 (GMT)
commite37c3ee4c166fdcf3ad856da6bd37fbd1254cbc1 (patch)
tree58d9469dff48f34f2aca029488c5293ac7b3d40e
parenta4751fe5550c3b678c8df8e073112088183bd905 (diff)
New notification system that can work for both desktop and mobile version
-rw-r--r--kstars/auxiliary/ksnotification.cpp47
-rw-r--r--kstars/auxiliary/ksnotification.h23
2 files changed, 70 insertions, 0 deletions
diff --git a/kstars/auxiliary/ksnotification.cpp b/kstars/auxiliary/ksnotification.cpp
new file mode 100644
index 0000000..e9c5695
--- /dev/null
+++ b/kstars/auxiliary/ksnotification.cpp
@@ -0,0 +1,47 @@
+/* General KStars Notifications for desktop and lite version
+ Copyright (C) 2016 Jasem Mutlaq (mutlaqja@ikarustech.com)
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+*/
+
+#include "ksnotification.h"
+
+#ifdef KSTARS_LITE
+#include "kstarslite.h"
+#else
+#include <KMessageBox>
+#endif
+
+namespace KSNotification
+{
+ void error(const QString &value)
+ {
+ #ifdef KSTARS_LITE
+ KStarsLite::Instance()->notificationMessage(value);
+ #else
+ KMessageBox::error(0, value);
+ #endif
+ }
+
+ void sorry(const QString &value)
+ {
+ #ifdef KSTARS_LITE
+ KStarsLite::Instance()->notificationMessage(value);
+ #else
+ KMessageBox::sorry(0, value);
+ #endif
+ }
+
+ void info(const QString &value)
+ {
+ #ifdef KSTARS_LITE
+ KStarsLite::Instance()->notificationMessage(value);
+ #else
+ KMessageBox::info(0, value);
+ #endif
+ }
+}
diff --git a/kstars/auxiliary/ksnotification.h b/kstars/auxiliary/ksnotification.h
new file mode 100644
index 0000000..92a0238
--- /dev/null
+++ b/kstars/auxiliary/ksnotification.h
@@ -0,0 +1,23 @@
+/* General KStars Notifications for desktop and lite version
+ Copyright (C) 2016 Jasem Mutlaq (mutlaqja@ikarustech.com)
+
+ This application is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+*/
+
+#ifndef KSNotifications_H
+#define KSNotifications_H
+
+#include <QString>
+
+namespace KSNotification
+{
+ void error(const QString &value);
+ void sorry(const QString &value);
+ void info(const QString &value);
+}
+
+#endif // KSNotifications_H