1 /* vim: set sw=4 ts=4 et: */
3 * This file is part of Live Wallpaper (livewp)
5 * Copyright (C) 2010 Vlad Vasiliev
6 * Copyright (C) 2010 Tanya Makova
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version.
14 * This software is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this software; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 /*******************************************************************************/
25 #include "livewp-config.h"
26 /*******************************************************************************/
28 current_active_view(void){
29 GConfClient *gconf_client = NULL;
30 GConfValue *value = NULL;
33 gconf_client = gconf_client_get_default();
35 fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
38 result = gconf_client_get_int(gconf_client, "/apps/osso/hildon-desktop/views/current", NULL);
42 /*******************************************************************************/
44 read_config(Animation_WallpaperPrivate *priv) {
46 GConfClient *gconf_client = NULL;
48 GConfValue *value = NULL;
52 gconf_client = gconf_client_get_default();
54 fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
57 /* get Theme default Modern */
58 str = g_strdup_printf("%s%i", GCONF_KEY_THEME, id);
59 tmp = gconf_client_get_string(gconf_client,
68 priv->theme = g_strdup("Modern");
69 /* get Rich animation default TRUE */
70 str = g_strdup_printf("%s%i", GCONF_KEY_RANIMATION, id);
71 value = gconf_client_get(gconf_client, str, NULL);
77 priv->rich_animation = gconf_value_get_bool(value);
78 gconf_value_free(value);
80 priv->rich_animation = TRUE;
81 /* get theme additional parameter 1 */
82 str = g_strdup_printf("%s%i", GCONF_KEY_ADDIONAL_STRING_1 , id);
83 value = gconf_client_get(gconf_client, str, NULL);
89 priv->theme_string_parametr1 = g_strdup(gconf_value_get_string(value));
90 gconf_value_free(value);
96 /*******************************************************************************/
98 save_config(Animation_WallpaperPrivate *priv) {
100 GConfClient *gconf_client;
102 gint id = priv->view;
104 gconf_client = gconf_client_get_default();
106 fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
111 str = g_strdup_printf("%s%i", GCONF_KEY_THEME, id);
112 gconf_client_set_string(gconf_client,
121 str = g_strdup_printf("%s%i", GCONF_KEY_RANIMATION, id);
122 if (priv->rich_animation)
123 gconf_client_set_bool(gconf_client,
126 gconf_client_set_bool(gconf_client,
132 if (priv->theme_string_parametr1){
133 str = g_strdup_printf("%s%i",GCONF_KEY_ADDIONAL_STRING_1, id);
134 gconf_client_set_string(gconf_client,
136 priv->theme_string_parametr1, NULL);