tryed fix xsnow
[livewp] / applet / src / livewp-settings.c
index 25f064e..ef23997 100644 (file)
@@ -34,9 +34,9 @@ void lw_about(void){
     gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
     gtk_window_set_modal(GTK_WINDOW(window), TRUE);
     vbox = gtk_vbox_new (FALSE, 5);
-    label_about = gtk_label_new (_("Live Wallpaper\n Version 0.5 \n Copyright(c) 2010\n \
+    label_about = gtk_label_new (_("Live Wallpaper Version 0.7.1 \n Copyright(c) 2010\n \
 Tanya Makova\n Vlad Vasiliev\n \
-Copyright(c) 2010 for design themes Berlin and Modern Vasya Bobrikov\n \
+Copyright(c) 2010 for design themes Berlin, Modern and Accel Vasya Bobrikov\n \
 Copyright(c) 2010 for design theme Matrix Andrew Zhilin\n \
 Translators:\n \
 Finnish - Marko Vertainen\n \
@@ -54,8 +54,7 @@ Russian - Tanya Makova \n \
 }
 /*******************************************************************************/
 GtkWidget *
-create_theme_selector (void)
-{
+create_theme_selector (void){
       GtkWidget *selector;
 
       selector = hildon_touch_selector_new_text ();
@@ -64,9 +63,100 @@ create_theme_selector (void)
       hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Modern"));
       hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Matrix"));
       hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Accel"));
+      hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Video"));
+      hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), _("Xsnow"));
       return selector;
 }
 /*******************************************************************************/
+void
+theme_button_clicked(GtkButton *button, Animation_WallpaperPrivate *priv){
+
+    lw_theme_settings(GTK_WIDGET(button), priv);
+}
+/********************************************************************************/
+void
+set_button_image(GtkWidget * button, gchar *theme, gboolean enable){
+    GtkWidget * image = NULL; 
+    GdkPixbuf * pixbuf = NULL;
+    gchar *str = NULL;
+    if (enable)
+        str = g_strdup_printf( "%s/%s/%s", THEME_PATH, 
+                        theme, "icon.png");
+    else 
+        str = g_strdup_printf( "%s/%s/%s", THEME_PATH, 
+                        theme, "icond.png");
+    pixbuf = gdk_pixbuf_new_from_file_at_size (str, 
+                                             100, 
+                                             60, 
+                                             NULL);
+    if (str)
+        g_free(str);
+    if (pixbuf){
+        image = gtk_image_new_from_pixbuf (pixbuf);
+        g_object_unref(G_OBJECT(pixbuf));
+    }
+
+   hildon_button_set_image (HILDON_BUTTON (button), image);
+}
+/********************************************************************************/
+GtkWidget *
+create_image_button (gint view, DBusConnection *conn_sess){
+    GtkWidget *button;
+    
+    Animation_WallpaperPrivate *priv = g_new0(Animation_WallpaperPrivate, 1);
+    priv->view = view;
+    priv->theme_string_parametr1 = NULL;
+    priv->dbus_conn_session = conn_sess;
+    read_config(priv);
+    button = hildon_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
+                                    HILDON_BUTTON_ARRANGEMENT_VERTICAL);
+    g_object_set_data(G_OBJECT(button), "view", GINT_TO_POINTER(view));
+    g_object_set_data(G_OBJECT(button), "priv", priv);
+    set_button_image(button, priv->theme, check_applet_state(view));
+    g_signal_connect(button, "clicked", G_CALLBACK(theme_button_clicked), priv);
+    hildon_button_set_image_position (HILDON_BUTTON (button), GTK_POS_RIGHT);
+    return button;
+
+}
+/********************************************************************************/
+void
+changed_value_theme_cb (HildonPickerButton *picker, Animation_WallpaperPrivate *priv)
+{
+    const gchar *choice = hildon_button_get_value(HILDON_BUTTON (picker));
+    GtkWidget *vbox = NULL;
+        
+    vbox = g_object_get_data(G_OBJECT(priv->window), "custom_vbox");
+    if (vbox)
+        gtk_widget_destroy(vbox);
+    vbox = gtk_vbox_new (FALSE, 5);
+    g_object_set_data(G_OBJECT(priv->window), "custom_vbox", vbox);
+    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(priv->window)->vbox),
+                                   vbox, TRUE, TRUE, 5);
+    if (choice) {
+        if (!strcmp(choice, _("Berlin"))){
+            rich_animation_additional_parametr(vbox,priv);
+        }
+        if (!strcmp(choice, _("Modern"))){
+            rich_animation_additional_parametr(vbox,priv);
+        }
+        if (!strcmp(choice, _("Matrix"))){
+            rich_animation_additional_parametr(vbox,priv);
+        }
+        if (!strcmp(choice, _("Xsnow"))){
+            rich_animation_additional_parametr(vbox,priv);
+        }
+
+        if (!strcmp(choice, _("Accel"))){
+            rich_animation_additional_parametr(vbox,priv);
+        }
+        if (!strcmp(choice, _("Video"))){
+            additional_parametr_for_theme_video(vbox, priv);
+        }
+    }
+    gtk_widget_show(vbox);
+}
+
+/********************************************************************************/
 GtkWidget *
 create_themes_button (gchar *theme){
 
@@ -92,22 +182,29 @@ create_themes_button (gchar *theme){
             hildon_button_set_value(HILDON_BUTTON(button), _("Matrix"));
         }
         if (!strcmp(theme, "Accel")){
-            hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 2);
+            hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 3);
             hildon_button_set_value(HILDON_BUTTON(button), _("Accel"));
         }
