[maemo-commits] [maemo-commits] r8220 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . src test

From: lucasr at stage.maemo.org lucasr at stage.maemo.org
Date: Tue Nov 21 15:28:51 EET 2006
Author: lucasr
Date: 2006-11-21 15:28:50 +0200 (Tue, 21 Nov 2006)
New Revision: 8220

Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/test/desktop.conf
   projects/haf/branches/maemo-af-desktop/hildon-desktop/test/tasknavigator.conf
Log:
2006-11-21  Lucas Rocha  <lucas.rocha at nokia.com>

	* src/hd-desktop.c: use configuration file settings to define Desktop
	Panel Window position and size.


Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-11-21 13:20:48 UTC (rev 8219)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-11-21 13:28:50 UTC (rev 8220)
@@ -1,5 +1,10 @@
 2006-11-21  Lucas Rocha  <lucas.rocha at nokia.com>
 
+	* src/hd-desktop.c: use configuration file settings to define Desktop
+	Panel Window position and size.
+
+2006-11-21  Lucas Rocha  <lucas.rocha at nokia.com>
+
 	* libhildondesktop/desktop-multiscreen.[ch],
 	libhildondesktop/desktop-panel.[ch],
 	libhildondesktop/desktop-panel-window.[ch],

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2006-11-21 13:20:48 UTC (rev 8219)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2006-11-21 13:28:50 UTC (rev 8220)
@@ -52,6 +52,9 @@
 #define HD_CONTAINER_TYPE_PANEL_FIXED  "panel_fixed"
 #define HD_CONTAINER_TYPE_PANEL_BOX    "panel_box"
 
+#define HD_WINDOW_ORIENTATION_VERT     "vertical"
+#define HD_WINDOW_ORIENTATION_HOR      "horizontal"
+
 struct _HDDesktopPrivate 
 {
   gchar      *config_file;
@@ -166,7 +169,8 @@
     }
     else if (!g_ascii_strcasecmp (type, HD_CONTAINER_TYPE_PANEL_BOX))
     {
-      gchar *orientation;
+      DPanelWinOrientation orientation;
+      gchar *orientation_str;
       gint x, y, width, height;
 
       x = g_key_file_get_integer (keyfile, 
@@ -229,10 +233,10 @@
         continue;
       }
 
-      orientation = g_key_file_get_string (keyfile, 
-                                           groups[i],
-                                           HD_DESKTOP_KEY_ORIENTATION,
-                                           &error);
+      orientation_str = g_key_file_get_string (keyfile, 
+                                               groups[i],
+                                               HD_DESKTOP_KEY_ORIENTATION,
+                                               &error);
 
       if (error)
       {
@@ -244,16 +248,23 @@
         continue;
       }
 
+      if (!g_ascii_strcasecmp (orientation_str, HD_WINDOW_ORIENTATION_VERT))
+        orientation = DPANEL_ORIENTATION_VERTICAL; 
+      else if (!g_ascii_strcasecmp (orientation_str, HD_WINDOW_ORIENTATION_HOR))
+        orientation = DPANEL_ORIENTATION_HORIZONTAL; 
+      else 
+        orientation = DPANEL_ORIENTATION_HORIZONTAL; 
+
       /* Add Panel Box creation code here. */
       container = g_object_new (DESKTOP_TYPE_PANEL_WINDOW,
-                               "horizontal_width",gdk_screen_width (),
-                               "horizontal_height",100,
-                               "vertical_width",100,
-                               "vertical_height",500,
-                               "x",0,"y",gdk_screen_height () - 100,
+                               "x", x,
+                               "y", y,
+                               "width", width,
+                               "height", height,
+                               "orientation", orientation,
                                 NULL);
 
-      g_free (orientation);
+      g_free (orientation_str);
     }
     else 
     {

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/test/desktop.conf
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/test/desktop.conf	2006-11-21 13:20:48 UTC (rev 8219)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/test/desktop.conf	2006-11-21 13:28:50 UTC (rev 8220)
@@ -1,8 +1,8 @@
 [Tasknavigator]
 X-Type=panel_box
-X-Position-X=100
+X-Position-X=0
 X-Position-Y=0
 X-Size-Width=100
-X-Size-Height=50
+X-Size-Height=80
 X-Orientation=vertical
 X-Config-File=tasknavigator.conf

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/test/tasknavigator.conf
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/test/tasknavigator.conf	2006-11-21 13:20:48 UTC (rev 8219)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/test/tasknavigator.conf	2006-11-21 13:28:50 UTC (rev 8220)
@@ -1 +1,2 @@
 [/usr/share/applications/hildon-navigator/hildon-task-navigator-bookmarks.desktop]
+[/usr/share/applications/hildon-navigator/osso-contact-plugin.desktop]


More information about the maemo-commits mailing list