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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Sep 24 14:40:06 EEST 2007
Author: lucasr
Date: 2007-09-24 14:40:02 +0300 (Mon, 24 Sep 2007)
New Revision: 14029

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

	* src/hd-applications-menu.c (hd_applications_menu_changed,
	hd_applications_menu_init, hd_applications_menu_create_menu): load the
	menu structure after a certain delay to improve first-use UI feedback.


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-24 09:54:20 UTC (rev 14028)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-24 11:40:02 UTC (rev 14029)
@@ -1,5 +1,11 @@
 2007-09-24  Lucas Rocha  <lucas.rocha at nokia.com>
 
+	* src/hd-applications-menu.c (hd_applications_menu_changed,
+	hd_applications_menu_init, hd_applications_menu_create_menu): load the
+	menu structure after a certain delay to improve first-use UI feedback.
+
+2007-09-24  Lucas Rocha  <lucas.rocha at nokia.com>
+
 	* data/notification-groups.conf: set the correct D-Bus call for the
 	email notifications group.
 	* data/Makefile.am: install notification-groups.conf in hildon-desktop

Modified: projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c	2007-09-24 09:54:20 UTC (rev 14028)
+++ projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c	2007-09-24 11:40:02 UTC (rev 14029)
@@ -105,11 +105,13 @@
   GnomeVFSMonitorHandle    *home_dir_monitor;
   GnomeVFSMonitorHandle    *desktop_dir_monitor;
   guint                     monitor_update_timeout;
+  guint                     menu_update_timeout;
   gboolean                  focus_applications;
   gboolean                  motion_reset;
 };
 
 static void hd_applications_menu_register_monitors (HDApplicationsMenu *button);
+static gboolean hd_applications_menu_changed (HDApplicationsMenu *button);
 static void hd_applications_menu_create_menu (HDApplicationsMenu *button);
 static void hd_applications_menu_button_toggled (GtkWidget *widget, HDApplicationsMenu *button);
 static gboolean hd_applications_menu_button_button_press (GtkWidget *widget, GdkEventButton *event, HDApplicationsMenu *button);
@@ -213,6 +215,9 @@
   gtk_container_add (GTK_CONTAINER (button), priv->button);
 
   hd_applications_menu_register_monitors (button);
+
+  priv->menu_update_timeout =
+      g_timeout_add (8000, (GSourceFunc) hd_applications_menu_changed, button);
 }
 
 GtkWidget *
@@ -846,6 +851,12 @@
   
   g_return_if_fail (button);
 
+  if (button->priv->menu_update_timeout > 0)
+  {
+    g_source_remove (button->priv->menu_update_timeout);
+    button->priv->menu_update_timeout = 0;
+  }
+
   g_signal_handlers_block_by_func (button->priv->button,
   				   hd_applications_menu_button_toggled, 
   				   button);


More information about the maemo-commits mailing list