-
-
+        if (!strcmp(theme, "Video")){
+            hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 4);
+            hildon_button_set_value(HILDON_BUTTON(button), _("Video"));
+        }
+        if (!strcmp(theme, "Xsnow")){
+            hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 5);
+            hildon_button_set_value(HILDON_BUTTON(button), _("Xsnow"));
+        }
     }
+    
     return button;
 }
 
 /*******************************************************************************/
 GtkWidget *
-create_rich_animation_button (gboolean active)
+create_rich_animation_button (gboolean active, gchar *name)
 {
     GtkWidget *button;
     button = hildon_check_button_new (HILDON_SIZE_AUTO);
-    gtk_button_set_label (GTK_BUTTON (button), _("Rich Animation"));
+    gtk_button_set_label (GTK_BUTTON (button), name);
     hildon_check_button_set_active(HILDON_CHECK_BUTTON(button), active);
     return button;
 }
@@ -125,40 +222,194 @@ create_enable_button (gboolean active)
 /*******************************************************************************/
 void
 show_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv){
-    lw_settings(priv, NULL);
+    lw_main_settings(priv, NULL);
+}
+/*******************************************************************************/
+void 
+lw_main_settings(Animation_WallpaperPrivate *priv, gpointer data){
+    gint result;
+    GtkWidget *window = NULL;
+    GtkWidget *theme_button1;
+    GtkWidget *theme_button2;
+    GtkWidget *theme_button3;
+    GtkWidget *theme_button4;
+    GtkWidget *hbox;
+    Animation_WallpaperPrivate *priv_temp = NULL;
+
+    window = gtk_dialog_new();
+
+    gtk_window_set_title(GTK_WINDOW(window), _("Live Wallpaper Settings"));
+    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+    gtk_window_set_modal(GTK_WINDOW(window), TRUE);
+    /* Create Theme button */
+    hbox = gtk_hbox_new(FALSE, 5);
+    theme_button1 = create_image_button(1, priv->dbus_conn_session);
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button1, TRUE, TRUE, 5);
+    theme_button2 = create_image_button(2, priv->dbus_conn_session);
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button2, TRUE, TRUE, 5);
+    theme_button3 = create_image_button(3, priv->dbus_conn_session);
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button3, TRUE, TRUE, 5);
+    theme_button4 = create_image_button(4, priv->dbus_conn_session);
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button4, TRUE, TRUE, 5);
+    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
+                                   hbox, TRUE, TRUE, 5);
+
+    gtk_widget_show (theme_button1);
+    gtk_widget_show (theme_button2);
+    gtk_widget_show (theme_button3);
+    gtk_widget_show (theme_button4);
+    gtk_widget_show_all (hbox);
+    gtk_widget_show (window);
+    gtk_dialog_add_button(GTK_DIALOG(window), _("About"), GTK_RESPONSE_NO);
+
+    result = gtk_dialog_run(GTK_DIALOG(window));
+
+    priv_temp = g_object_get_data(G_OBJECT(theme_button1), "priv");
+    if (priv_temp){
+        g_free(priv_temp);
+        priv_temp =NULL;
+    }
+    priv_temp = g_object_get_data(G_OBJECT(theme_button2), "priv");
+    if (priv_temp){
+        g_free(priv_temp);
+        priv_temp =NULL;
+    }
+    priv_temp = g_object_get_data(G_OBJECT(theme_button3), "priv");
+    if (priv_temp){
+        g_free(priv_temp);
+        priv_temp =NULL;
+    }
+    priv_temp = g_object_get_data(G_OBJECT(theme_button4), "priv");
+    if (priv_temp){
+        g_free(priv_temp);
+        priv_temp =NULL;
+    }
+
+
+    switch(result){
+        case GTK_RESPONSE_NO:
+            gtk_widget_destroy(window);
+            window = NULL;
+            lw_about();
+        break;
+    }
+
+
+    if (window)
+        gtk_widget_destroy(window);
+}
+/*******************************************************************************/
+void
+file_button_clicked(GtkButton *button, Animation_WallpaperPrivate *priv){
+
+    GtkWidget *dialog = hildon_file_chooser_dialog_new(GTK_WINDOW (priv->window), GTK_FILE_CHOOSER_ACTION_OPEN);
+
+    if (priv->theme_string_parametr1)
+        gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), priv->theme_string_parametr1);
+
+    gtk_widget_show_all (GTK_WIDGET (dialog));
+
+    if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
+    {
+      hildon_button_set_value (HILDON_BUTTON(button), gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)));
+    }
+    gtk_widget_destroy (dialog);
+
+}
+/*******************************************************************************/
+void
+rich_animation_additional_parametr(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
+    GtkWidget *rich_animation_button;
+    /* Create rich animation button */  
+    rich_animation_button = create_rich_animation_button(priv->rich_animation, _("Rich Animation"));
+    gtk_box_pack_start(GTK_BOX(vbox),
+                                   rich_animation_button, TRUE, TRUE, 5);
+    g_object_set_data(G_OBJECT(priv->window), "rich_animation_button", rich_animation_button);
+    gtk_widget_show (rich_animation_button);
+}
+/*******************************************************************************/
+void
+additional_parametr_for_theme_video(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
+
+    GtkWidget *file_button;
+    GtkWidget *rich_animation_button;
+
+    if (priv->theme_string_parametr1)
+        file_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL,
+                                                   _("Play file"), priv->theme_string_parametr1);
+    else
+        file_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT,HILDON_BUTTON_ARRANGEMENT_VERTICAL,
+                                                   _("Play file")," ");
+
+    g_signal_connect (file_button, "clicked", G_CALLBACK (file_button_clicked), priv);
+
+    gtk_box_pack_start(GTK_BOX(vbox),
+                                   file_button, TRUE, TRUE, 5);
+    g_object_set_data(G_OBJECT(priv->window), "filename_button", file_button);    /* Create rich animation button */  
+    rich_animation_button = create_rich_animation_button(priv->rich_animation, _("Loop"));
+    gtk_box_pack_start(GTK_BOX(vbox),
+                                   rich_animation_button, TRUE, TRUE, 5);
+    g_object_set_data(G_OBJECT(priv->window), "rich_animation_button", rich_animation_button);
+
+    gtk_widget_show (file_button);
+    gtk_widget_show (rich_animation_button);
+
 }
 /*******************************************************************************/
 void 
