[gnac/devel] Ask the user only once to install a missing plugin



commit dace63998d442a339bc23073d38bc5709bf1e73c
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date:   Fri Jun 18 07:59:14 2010 +0100

    Ask the user only once to install a missing plugin

 libgnac/libgnac-converter.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/libgnac/libgnac-converter.c b/libgnac/libgnac-converter.c
index 675ecb5..0e9d164 100644
--- a/libgnac/libgnac-converter.c
+++ b/libgnac/libgnac-converter.c
@@ -1126,6 +1126,7 @@ void
 libgnac_converter_missing_plugin_result_cb(GstInstallPluginsReturn result,
                                            gpointer                data)
 {
+  LibgnacConverterPrivate *priv;
   LibgnacConverter *converter = NULL;
   LibgnacMediaItem *item = NULL;
   gchar *uri;
@@ -1133,7 +1134,8 @@ libgnac_converter_missing_plugin_result_cb(GstInstallPluginsReturn result,
   converter = (LibgnacConverter*)data;
   g_return_if_fail(LIBGNAC_IS_CONVERTER(converter));
 
-  item = converter->priv->current;
+  priv = converter->priv;
+  item = priv->current;
 
   if (result == GST_INSTALL_PLUGINS_SUCCESS ||
       result == GST_INSTALL_PLUGINS_PARTIAL_SUCCESS)
@@ -1152,6 +1154,24 @@ libgnac_converter_missing_plugin_result_cb(GstInstallPluginsReturn result,
     g_signal_emit(converter, signals[ERROR], 0, uri, 
                     _("Unable to handle this format"), NULL);
     g_free(uri);
+    /* ask the user only once */
+    if (result == GST_INSTALL_PLUGINS_USER_ABORT ||
+        result == GST_INSTALL_PLUGINS_NOT_FOUND)
+    {
+      gchar *key;
+      while ((key = g_queue_pop_head(priv->queue_copy))) {
+        item = g_hash_table_lookup(priv->file_table, key);
+        if (item) {
+          gchar *uri;
+          uri = g_file_get_uri(item->source);
+          g_signal_emit(converter, signals[ERROR], 0, uri,
+              _("Unable to handle this format"), NULL);
+          g_free(uri);
+        }
+      }
+      g_signal_emit(converter, signals[COMPLETION], 0);
+      return;
+    }
   }
 
   if (!libgnac_converter_start_next(converter))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]