[maemo-commits] [maemo-commits] r12694 - in projects/haf/trunk/hildon-notify: . tests
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Jul 9 16:01:04 EEST 2007
- Previous message: [maemo-commits] r12693 - in projects/haf/trunk/hildon-theme-layout-4: . rc
- Next message: [maemo-commits] r12695 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: lucasr Date: 2007-07-09 16:00:58 +0300 (Mon, 09 Jul 2007) New Revision: 12694 Added: projects/haf/trunk/hildon-notify/tests/test-led-pattern.c Modified: projects/haf/trunk/hildon-notify/ChangeLog Log: 2007-07-09 Lucas Rocha <lucas.rocha at nokia.com> * tests/test-led-pattern.c: added new test program for led patterns. Modified: projects/haf/trunk/hildon-notify/ChangeLog =================================================================== --- projects/haf/trunk/hildon-notify/ChangeLog 2007-07-09 12:06:25 UTC (rev 12693) +++ projects/haf/trunk/hildon-notify/ChangeLog 2007-07-09 13:00:58 UTC (rev 12694) @@ -1,3 +1,7 @@ +2007-07-09 Lucas Rocha <lucas.rocha at nokia.com> + + * tests/test-led-pattern.c: added new test program for led patterns. + 2007-06-15 Lucas Rocha <lucas.rocha at nokia.com> * tests/test-sound.c: added new test program for sound. Added: projects/haf/trunk/hildon-notify/tests/test-led-pattern.c =================================================================== --- projects/haf/trunk/hildon-notify/tests/test-led-pattern.c 2007-07-09 12:06:25 UTC (rev 12693) +++ projects/haf/trunk/hildon-notify/tests/test-led-pattern.c 2007-07-09 13:00:58 UTC (rev 12694) @@ -0,0 +1,54 @@ +#include <glib.h> +#include <dbus/dbus.h> +#include <dbus/dbus-glib.h> +#include <dbus/dbus-glib-lowlevel.h> + +#include <hildon/hildon-notification.h> +#include <libnotify/notify.h> + +static GMainLoop *loop; + +void +closed (NotifyNotification *n, gpointer user_data) +{ + g_debug ("NOTIFICATION CLOSED!"); + + g_main_loop_quit (loop); +} + +int +main(int argc, char **argv) +{ + HildonNotification *n; + DBusConnection *conn; + + if (!notify_init ("D-Bus Action Test")) exit(1); + + conn = dbus_bus_get (DBUS_BUS_SESSION, NULL); + + loop = g_main_loop_new (NULL, FALSE); + + dbus_connection_setup_with_g_main (conn, NULL); + + n = hildon_notification_new ("John Doe", + "Hi! How are you!?", + "qgn_contact_group_chat_invitation", + "test"); + + notify_notification_set_hint_string (NOTIFY_NOTIFICATION (n), + "led-pattern", + "PatternCommunicationEmail"); + + g_signal_connect (G_OBJECT (n), "closed", G_CALLBACK (closed), NULL); + + if (!notify_notification_show (NOTIFY_NOTIFICATION (n), NULL)) + { + g_warning ("Failed to send notification"); + + return 1; + } + + g_main_loop_run (loop); + + return 0; +}
- Previous message: [maemo-commits] r12693 - in projects/haf/trunk/hildon-theme-layout-4: . rc
- Next message: [maemo-commits] r12695 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]