[maemo-commits] [maemo-commits] r11751 - in projects/haf/trunk/hildon-desktop: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue May 22 14:01:01 EEST 2007
Author: lucasr
Date: 2007-05-22 14:00:58 +0300 (Tue, 22 May 2007)
New Revision: 11751

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/src/hd-desktop.c
Log:
2007-05-22  Lucas Rocha  <lucas.rocha at nokia.com>

	* src/hd-desktop.c: handle system note dialog queuing on explicit
	response and notification close.


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-05-22 10:49:35 UTC (rev 11750)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-05-22 11:00:58 UTC (rev 11751)
@@ -1,5 +1,10 @@
 2007-05-22  Lucas Rocha  <lucas.rocha at nokia.com>
 
+	* src/hd-desktop.c: handle system note dialog queuing on explicit
+	response and notification close.
+
+2007-05-22  Lucas Rocha  <lucas.rocha at nokia.com>
+
 	* src/hd-desktop.c,
 	libhildondesktop/hildon-desktop-notification-manager.c: implement new
 	kind of system note dialog with a progress bar.

Modified: projects/haf/trunk/hildon-desktop/src/hd-desktop.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-desktop.c	2007-05-22 10:49:35 UTC (rev 11750)
+++ projects/haf/trunk/hildon-desktop/src/hd-desktop.c	2007-05-22 11:00:58 UTC (rev 11751)
@@ -135,8 +135,6 @@
                      APP_LAUNCH_BANNER_MSG_LOADING),
                      lapp_name ? _(lapp_name) : "" );
 
-  g_debug ("Launching banner %s...",info->msg);
-
   info->banner = GTK_WIDGET (hildon_banner_show_animation (NULL, NULL, info->msg));
 
   g_timeout_add (interval, hd_desktop_launch_banner_timeout, info);
@@ -1058,32 +1056,14 @@
 
   return banner;
 }
-	
+
 static void
-hd_desktop_system_notification_dialog_response (GtkWidget *widget,
-	       					gint response,	
-		                                HDDesktopNotificationInfo *ninfo)
+hd_desktop_show_next_system_dialog (HDDesktop *desktop)
 {
-  HildonDesktopNotificationManager *nm;
-  HDDesktop *desktop;
   GtkWidget *next_dialog = NULL;
 
-  desktop = ninfo->desktop;
-
-  nm = (HildonDesktopNotificationManager *) 
-	  gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (desktop->priv->nm));
-
-  hildon_desktop_notification_manager_call_action (nm, ninfo->id, "default");
-  hildon_desktop_notification_manager_close_notification (nm, ninfo->id, NULL);
-  
-  g_free (ninfo);
-
   g_queue_pop_head (desktop->priv->dialog_queue);
-  gtk_widget_destroy (widget);
 
-  g_debug ("DIALOG QUEUE: %d", g_queue_get_length (desktop->priv->dialog_queue));
-    
-  /* Show next system notification dialog if present */
   while (!g_queue_is_empty (desktop->priv->dialog_queue))
   {
     next_dialog = (GtkWidget *) g_queue_peek_head (desktop->priv->dialog_queue);
@@ -1100,6 +1080,33 @@
   }
 }
 
+static void
+hd_desktop_system_notification_dialog_destroy (GtkWidget *widget, HDDesktop *desktop)
+{
+  hd_desktop_show_next_system_dialog (desktop);
+}
+	
+static void
+hd_desktop_system_notification_dialog_response (GtkWidget *widget,
+	       					gint response,	
+		                                HDDesktopNotificationInfo *ninfo)
+{
+  HildonDesktopNotificationManager *nm;
+  HDDesktop *desktop;
+
+  desktop = ninfo->desktop;
+
+  nm = (HildonDesktopNotificationManager *) 
+	  gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (desktop->priv->nm));
+
+  hildon_desktop_notification_manager_call_action (nm, ninfo->id, "default");
+  hildon_desktop_notification_manager_close_notification (nm, ninfo->id, NULL);
+  
+  g_free (ninfo);
+
+  gtk_widget_destroy (widget);
+}
+
 static gboolean
 hd_desktop_pulsate_progress_bar (gpointer user_data)
 {
@@ -1246,6 +1253,11 @@
   		      G_CALLBACK (hd_desktop_system_notification_dialog_response),
   		      ninfo);
 
+    g_signal_connect (G_OBJECT (notification),
+  		      "destroy",
+  		      G_CALLBACK (hd_desktop_system_notification_dialog_destroy),
+  		      desktop);
+
     if (g_queue_is_empty (desktop->priv->dialog_queue))
     {
       gtk_widget_show_all (notification);


More information about the maemo-commits mailing list