-lw_settings(Animation_WallpaperPrivate *priv, gpointer data){
+lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
     gint result;
     GtkWidget *window = NULL;
     GtkWidget *save_button;
     GtkWidget *theme_button;
     GtkWidget *enable_button;
-    GtkWidget *rich_animation_button;
+    GtkWidget *vbox;
+    GtkWidget *button1 = NULL;
+    GtkWidget *rich_animation_button = NULL;
+    gint view = priv->view;
+    gboolean success_choice = TRUE;
 
     window = gtk_dialog_new();
+    priv->window = window;
 
-    gtk_window_set_title(GTK_WINDOW(window), _("Live Wallpaper Settings"));
+    gtk_window_set_title(GTK_WINDOW(window), _("View Settings"));
     gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
     gtk_window_set_modal(GTK_WINDOW(window), TRUE);
     /* Create Enable button */
-    enable_button = create_enable_button(check_applet_state()); 
+    enable_button = create_enable_button(check_applet_state(view)); 
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
                                    enable_button, TRUE, TRUE, 5);
     /* Create Theme button */
     theme_button = create_themes_button(priv->theme);
+    g_signal_connect (G_OBJECT (theme_button), "value-changed",  G_CALLBACK (changed_value_theme_cb), priv);
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
                                    theme_button, TRUE, TRUE, 5);
