fixed first start for theme video
[livewp] / applet / src / livewp-config.c
index bd49225..96dda24 100644 (file)
 #include "livewp-config.h"
 /*******************************************************************************/
 gint 
+current_active_view(void){
+    GConfClient *gconf_client = NULL;
+    GConfValue *value = NULL;
+    gint result = -1;
+
+    gconf_client = gconf_client_get_default();
+    if (!gconf_client) {
+        fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
+        return result;
+    }
+    result = gconf_client_get_int(gconf_client, "/apps/osso/hildon-desktop/views/current", NULL);
+
+    return result;
+}
+/*******************************************************************************/
+gint 
 read_config(Animation_WallpaperPrivate *priv) {
 
     GConfClient *gconf_client = NULL;
@@ -62,7 +78,17 @@ read_config(Animation_WallpaperPrivate *priv) {
         gconf_value_free(value);
     } else
         priv->rich_animation = TRUE;
-    
+    /* get theme additional parameter 1  */
+    str = g_strdup_printf("%s%i", GCONF_KEY_ADDIONAL_STRING_1 , id);
+    value = gconf_client_get(gconf_client, str, NULL);
+    if (str){ 
+        g_free(str);
+        str = NULL;
+    } 
+    if (value) {
+        priv->theme_string_parametr1 = g_strdup(gconf_value_get_string(value));
+        gconf_value_free(value);
+    } 
 
     return 0;
 }
@@ -103,5 +129,16 @@ save_config(Animation_WallpaperPrivate *priv) {
         g_free(str);
         str = NULL;
     }
+    if (priv->theme_string_parametr1){
+        str = g_strdup_printf("%s%i",GCONF_KEY_ADDIONAL_STRING_1, id);
+        gconf_client_set_string(gconf_client,
+                  str,
+                  priv->theme_string_parametr1, NULL);
+        if (str){
+            g_free(str);
+            str = NULL;
+        }
+    }
+
     
 }