summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-03-30 16:16:44 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-03-30 16:16:44 -0400
commit9f913cd3afae0be1a256c5c6d9dd1c11f8e093ad (patch)
treedfd4a4e2dae1c292a6f1eaea7fe56df622f1d9c9
parent7ae25149c7fa7f05817c8eae940c3ef9a1c7a1b7 (diff)
downloadenlightenment-9f913cd3afae0be1a256c5c6d9dd1c11f8e093ad.tar.gz
track offline/presentation mode notification ids and replace on toggle
-rw-r--r--src/modules/notification/e_mod_main.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/modules/notification/e_mod_main.c b/src/modules/notification/e_mod_main.c
index 58ecc156bd..b5c8104ec8 100644
--- a/src/modules/notification/e_mod_main.c
+++ b/src/modules/notification/e_mod_main.c
@@ -10,6 +10,9 @@ Config *notification_cfg = NULL;
static E_Config_DD *conf_edd = NULL;
+static unsigned int offline_id;
+static unsigned int pres_id;
+
static unsigned int
_notification_notify(E_Notification_Notify *n)
{
@@ -25,19 +28,27 @@ _notification_notify(E_Notification_Notify *n)
}
static void
+_notification_id_update(void *d, unsigned int id)
+{
+ uintptr_t *update_id = d;
+
+ *update_id = id;
+}
+
+static void
_notification_show_common(const char *summary,
const char *body,
- int replaces_id)
+ unsigned int *update_id)
{
E_Notification_Notify n;
memset(&n, 0, sizeof(E_Notification_Notify));
n.app_name = "enlightenment";
- n.replaces_id = replaces_id;
+ n.replaces_id = *update_id;
n.icon.icon = "enlightenment";
n.summary = summary;
n.body = body;
n.urgency = E_NOTIFICATION_NOTIFY_URGENCY_CRITICAL;
- e_notification_client_send(&n, NULL, NULL);
+ e_notification_client_send(&n, _notification_id_update, update_id);
}
static void
@@ -60,7 +71,7 @@ _notification_show_presentation(Eina_Bool enabled)
"power saving settings will be restored.");
}
- _notification_show_common(summary, body, -1);
+ _notification_show_common(summary, body, &pres_id);
}
static void
@@ -83,7 +94,7 @@ _notification_show_offline(Eina_Bool enabled)
"resume regular tasks.");
}
- _notification_show_common(summary, body, -1);
+ _notification_show_common(summary, body, &offline_id);
}
static Eina_Bool