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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri May 4 17:04:08 EEST 2007
Author: jobi
Date: 2007-05-04 17:04:07 +0300 (Fri, 04 May 2007)
New Revision: 11457

Removed:
   projects/haf/trunk/hildon-desktop/data/home-background.conf
Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/data/Makefile.am
   projects/haf/trunk/hildon-desktop/src/hd-home-window.c
Log:

2007-05-04  Johan Bilien  <johan.bilien at nokia.com>

	* src/hd-home-window.c:
	- read /usr/share/backgrounds/default.desktop
	to determine the default background.
	* data/home-background.conf:
	- removed, the default background settings are now fully fetched
	from the theme and the above mentioned file



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-05-04 13:51:19 UTC (rev 11456)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-05-04 14:04:07 UTC (rev 11457)
@@ -1,7 +1,16 @@
+2007-05-04  Johan Bilien  <johan.bilien at nokia.com>
+
+	* src/hd-home-window.c:
+	- read /usr/share/backgrounds/default.desktop
+	to determine the default background.
+	* data/home-background.conf:
+	- removed, the default background settings are now fully fetched
+	from the theme and the above mentioned file
+
 2007-05-04  Moises Martinez  <moises.martinez at nokia.com>
 
 	* src/hd-switcher-menu-item.[ch]:
-	- Several minor bugfixes. 
+	- Several minor bugfixes.
 	* src/hd-switcher-menu.c:
 	- Added basic support for notifications.
 

Modified: projects/haf/trunk/hildon-desktop/data/Makefile.am
===================================================================
--- projects/haf/trunk/hildon-desktop/data/Makefile.am	2007-05-04 13:51:19 UTC (rev 11456)
+++ projects/haf/trunk/hildon-desktop/data/Makefile.am	2007-05-04 14:04:07 UTC (rev 11457)
@@ -3,8 +3,7 @@
 	tasknavigator.conf  \
 	home.conf           \
 	home-layout.conf    \
-	statusbar.conf	    \
-	home-background.conf
+	statusbar.conf
 
 hildonnavigatordesktopentry_DATA = \
 	app-switcher.desktop       \

Deleted: projects/haf/trunk/hildon-desktop/data/home-background.conf
===================================================================
--- projects/haf/trunk/hildon-desktop/data/home-background.conf	2007-05-04 13:51:19 UTC (rev 11456)
+++ projects/haf/trunk/hildon-desktop/data/home-background.conf	2007-05-04 14:04:07 UTC (rev 11457)
@@ -1,6 +0,0 @@
-[Hildon Home]
-BackgroundImage=/usr/share/themes/default/images/qgn_plat_home_background.png
-Red=0
-Green=0
-Blue=0
-Mode=stretched

Modified: projects/haf/trunk/hildon-desktop/src/hd-home-window.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-home-window.c	2007-05-04 13:51:19 UTC (rev 11456)
+++ projects/haf/trunk/hildon-desktop/src/hd-home-window.c	2007-05-04 14:04:07 UTC (rev 11457)
@@ -63,9 +63,12 @@
 
 #define HD_HOME_BACKGROUND_CONF_FILE        "home-background.conf"
 #define HD_DESKTOP_USER_PATH                ".osso/hildon-desktop/"
-#define HD_HOME_BACKGROUND_GLOBAL_CONF_FILE \
-    HD_DESKTOP_CONFIG_PATH G_DIR_SEPARATOR_S HD_HOME_BACKGROUND_CONF_FILE
+#define HD_HOME_BACKGROUND_DEFAULT          HD_DESKTOP_BACKGROUNDS_PATH\
+                                            "/default.desktop"
 
+#define BG_DESKTOP_GROUP           "Desktop Entry"
+#define BG_DESKTOP_IMAGE_FILENAME  "File"
+
 #define LAYOUT_OPENING_BANNER_TIMEOUT   2500
 
 #define HD_HOME_WINDOW_STYLE_NORTH_BORDER   "HildonHomeTitleBar"
@@ -343,20 +346,43 @@
 
   if (error)
     {
+      GKeyFile         *keyfile;
+      const GdkColor    default_color = {0, 0, 0, 0};
+      gchar            *filename = NULL;
+
       g_clear_error (&error);
 
-      /* Try the global configuration file */
-      hd_home_background_load (background,
-                               HD_HOME_BACKGROUND_GLOBAL_CONF_FILE,
-                               &error);
+      /* Revert to the default background file */
+      keyfile = g_key_file_new ();
+      g_key_file_load_from_file (keyfile,
+                                 HD_HOME_BACKGROUND_DEFAULT,
+                                 G_KEY_FILE_NONE,
+                                 &error);
+      if (error) goto error;
 
+      filename = g_key_file_get_string (keyfile,
+                                        BG_DESKTOP_GROUP,
+                                        BG_DESKTOP_IMAGE_FILENAME,
+                                        &error);
+
+      if (error) goto error;
+
+      background = g_object_new (HD_TYPE_HOME_BACKGROUND,
+                                 "filename", filename,
+                                 "color", &default_color,
+                                 NULL);
+
+error:
       if (error)
         {
-          g_warning ("Error when loading background parameters from: %s",
+          g_warning ("Could not load default background: %s",
                      error->message);
-          g_error_free (error);
+          g_clear_error (&error);
           background = NULL;
         }
+
+      g_free (filename);
+
     }
 
 


More information about the maemo-commits mailing list