-    /* Create rich animation button */  
-    rich_animation_button = create_rich_animation_button(priv->rich_animation);
+
+    /* Create custom vbox */
+    vbox = gtk_vbox_new (FALSE, 5);
+    g_object_set_data(G_OBJECT(window), "custom_vbox", vbox);
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
-                                   rich_animation_button, TRUE, TRUE, 5);
+                                   vbox, TRUE, TRUE, 5);
+    if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Berlin"))||
+        !strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Matrix"))||
+        !strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Accel"))||
+        !strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Xsnow"))||
+        !strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Modern"))){
+        rich_animation_additional_parametr(vbox, priv);
+    }
+
+    if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Video"))){
+        additional_parametr_for_theme_video(vbox, priv);
+    } 
+
     gtk_widget_show (enable_button);
     gtk_widget_show (theme_button);
-    gtk_widget_show (rich_animation_button);
+    gtk_widget_show (vbox);
     gtk_widget_show (window);
-    gtk_dialog_add_button(GTK_DIALOG(window), _("About"), GTK_RESPONSE_NO);
     save_button = gtk_dialog_add_button(GTK_DIALOG(window), _("Save"), GTK_RESPONSE_YES);
 
     result = gtk_dialog_run(GTK_DIALOG(window));
@@ -167,8 +418,10 @@ lw_settings(Animation_WallpaperPrivate *priv, gpointer data){
         case GTK_RESPONSE_YES:
             /* Check theme */
             if (hildon_button_get_value(HILDON_BUTTON (theme_button))){
+
                 if (priv->theme)
                     g_free(priv->theme);
+
                 if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Berlin")))
                     priv->theme = g_strdup("Berlin");
                 if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Modern")))
@@ -177,27 +430,55 @@ lw_settings(Animation_WallpaperPrivate *priv, gpointer data){
                     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"))){
+                    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");
+                    if (button1){
+                        if (priv->theme_string_parametr1)
+                            g_free(priv->theme_string_parametr1);
+                        priv->theme_string_parametr1 = g_strdup((gchar*)hildon_button_get_value (HILDON_BUTTON(button1)));
+                    }
+                }
+
+            }
+
+            rich_animation_button = g_object_get_data(G_OBJECT(priv->window), "rich_animation_button");
+            if (rich_animation_button){
+                /* Check rich animation */
+                if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(rich_animation_button)))
+                    priv->rich_animation = TRUE;
+                else
+                    priv->rich_animation = FALSE;
             }
-            /* Check rich animation */
-            if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(rich_animation_button)))
-                priv->rich_animation = TRUE;
-            else
-                priv->rich_animation = FALSE;
+            /* if not scuccess exit from wthout saving */ 
+            if (!success_choice)
+                break;
             /* Save config */
             save_config(priv);
             /* action with applet */
             if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(enable_button))){
-                    if (!check_applet_state())
-                        start_applet();
-                    else
+                    if (!check_applet_state(view)){
+                        start_applet(view);
+                    }else {
                         send_dbus_signal (priv,
                               LIVEWP_SIGNAL_INTERFACE,
                               LIVEWP_SIGNAL_PATH,
                               LIVEWP_RELOAD_CONFIG);
+                    }
             }else
-                    if (check_applet_state())
-                        stop_applet();
+                    if (check_applet_state(view))
+                        stop_applet(view);
 
+            set_button_image(button, priv->theme, check_applet_state(view));
             break;
         default:
         case GTK_RESPONSE_OK:
@@ -213,10 +494,27 @@ lw_settings(Animation_WallpaperPrivate *priv, gpointer data){
 }
 /*******************************************************************************/
 gboolean
