From: Vlad Date: Tue, 28 Sep 2010 11:28:41 +0000 (+0300) Subject: added select file into dialog X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=b37eede1b9cf14d67fe945639a93e75d928dad9a;p=livewp added select file into dialog --- diff --git a/applet/data/external_themes/flash.xml b/applet/data/external_themes/flash.xml index e7756f0..d237165 100644 --- a/applet/data/external_themes/flash.xml +++ b/applet/data/external_themes/flash.xml @@ -1,12 +1,10 @@ Flash /opt/kmplayer/bin/knpplayer -m application/x-shockwave-flash -p /usr/lib/browser/plugins/libflashplayer.so - Unknown + LiveWallpaper /usr/share/livewp/theme/Conky/icon.png /usr/share/livewp/theme/Conky/icond.png -wid /opt/kmplayer/bin/knpplayer http://maemo.org/downloads/product/raw/Maemo5/kmplayer/?get_installfile - - file:///home/user/flash_matrix.swf diff --git a/applet/src/livewp-scene.c b/applet/src/livewp-scene.c index 32b907f..ffd4abe 100644 --- a/applet/src/livewp-scene.c +++ b/applet/src/livewp-scene.c @@ -231,6 +231,7 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){ *strwin = NULL, *strsocket = NULL, *addedstring = NULL, + *theme_string_parametr1 = NULL, *straddedstring = NULL, *strview = NULL; gint i; @@ -265,7 +266,12 @@ init_scene_External(AWallpaperPlugin *desktop_plugin){ }else straddedstring = ""; - run_string = g_strdup_printf("%s%s%s%s%s", exec_path, strwin, strview, strsocket, straddedstring); + if (desktop_plugin->priv->theme_string_parametr1){ + theme_string_parametr1 = g_strdup_printf(" %s", desktop_plugin->priv->theme_string_parametr1); + }else + theme_string_parametr1 = ""; + + run_string = g_strdup_printf("%s%s%s%s%s%s", exec_path, strwin, strview, strsocket, straddedstring, theme_string_parametr1); fprintf(stderr, "runs string = %s\n", run_string); parsestring(run_string, child_argv); diff --git a/applet/src/livewp-settings.c b/applet/src/livewp-settings.c index 16c479c..3da182e 100644 --- a/applet/src/livewp-settings.c +++ b/applet/src/livewp-settings.c @@ -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){