added select file into dialog
[livewp] / applet / src / livewp-settings.c
index 16c479c..3da182e 100644 (file)
@@ -66,7 +66,6 @@ create_category_selector (Animation_WallpaperPrivate *priv){
 
     selector = hildon_touch_selector_new_text();
 
-    hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), "LiveWallpaper" );
 
     result_table = g_hash_table_new(g_str_hash, g_str_equal);
     while (store){
@@ -82,6 +81,11 @@ create_category_selector (Animation_WallpaperPrivate *priv){
             g_hash_table_insert(result_table, "Xscreensaver", (gint *)1);
             hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), "Xscreensaver");
     }
+    /* Add LiveWallpaper to selector */
+    if (!g_hash_table_lookup(result_table,"LiveWallpaper")){
+        hildon_touch_selector_prepend_text (HILDON_TOUCH_SELECTOR (selector), "LiveWallpaper" );
+    }
+
     return selector;
 }
 
@@ -232,6 +236,10 @@ changed_value_theme_cb (HildonPickerButton *picker, Animation_WallpaperPrivate *
         if (!strcmp(choice, _("Video"))){
             additional_parametr_for_theme_video(vbox, priv);
         }
+        if (!strcmp(choice, _("Flash"))){
+            additional_parametr_for_theme_flash(vbox, priv);
+        }
+
     }
     gtk_widget_show(vbox);
 }
@@ -669,6 +677,30 @@ additional_parametr_for_theme_video(GtkWidget *vbox, Animation_WallpaperPrivate
 }
 /*******************************************************************************/
 void
+additional_parametr_for_theme_flash(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
+
+    GtkWidget *file_button;
+    GtkWidget *link_button;
+    GtkWidget *smoothing_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);
+    gtk_widget_show (file_button);
+}
+/*******************************************************************************/
+
+void
 show_problem_package (GtkWidget *widget, gchar *package_name){
     gchar *text;
     text = g_strdup_printf(_("You haven't got the installed package %s. Please install it via using Application Manager"), package_name);
@@ -841,6 +873,14 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
                             priv->theme_bool_parametr1 = FALSE;
                     }
                 }
+                if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _("Flash"))){
+                    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)));
+                    }
+                }
                 /* Check external themes */
                 GSList *store = priv->extheme_list;
                 while (store){