started slideshow
[livewp] / applet / src / livewp-config.c
index 60b78db..59bd7ec 100644 (file)
@@ -1,21 +1,21 @@
 /* vim: set sw=4 ts=4 et: */
 /*
  * This file is part of Live Wallpaper (livewp)
- * 
+ *
  * Copyright (C) 2010 Vlad Vasiliev
  * Copyright (C) 2010 Tanya Makova
  *       for the code
- * 
+ *
  * This software is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of
  * the License, or (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -24,7 +24,7 @@
 /*******************************************************************************/
 #include "livewp-config.h"
 /*******************************************************************************/
-gint 
+gint
 current_active_view(void){
     GConfClient *gconf_client = NULL;
     gint result = -1;
@@ -41,7 +41,7 @@ current_active_view(void){
 
 /*******************************************************************************/
 #ifdef APPLICATION
-void 
+void
 fill_priv(Animation_WallpaperPrivate *priv)
 {
     /* Reset data */
@@ -59,7 +59,9 @@ fill_priv(Animation_WallpaperPrivate *priv)
         priv->scene_func = (gpointer)&init_scene_Matrix;
     if (!strcmp(priv->theme, "Video"))
         priv->scene_func = (gpointer)&init_scene_Video;
-    
+    if (!strcmp(priv->theme, "Slideshow"))
+       priv->scene_func = (gpointer)&init_scene_Slideshow;
+
     priv->extheme_list = get_list_exthemes();
     GSList *store = priv->extheme_list;
     while (store){
@@ -80,7 +82,7 @@ fill_priv(Animation_WallpaperPrivate *priv)
 }
 #endif
 /*******************************************************************************/
-gint 
+gint
 read_config(Animation_WallpaperPrivate *priv) {
 
     GConfClient *gconf_client = NULL;
@@ -98,10 +100,10 @@ read_config(Animation_WallpaperPrivate *priv) {
     str = g_strdup_printf("%s%i", GCONF_KEY_THEME, id);
     tmp = gconf_client_get_string(gconf_client,
                                   str, NULL);
-    if (str){ 
+    if (str){
         g_free(str);
         str = NULL;
-    }    
+    }
     if (tmp){
         priv->theme = tmp;
     }else
@@ -109,10 +111,10 @@ read_config(Animation_WallpaperPrivate *priv) {
     /* get Rich animation default TRUE */
     str = g_strdup_printf("%s%i", GCONF_KEY_RANIMATION, id);
     value = gconf_client_get(gconf_client, str, NULL);
-    if (str){ 
+    if (str){
         g_free(str);
         str = NULL;
-    } 
+    }
     if (value) {
         priv->rich_animation = gconf_value_get_bool(value);
         gconf_value_free(value);
@@ -121,10 +123,10 @@ read_config(Animation_WallpaperPrivate *priv) {
     /* get theme additional bool aparametr 1 default  TRUE */
     str = g_strdup_printf("%s%i", GCONF_KEY_ADDITIONAL_BOOL_1, id);
     value = gconf_client_get(gconf_client, str, NULL);
-    if (str){ 
+    if (str){
         g_free(str);
         str = NULL;
-    } 
+    }
     if (value) {
         priv->theme_bool_parametr1 = gconf_value_get_bool(value);
         gconf_value_free(value);
@@ -134,14 +136,14 @@ read_config(Animation_WallpaperPrivate *priv) {
     /* get theme additional parameter 1  */
     str = g_strdup_printf("%s%i", GCONF_KEY_ADDITIONAL_STRING_1 , id);
     value = gconf_client_get(gconf_client, str, NULL);
-    if (str){ 
+    if (str){
         g_free(str);
         str = NULL;
-    } 
+    }
     if (value) {
         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;
@@ -199,7 +201,7 @@ save_config(Animation_WallpaperPrivate *priv) {
         fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
         return;
     }
-    
+
     if (priv->theme){
         str = g_strdup_printf("%s%i", GCONF_KEY_THEME, id);
         gconf_client_set_string(gconf_client,
@@ -264,10 +266,10 @@ get_count_themes_from_config(gchar *theme_name){
     for (i=1; i<=9; i++){
         str = g_strdup_printf("%s%i", GCONF_KEY_THEME, i);
         value = gconf_client_get_string(gconf_client, str, NULL);
-        if (str){ 
+        if (str){
             g_free(str);
             str = NULL;
-        }    
+        }
         if (value && !strcmp(value, theme_name)){
             count++;
         }