}
/********************************************************************************/
+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")){
+ }
+ if (!strcmp(choice, "Modern")){
+ }
+ if (!strcmp(choice, "Matrix")){
+ }
+ if (!strcmp(choice, "Video")){
+ additional_parametr_for_theme_video(vbox, priv);
+ }
+
+ }
+ gtk_widget_show(vbox);
+}
+
+/********************************************************************************/
GtkWidget *
create_themes_button (gchar *theme){
}
}
+
return button;
}
window = gtk_dialog_new();
- priv->window = window;
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);
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
{
- if (priv->theme_string_parametr1)
- g_free(priv->theme_string_parametr1);
- priv->theme_string_parametr1 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
- hildon_button_set_value (button, priv->theme_string_parametr1);
+ hildon_button_set_value (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);
+ 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;
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);
}
GtkWidget *theme_button;
GtkWidget *enable_button;
GtkWidget *vbox;
- GtkWidget *rich_animation_button;
+ GtkWidget *button1 = NULL;
+ GtkWidget *rich_animation_button = NULL;
gint view = priv->view;
window = gtk_dialog_new();
+ priv->window = window;
gtk_window_set_title(GTK_WINDOW(window), _("View Settings"));
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
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);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
- rich_animation_button, TRUE, TRUE, 5);
-
+
/* 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),
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)), _("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);
save_button = gtk_dialog_add_button(GTK_DIALOG(window), _("Save"), GTK_RESPONSE_YES);
priv->theme = g_strdup("Matrix");
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 = hildon_button_get_value (button1);
+ }
}
}
- /* Check rich animation */
- if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(rich_animation_button)))
- priv->rich_animation = TRUE;
- else
- priv->rich_animation = FALSE;
+ rich_animation_button = g_object_get_data(G_OBJECT(priv->window), "filename_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;
+ }
/* Save config */
save_config(priv);
/* action with applet */