added select file into dialog flash
authorVlad <vlad@gas.by>
Tue, 28 Sep 2010 11:28:41 +0000 (14:28 +0300)
committerVlad <vlad@gas.by>
Tue, 28 Sep 2010 11:28:41 +0000 (14:28 +0300)
applet/data/external_themes/flash.xml
applet/src/livewp-scene.c
applet/src/livewp-settings.c

index e7756f0..d237165 100644 (file)
@@ -1,12 +1,10 @@
 <theme>
     <name>Flash</name>
     <exec_path>/opt/kmplayer/bin/knpplayer -m application/x-shockwave-flash -p /usr/lib/browser/plugins/libflashplayer.so</exec_path>
-    <category>Unknown</category>
+    <category>LiveWallpaper</category>
     <icon_on>/usr/share/livewp/theme/Conky/icon.png</icon_on>       
     <icon_off>/usr/share/livewp/theme/Conky/icond.png</icon_off>       
     <gtk_socket_id>-wid</gtk_socket_id>
     <check_path>/opt/kmplayer/bin/knpplayer</check_path>
     <install_file>http://maemo.org/downloads/product/raw/Maemo5/kmplayer/?get_installfile</install_file>
-    <file id="file" _label="File" arg="file://%"/>
-    <added_string>file:///home/user/flash_matrix.swf</added_string>
 </theme>
index 32b907f..ffd4abe 100644 (file)
@@ -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);
 
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){