+ GtkWidget *banner = NULL;
+ GtkWidget *area_hbox;
+ GtkWidget *scrolled_window;
+ GtkWidget *one_in_all_view_button;
+ gboolean one_in_all_view;
+ gint i;
+
+ window = gtk_dialog_new();
+ priv->window = window;
+
+ one_in_all_view = priv->one_in_all_view;
+ 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);
+ one_in_all_view_button = create_bool_button(priv->one_in_all_view, _("One theme in all views"));
+ g_signal_connect (G_OBJECT (one_in_all_view_button), "toggled", G_CALLBACK (changed_value_one_in_all_cb), priv);
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), one_in_all_view_button, TRUE, TRUE, 5);
+ area_hbox = gtk_vbox_new(FALSE, 2);
+ g_object_set_data(G_OBJECT(window), "area_hbox", area_hbox);
+
+ create_themes_buttons_hbox(priv);
+ scrolled_window = hildon_pannable_area_new ();
+ g_object_set (G_OBJECT (scrolled_window), "mov-mode", HILDON_MOVEMENT_MODE_HORIZ, NULL);
+ g_object_set (G_OBJECT (scrolled_window), "hscrollbar-policy", GTK_POLICY_ALWAYS, NULL);
+ g_object_set (G_OBJECT (scrolled_window), "scrollbar-fade-delay", 27000, NULL);
+ g_object_set (G_OBJECT (scrolled_window), "indicator-width", 28, NULL);
+ gtk_widget_set_size_request(scrolled_window, -1, 120);
+ hildon_pannable_area_add_with_viewport(HILDON_PANNABLE_AREA (scrolled_window), GTK_WIDGET (area_hbox));
+
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
+ scrolled_window, TRUE, TRUE, 0);
+
+ gtk_widget_show(scrolled_window);
+ gtk_widget_show(one_in_all_view_button);
+ gtk_widget_show_all(area_hbox);
+ gtk_widget_show(window);
+ gtk_dialog_add_button(GTK_DIALOG(window), _("About"), GTK_RESPONSE_NO);
+
+ result = gtk_dialog_run(GTK_DIALOG(window));
+
+ switch(result){
+ case GTK_RESPONSE_NO:
+ gtk_widget_destroy(window);
+ window = NULL;
+ lw_about();
+ break;
+ }
+
+ if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(one_in_all_view_button)) != one_in_all_view){
+ save_one_in_all_views_to_config(hildon_check_button_get_active (HILDON_CHECK_BUTTON(one_in_all_view_button)));
+ //fprintf(stderr,"CHECK!!!!!!!!!!!!!!\n");
+ banner = hildon_banner_show_information (window, NULL, _("Livewallpaper is reloading..."));
+ hildon_banner_set_timeout(HILDON_BANNER(banner), 3000);
+ for (i=1;i<10;i++)
+ stop_applet(i);
+ g_timeout_add(3000, (GSourceFunc)cb_timeout_settings, window);
+ }else{
+ if (window)
+ gtk_widget_destroy(window);
+ }
+}
+/*******************************************************************************/
+gboolean
+cb_timeout_settings(GtkWidget *window){
+
+ gint i;
+ for (i=1;i<10;i++)
+ start_applet(i);
+
+ if (window)
+ gtk_widget_destroy(window);
+ return FALSE;
+}
+/*******************************************************************************/
+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_bool_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
+link_button_clicked(GtkButton *button, gchar *url){
+
+ gchar * cmd = g_strdup_printf("dbus-send --print-reply --dest=com.nokia.osso_browser \
+ /com/nokia/osso_browser/service com.nokia.osso_browser.open_new_window string:%s", url);
+ fprintf(stderr, "system %s\n", cmd);
+ system(cmd);
+ g_free(cmd);
+}
+/*******************************************************************************/
+void
+additional_parametr_for_theme_video(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);
+ /* Create rich animation button */
+ rich_animation_button = create_bool_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);
+ /* Create Smoothing button */
+
+ smoothing_button = create_bool_button(priv->theme_bool_parametr1, _("Smoothing (Need more memory)"));
+ gtk_box_pack_start(GTK_BOX(vbox),
+ smoothing_button, TRUE, TRUE, 5);
+ g_object_set_data(G_OBJECT(priv->window), "smoothing_button", smoothing_button);
+
+ link_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT,HILDON_BUTTON_ARRANGEMENT_VERTICAL,
+ _("Press me for"), _("download more videos"));
+
+ g_signal_connect (link_button, "clicked", G_CALLBACK (link_button_clicked), "http://talk.maemo.org/showthread.php?t=60185");
+ gtk_box_pack_start(GTK_BOX(vbox),
+ link_button, TRUE, TRUE, 5);
+
+ gtk_widget_show (smoothing_button);
+ gtk_widget_show (file_button);
+ gtk_widget_show (rich_animation_button);
+ gtk_widget_show (link_button);
+
+}
+/*******************************************************************************/
+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);
+ hildon_banner_show_information(GTK_WIDGET(widget), NULL, text);
+ g_free(text);
+}
+/*******************************************************************************/
+void
+show_duplicate_theme (GtkWidget *widget, gchar *theme_name){
+ gchar *text;
+ text = g_strdup_printf(_("Theme %s has already been selected"), theme_name);
+ hildon_banner_show_information(GTK_WIDGET(widget), NULL, text);
+ g_free(text);
+}
+
+/*******************************************************************************/
+void
+lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
+ gint result;
+ GtkWidget *window = NULL;
+ GtkWidget *scrolled_window = NULL;