#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;
GConfValue *value = NULL;
gint id = priv->view;
gchar * str = NULL;
-
+
gconf_client = gconf_client_get_default();
if (!gconf_client) {
fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
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;
}
save_config(Animation_WallpaperPrivate *priv) {
GConfClient *gconf_client;
+ gchar * str = NULL;
+ gint id = priv->view;
+
gconf_client = gconf_client_get_default();
if (!gconf_client) {
fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
return;
}
- /* Save Weather source name. */
- if (priv->theme)
+
+ if (priv->theme){
+ str = g_strdup_printf("%s%i", GCONF_KEY_THEME, id);
gconf_client_set_string(gconf_client,
- GCONF_KEY_THEME,
+ str,
priv->theme, NULL);
+ if (str){
+ g_free(str);
+ str = NULL;
+ }
+ }
+
+ str = g_strdup_printf("%s%i", GCONF_KEY_RANIMATION, id);
if (priv->rich_animation)
gconf_client_set_bool(gconf_client,
- GCONF_KEY_RANIMATION, TRUE, NULL);
+ str, TRUE, NULL);
else
gconf_client_set_bool(gconf_client,
- GCONF_KEY_RANIMATION, FALSE, NULL);
+ str, FALSE, NULL);
+ if (str){
+ 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;
+ }
+ }
+
}