diff options
author | eugeni <eugeni@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2009-08-18 16:04:01 +0000 |
---|---|---|
committer | eugeni <eugeni@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2009-08-18 16:04:01 +0000 |
commit | 4f2a9fe09089f0a2d4f4c4822309fd238d1041e6 (patch) | |
tree | fc9b9e17bad6c30fb8e99b0e0e54e2f3c178c60e | |
parent | 3140f2091c88ee49793cee1822c869b192b03782 (diff) | |
download | s2u-4f2a9fe09089f0a2d4f4c4822309fd238d1041e6.tar s2u-4f2a9fe09089f0a2d4f4c4822309fd238d1041e6.tar.gz s2u-4f2a9fe09089f0a2d4f4c4822309fd238d1041e6.tar.bz2 s2u-4f2a9fe09089f0a2d4f4c4822309fd238d1041e6.tar.xz s2u-4f2a9fe09089f0a2d4f4c4822309fd238d1041e6.zip |
Support custom notifications (for netprofile).0.9.1
git-svn-id: svn+ssh://svn.mandriva.com/svn/soft/s2u/trunk@259384 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | s2u.c | 23 |
2 files changed, 24 insertions, 0 deletions
@@ -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, ...) @@ -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; } |