one theme in all views almost done
[livewp] / applet / src / livewp-config.c
index e3aa165..97ee239 100644 (file)
@@ -138,10 +138,50 @@ read_config(Animation_WallpaperPrivate *priv) {
         priv->theme_string_parametr1 = g_strdup(gconf_value_get_string(value));
         gconf_value_free(value);
     } 
-
+    /* get parameter one theme in all view */
+    priv->one_in_all_view = get_one_in_all_views_from_config();
     return 0;
 }
+/*******************************************************************************/
+gboolean
+get_one_in_all_views_from_config(void){
+    GConfClient *gconf_client;
+    GConfValue *value = NULL;
+    gboolean result;
+
+    gconf_client = gconf_client_get_default();
+    if (!gconf_client) {
+        fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
+        return FALSE;
+    }
+    /* get parameter one theme in all view */
+    value = gconf_client_get(gconf_client, GCONF_KEY_ONE_IN_ALL_VIEW, NULL);
+    if (value) {
+        result = gconf_value_get_bool(value);
+        gconf_value_free(value);
+    } else
+        result = FALSE;
+    return result;
+}
+/*******************************************************************************/
+void
+save_one_in_all_views_to_config(gboolean one_in_all_views){
+    GConfClient *gconf_client;
+
+    gconf_client = gconf_client_get_default();
+    if (!gconf_client) {
+        fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
+        return;
+    }
 
+    if (one_in_all_views)
+        gconf_client_set_bool(gconf_client,
+                              GCONF_KEY_ONE_IN_ALL_VIEW, TRUE, NULL);
+    else
+        gconf_client_set_bool(gconf_client,
+                              GCONF_KEY_ONE_IN_ALL_VIEW, FALSE, NULL);
+
+}
 /*******************************************************************************/
 void
 save_config(Animation_WallpaperPrivate *priv) {
@@ -200,6 +240,4 @@ save_config(Animation_WallpaperPrivate *priv) {
             str = NULL;
         }
     }
-
-    
 }