Added checking of existence the program Xsnow in system
authorVlad <vlad@gas.by>
Thu, 5 Aug 2010 09:19:20 +0000 (12:19 +0300)
committerVlad <vlad@gas.by>
Thu, 5 Aug 2010 09:19:20 +0000 (12:19 +0300)
applet/debian/changelog
applet/src/livewp-settings.c

index b9477d5..cd3d29f 100644 (file)
@@ -2,6 +2,7 @@ live-wallpaper (0.7.1) unstable; urgency=low
 
   * Fixed problem in settings for non English locales 
   * Fixed various gcc's warnings
+  * Added checking of existence the program Xsnow in system 
 
  -- Vlad Vasiliev <vlad@gas.by>  Thu, 03 Aug 2010 21:39:10 +0200
 
index ef23997..cf1e26a 100644 (file)
@@ -371,7 +371,6 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
     GtkWidget *button1 = NULL;
     GtkWidget *rich_animation_button = NULL;
     gint view = priv->view;
-    gboolean success_choice = TRUE;
 
     window = gtk_dialog_new();
     priv->window = window;
@@ -418,6 +417,15 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
         case GTK_RESPONSE_YES:
             /* Check theme */
             if (hildon_button_get_value(HILDON_BUTTON (theme_button))){
+                /* Check Xsnow program */
+                if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Xsnow"))){
+                    if (access("/usr/bin/xsnow", F_OK) != 0){
+                        hildon_banner_show_information(GTK_WIDGET(button), NULL, 
+                        _("You haven't got the installed package Xsnow. Please install it via using Application Manager"));
+                        /* if not scuccess exit from wthout saving */ 
+                        break;
+                    }
+                }
 
                 if (priv->theme)
                     g_free(priv->theme);
@@ -430,15 +438,8 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
                     priv->theme = g_strdup("Matrix");
                 if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Accel")))
                     priv->theme = g_strdup("Accel");
-                if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Xsnow"))){
+                if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Xsnow")))
                     priv->theme = g_strdup("Xsnow");
-                    if (access("/usr/bin/xsnow", F_OK) != 0){
-                        fprintf(stderr,"sddddddddddddddddddddddddddddd\n");
-                        success_choice = FALSE;
-                        hildon_banner_show_information(GTK_WIDGET(window), NULL, 
-                        _("You haven't got the installed package Xsnow. Please install it via using Application Manager"));
-                    }
-                }
                 if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Video"))){
                     priv->theme = g_strdup("Video");
                     button1 = g_object_get_data(G_OBJECT(priv->window), "filename_button");
@@ -459,9 +460,6 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
                 else
                     priv->rich_animation = FALSE;
             }
-            /* if not scuccess exit from wthout saving */ 
-            if (!success_choice)
-                break;
             /* Save config */
             save_config(priv);
             /* action with applet */