fixed time to change image, added icons to slideshow and flash, added change image...
[livewp] / applet / src / livewp-settings.c
index 6bc84fd..db6006c 100644 (file)
@@ -329,7 +329,7 @@ fill_theme_button (Animation_WallpaperPrivate *priv, GtkWidget *button, gchar *c
                 hildon_button_set_value(HILDON_BUTTON(button), _("Video"));
             }
             if (!strcmp(theme, "Slideshow")){
-                hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 4);
+                hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 5);
                 hildon_button_set_value(HILDON_BUTTON(button), _("Slideshow"));
             }
        }
@@ -439,7 +439,35 @@ create_categories_button (Animation_WallpaperPrivate *priv){
     }
     return button;
 }
-
+/*******************************************************************************/
+GtkWidget *
+create_time_button (guint *active, gchar *name)
+{
+       GtkWidget *button;
+       GtkWidget *selector;
+       guint values[5] = {20, 40, 60, 120, 300};
+       int i, num = 0;
+       gchar *str;
+
+       button = hildon_picker_button_new (HILDON_SIZE_FINGER_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL);
+       hildon_button_set_title (HILDON_BUTTON (button), name);
+
+       selector = hildon_touch_selector_new_text();
+       for (i=0; i<5; i++){
+               str = g_strdup_printf("%d", values[i]);
+               hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), str);
+               if (values[i] == active) num = i;
+       }
+       hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
+                       HILDON_TOUCH_SELECTOR (selector));
+       hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, num);
+       if (active){
+        str = g_strdup_printf("%d", active);
+               hildon_button_set_value(HILDON_BUTTON(button), str);
+    }else
+               hildon_button_set_value(HILDON_BUTTON(button), "");
+       return button;
+}
 /*******************************************************************************/
 GtkWidget *
 create_bool_button (gboolean active, gchar *name)
@@ -730,9 +758,7 @@ void
 additional_parametr_for_theme_slideshow(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
 
     GtkWidget *file_button;
-    GtkWidget *link_button;
-    GtkWidget *smoothing_button;
-    GtkWidget *rich_animation_button;
+    GtkWidget *time_button;
 
     if (priv->theme_string_parametr1)
         file_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL,
@@ -743,9 +769,17 @@ additional_parametr_for_theme_slideshow(GtkWidget *vbox, Animation_WallpaperPriv
 
     g_signal_connect (file_button, "clicked", G_CALLBACK (folder_button_clicked), priv);
 
-    gtk_box_pack_start(GTK_BOX(vbox),
-                                   file_button, TRUE, TRUE, 5);
+    gtk_box_pack_start(GTK_BOX(vbox), file_button, TRUE, TRUE, 5);
     g_object_set_data(G_OBJECT(priv->window), "filename_button", file_button);
+
+    if (priv->theme_int_parametr1)
+       time_button = create_time_button(priv->theme_int_parametr1, _("Time to change image"));
+    else
+       time_button = create_time_button(0, _("Time to change image"));
+    gtk_box_pack_start(GTK_BOX(vbox), time_button, TRUE, TRUE, 5);
+    g_object_set_data(G_OBJECT(priv->window), "time_button", time_button);
+
+    gtk_widget_show (time_button);
     gtk_widget_show (file_button);
 }
 /*******************************************************************************/
@@ -779,11 +813,11 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
     GtkWidget *vbox;
     GtkWidget *area_vbox;
     GtkWidget *temp_button;
-    GtkWidget *button1 = NULL;
+    GtkWidget *button1 = NULL, *button2 = NULL;
     GtkWidget *rich_animation_button = NULL;
     GtkWidget *confirm;
     gint view = priv->view;
-    gint count;
+    gint count, int_param;
     gchar *text;
 
     window = gtk_dialog_new();
@@ -892,6 +926,13 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
                                        g_free(priv->theme_string_parametr1);
                                                priv->theme_string_parametr1 = g_strdup((gchar*)hildon_button_get_value (HILDON_BUTTON(button1)));
                        }
+                       button2 = g_object_get_data(G_OBJECT(priv->window), "time_button");
+                       if (button2){
+                               //if (priv->theme_int_parametr1)
+                               //      g_free(priv->theme_int_parametr1);
+                        int_param = atoi(hildon_button_get_value (HILDON_BUTTON(button2)));
+                               priv->theme_int_parametr1 = int_param;
+                       }
                 }
                 /* Check external themes */
                 GSList *store = priv->extheme_list;