[maemo-commits] [maemo-commits] r11341 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Thu Apr 26 16:03:02 EEST 2007
- Previous message: [maemo-commits] r11340 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r11342 - projects/haf/tags/hildon-1/1.0.3-1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: lucasr Date: 2007-04-26 16:03:01 +0300 (Thu, 26 Apr 2007) New Revision: 11341 Modified: projects/haf/trunk/hildon-desktop/ChangeLog projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c Log: 2007-04-26 Lucas Rocha <lucas.rocha at nokia.com> * libhildondesktop/hildon-desktop-notification-manager.c: generalize the dbus callback support so that dbus callbacks can be associated with any notification action. Modified: projects/haf/trunk/hildon-desktop/ChangeLog =================================================================== --- projects/haf/trunk/hildon-desktop/ChangeLog 2007-04-26 12:59:10 UTC (rev 11340) +++ projects/haf/trunk/hildon-desktop/ChangeLog 2007-04-26 13:03:01 UTC (rev 11341) @@ -1,3 +1,9 @@ +2007-04-26 Lucas Rocha <lucas.rocha at nokia.com> + + * libhildondesktop/hildon-desktop-notification-manager.c: generalize + the dbus callback support so that dbus callbacks can be associated + with any notification action. + 2007-04-26 Johan Bilien <johan.bilien at nokia.com> * configure.ac: 0.0.10 Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c =================================================================== --- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c 2007-04-26 12:59:10 UTC (rev 11340) +++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-notification-manager.c 2007-04-26 13:03:01 UTC (rev 11341) @@ -156,25 +156,19 @@ static DBusMessage * hildon_desktop_notification_manager_create_signal (HildonDesktopNotificationManager *nm, - guint id, + GtkTreeIter *iter, const char *signal_name) { DBusMessage *message; - GtkTreeIter iter; gchar *dest; + gint id; + + gtk_tree_model_get (GTK_TREE_MODEL (nm), + iter, + HD_NM_COL_SENDER, &dest, + HD_NM_COL_ID, &id, + -1); - if (hildon_desktop_notification_manager_find_by_id (nm, id, &iter)) - { - gtk_tree_model_get (GTK_TREE_MODEL (nm), - &iter, - HD_NM_COL_SENDER, &dest, - -1); - } - else - { - return NULL; - } - g_assert(dest != NULL); message = dbus_message_new_signal ("/org/freedesktop/Notifications", @@ -204,7 +198,7 @@ HD_NM_COL_ID, &id, -1); - message = hildon_desktop_notification_manager_create_signal (nm, id, "NotificationClosed"); + message = hildon_desktop_notification_manager_create_signal (nm, iter, "NotificationClosed"); if (message == NULL) return; @@ -530,6 +524,10 @@ DBusMessage *message; gchar **message_elements; gint n_elements; + + g_debug ("######################################### DBUS CALLBACK ##########################################"); + g_debug (desc); + g_debug ("######################################### DBUS CALLBACK ##########################################"); message_elements = g_strsplit (desc, " ", 5); @@ -587,39 +585,40 @@ const gchar *action_id) { DBusMessage *message = NULL; + GHashTable *hints; + GtkTreeIter iter; - if (g_str_equal (action_id, "default")) + if (hildon_desktop_notification_manager_find_by_id (nm, id, &iter)) { - GHashTable *hints; - GtkTreeIter iter; + GValue *dbus_cb; + gchar *hint; + + gtk_tree_model_get (GTK_TREE_MODEL (nm), + &iter, + HD_NM_COL_HINTS, &hints, + -1); - if (hildon_desktop_notification_manager_find_by_id (nm, id, &iter)) + hint = g_strconcat ("dbus-callback-", action_id, NULL); + + dbus_cb = (GValue *) g_hash_table_lookup (hints, hint); + + if (dbus_cb != NULL) { - GValue *dbus_cb; - - gtk_tree_model_get (GTK_TREE_MODEL (nm), - &iter, - HD_NM_COL_HINTS, &hints, - -1); + message = hildon_desktop_notification_manager_message_from_desc (nm, + (const gchar *) g_value_get_string (dbus_cb)); + } - dbus_cb = (GValue *) g_hash_table_lookup (hints, "dbus-callback"); - - if (dbus_cb != NULL) - { - message = hildon_desktop_notification_manager_message_from_desc (nm, - (const gchar *) g_value_get_string (dbus_cb)); - } - - if (message != NULL) - { - dbus_connection_send (dbus_g_connection_get_connection (nm->priv->connection), - message, - NULL); - } + if (message != NULL) + { + dbus_connection_send (dbus_g_connection_get_connection (nm->priv->connection), + message, + NULL); } + + g_free (hint); } - message = hildon_desktop_notification_manager_create_signal (nm, id, "ActionInvoked"); + message = hildon_desktop_notification_manager_create_signal (nm, &iter, "ActionInvoked"); g_assert (message != NULL);
- Previous message: [maemo-commits] r11340 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r11342 - projects/haf/tags/hildon-1/1.0.3-1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]