-check_applet_state(void){
+check_applet_state(gint number){
+
+    HDConfigFile *config_file = NULL;
+    GKeyFile *gkey_file = NULL;
+    gchar *str = NULL;
+    gboolean result = FALSE;
+    if (number > 4 || number < 1)
+        return FALSE;
+
+    str = g_strdup_printf("livewp-home-widget.desktop-%i", (number - 1));
+    config_file = hd_config_file_new(NULL, "/home/user/.config/hildon-desktop/", "home.plugins");
+    
+    gkey_file = hd_config_file_load_file(config_file, FALSE);
+    if (gkey_file && str){
+        result = g_key_file_has_group(gkey_file, str);
+        g_free(str);
+    }
+    return result;
+#if 0
     FILE    *file_in = NULL;
     gchar buffer[2048];
-    gboolean result = FALSE;
 
     file_in = fopen("/home/user/.config/hildon-desktop/home.plugins","r");
     if (file_in){
@@ -233,32 +531,60 @@ check_applet_state(void){
        }
         fclose(file_in);
     }
-    return result;
+#endif
 }
 /*******************************************************************************/
 void
-start_applet(void){
+start_applet(gint number){
 
     HDConfigFile *config_file = NULL;
     GKeyFile *gkey_file = NULL;
+    gchar *str = NULL;
 
+    if (number > 4 || number < 1)
+        return;
+    str = g_strdup_printf("livewp-home-widget.desktop-%i",(number - 1));
     config_file = hd_config_file_new(NULL, "/home/user/.config/hildon-desktop/", "home.plugins");
     
     gkey_file = hd_config_file_load_file(config_file, FALSE);
     if (gkey_file){
-        g_key_file_set_string (gkey_file, "livewp-home-widget.desktop-0", "X-Desktop-File", "/usr/share/applications/hildon-home/livewp-home-widget.desktop");
+        g_key_file_set_string (gkey_file, str, "X-Desktop-File", "/usr/share/applications/hildon-home/livewp-home-widget.desktop");
         hd_config_file_save_file( config_file, gkey_file);
         g_key_file_free(gkey_file);
     }else
         fprintf(stderr, "Problem with config file");
+    if (str)
+        g_free(str);
     g_object_unref(config_file);
 }
 /*******************************************************************************/
 void
-stop_applet(void){
+stop_applet(gint number){
+    HDConfigFile *config_file = NULL;
+    GKeyFile *gkey_file = NULL;
+    gchar *str = NULL;
+
+    if (number > 4 || number < 1)
+        return;
+    str = g_strdup_printf("livewp-home-widget.desktop-%i", (number - 1));
+    config_file = hd_config_file_new(NULL, "/home/user/.config/hildon-desktop/", "home.plugins");
+    
+    gkey_file = hd_config_file_load_file(config_file, FALSE);
+    if (gkey_file){
+         g_key_file_remove_group(gkey_file, str, NULL);  
+        hd_config_file_save_file( config_file, gkey_file);
+        g_key_file_free(gkey_file);
+    }else
+        fprintf(stderr, "Problem with config file");
+    if (str)
+        g_free(str);
+    g_object_unref(config_file);
+
+#if 0    
     FILE    *file_in;
     FILE    *file_out;
     gchar buffer[2048];
+    gchar * str = NULL;
 
     file_in = fopen("/home/user/.config/hildon-desktop/home.plugins","r");
     file_out = fopen("/tmp/livewallpaper.plugins","w");
@@ -266,10 +592,14 @@ stop_applet(void){
         while (!feof(file_in)) {
             memset(buffer, 0, sizeof(buffer));
             fgets(buffer, sizeof(buffer) - 1, file_in);
-            if (strcmp(buffer, "[livewp-home-widget.desktop-0]\n") &&
+            str = g_strdup_printf("[livewp-home-widget.desktop-%i]\n", number);
+            if (strcmp(buffer, str) &&
                 strcmp(buffer, "X-Desktop-File=/usr/share/applications/hildon-home/livewp-home-widget.desktop\n"))
                 fputs(buffer, file_out);
         }
+        if (str){
+            g_free(str);
+        }
         fclose(file_out);
         fclose(file_in);
         file_in = fopen("/tmp/livewallpaper.plugins","r");
@@ -285,4 +615,5 @@ stop_applet(void){
             unlink ("/tmp/livewallpaper.plugins");
         }
     }
+#endif
 }