[maemo-commits] [maemo-commits] r8510 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop

From: www-data at stage.maemo.org www-data at stage.maemo.org
Date: Thu Nov 30 17:41:53 EET 2006
Author: jobi
Date: 2006-11-30 17:41:51 +0200 (Thu, 30 Nov 2006)
New Revision: 8510

Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-applet.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-area.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-titlebar.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-window.c
Log:

2006-11-30  Johan Bilien  <johan.bilien at nokia.com>

	* libhildonhome/hildon-home-area.c: fixes to correctly save
	the layout.
	* libhildonhome/hildon-home-window.c: go to layout mode when
	an applet is added



Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-11-30 15:21:03 UTC (rev 8509)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-11-30 15:41:51 UTC (rev 8510)
@@ -1,3 +1,10 @@
+2006-11-30  Johan Bilien  <johan.bilien at nokia.com>
+
+	* libhildonhome/hildon-home-area.c: fixes to correctly save
+	the layout.
+	* libhildonhome/hildon-home-window.c: go to layout mode when
+	an applet is added
+
 2006-11-30  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* src/hd-plugin-manager.c: do not gtk_widget_show_all plugins.

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-applet.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-applet.c	2006-11-30 15:21:03 UTC (rev 8509)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-applet.c	2006-11-30 15:41:51 UTC (rev 8510)
@@ -1522,32 +1522,33 @@
 hildon_home_applet_save_position (HildonHomeApplet *applet, GKeyFile *keyfile)
 {
   HildonHomeAppletPriv      *priv;
+  const gchar               *id;
   g_return_if_fail (applet && keyfile);
   
   priv = HILDON_HOME_APPLET_GET_PRIVATE (applet);
 
-  if (!priv->desktop_file)
-    return;
+  id = hildon_desktop_item_get_id (HILDON_DESKTOP_ITEM (applet));
+  g_return_if_fail (id);
 
   g_key_file_set_integer (keyfile,
-                          priv->desktop_file,
+                          id,
                           HH_APPLET_KEY_X,
                           GTK_WIDGET (applet)->allocation.x - 
                           GTK_WIDGET (applet)->parent->allocation.x);
 
   g_key_file_set_integer (keyfile,
-                          priv->desktop_file,
+                          id,
                           HH_APPLET_KEY_Y,
                           GTK_WIDGET (applet)->allocation.y -
                           GTK_WIDGET (applet)->parent->allocation.y);
 
   g_key_file_set_integer (keyfile,
-                          priv->desktop_file,
+                          id,
                           HH_APPLET_KEY_WIDTH,
                           GTK_WIDGET (applet)->allocation.width);
 
   g_key_file_set_integer (keyfile,
-                          priv->desktop_file,
+                          id,
                           HH_APPLET_KEY_HEIGHT,
                           GTK_WIDGET (applet)->allocation.height);
 

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-area.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-area.c	2006-11-30 15:21:03 UTC (rev 8509)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-area.c	2006-11-30 15:41:51 UTC (rev 8510)
@@ -370,14 +370,14 @@
 
   priv = HILDON_HOME_AREA_GET_PRIVATE (area);
 
-  if (HILDON_IS_HOME_APPLET (applet))
+  if (priv->layout && HILDON_IS_HOME_APPLET (applet))
     {
       g_debug ("Adding Hildon Home applet");
       GdkRectangle *rect;
-      const gchar *name = hildon_desktop_item_get_name (
+      const gchar *name = hildon_desktop_item_get_id (
                                      HILDON_DESKTOP_ITEM (applet));
       
-      g_debug ("Name");
+      g_debug ("Name: %s", name);
 
       rect = g_hash_table_lookup (priv->layout, name);
 
@@ -532,6 +532,8 @@
   g_return_if_fail (area);
   priv = HILDON_HOME_AREA_GET_PRIVATE (area);
 
+  g_debug ("Loading Hildon Home layout from %s", path);
+
   applets = gtk_container_get_children (GTK_CONTAINER (area));
 
   keyfile = g_key_file_new ();

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-titlebar.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-titlebar.c	2006-11-30 15:21:03 UTC (rev 8509)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-titlebar.c	2006-11-30 15:41:51 UTC (rev 8510)
@@ -574,10 +574,12 @@
 				   GParamSpec   *pspec)
 {
   HildonHomeTitlebar *titlebar = HILDON_HOME_TITLEBAR (gobject);
+        g_debug ("Setting titlebar property");
 
   switch (prop_id)
     {
     case PROP_MODE:
+        g_debug ("Setting titlebar mode");
       hildon_home_titlebar_set_mode (titlebar,
 		                     g_value_get_enum (value));
       break;
@@ -829,6 +831,7 @@
 hildon_home_titlebar_new ()
 {
   return g_object_new (HILDON_TYPE_HOME_TITLEBAR,
+                       "mode", HILDON_HOME_TITLEBAR_NORMAL,
                        NULL);
 }
 

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-window.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-window.c	2006-11-30 15:21:03 UTC (rev 8509)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/hildon-home-window.c	2006-11-30 15:41:51 UTC (rev 8510)
@@ -104,6 +104,8 @@
   guint is_dimmed : 1;
   guint is_lowmem : 1;
   guint is_inactive : 1;
+
+  guint selecting_applets : 1;
 };
 
 G_DEFINE_TYPE (HildonHomeWindow, hildon_home_window, HILDON_DESKTOP_TYPE_WINDOW);
@@ -163,7 +165,13 @@
 titlebar_select_applets_activate_cb (HildonHomeTitlebar *titlebar,
                                      HildonHomeWindow   *window)
 {
+  HildonHomeWindowPrivate *priv = window->priv;
+  
+  priv->selecting_applets = TRUE;
+  g_debug ("Emitting select-plugins");
   g_signal_emit_by_name (window, "select-plugins", NULL);
+  g_debug ("After select-plugins ");
+  priv->selecting_applets = FALSE;
 }
 
 static void
@@ -324,6 +332,15 @@
 {
   HildonHomeWindowPrivate *priv = window->priv;
   g_signal_emit_by_name (priv->titlebar, "applet-added", area);
+
+  if (HILDON_IS_HOME_AREA (priv->applet_area))
+    {
+      HildonHomeArea *area =  HILDON_HOME_AREA (priv->applet_area);
+
+      if (priv->selecting_applets && !hildon_home_area_get_layout_mode (area))
+        hildon_home_area_set_layout_mode (area, TRUE);
+
+    }
 }
 
 static void
@@ -779,7 +796,7 @@
                     G_CALLBACK (area_layout_mode_ended),
                     window);
 
-  g_signal_connect (priv->applet_area, "applet-added",
+  g_signal_connect (priv->applet_area, "add",
                     G_CALLBACK (area_add),
                     window);
   g_signal_connect (priv->applet_area, "applet-selected",


More information about the maemo-commits mailing list