aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README1
-rw-r--r--s2u.c23
2 files changed, 24 insertions, 0 deletions
diff --git a/README b/README
index 380cac3..7947524 100644
--- a/README
+++ b/README
@@ -9,3 +9,4 @@ implemented actions are:
o react to hostname changes to continue to have a working X11 session.
o run update-menus if requested by the system
o display msec notifications
+ o display custom notifications (netprofile, ...)
diff --git a/s2u.c b/s2u.c
index 03ee852..4cb73c0 100644
--- a/s2u.c
+++ b/s2u.c
@@ -168,6 +168,29 @@ filter_function (DBusConnection * connection,
}
dbus_error_free(&error);
return DBUS_HANDLER_RESULT_HANDLED;
+ } else if (dbus_message_is_signal (message,
+ "com.mandriva.user",
+ "custom_notification")) {
+ /* msec */
+ char *string, *title;
+ DBusError error;
+ dbus_error_init(&error);
+ if (dbus_message_get_args (message,
+ &error,
+ DBUS_TYPE_STRING, &title,
+ DBUS_TYPE_STRING, &string,
+ DBUS_TYPE_INVALID)) {
+ n = notify_notification_new(title, string, GTK_STOCK_INFO, NULL);
+ if (!notify_notification_show (n, NULL)) {
+ g_printerr("notify_notification_show: failed to show notification\n");
+ }
+ g_object_unref(G_OBJECT(n));
+ }
+ else {
+ fprintf (stderr, "an error occurred: %s\n", error.message);
+ }
+ dbus_error_free(&error);
+ return DBUS_HANDLER_RESULT_HANDLED;
} else {
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}