[gnac/devel] Reactivated main window's controls after plugin installation



commit 827fc75aa84bc9bef0ba538be54849784e2019d1
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date:   Thu Jun 10 12:05:40 2010 +0100

    Reactivated main window's controls after plugin installation

 libgnac/libgnac-converter.c |   26 +++++++++++++++++---------
 libgnac/libgnac-converter.h |    5 ++++-
 src/gnac-bars.c             |   13 +++++++++++++
 src/gnac-bars.h             |    3 +++
 src/gnac-main.c             |   12 +++++++++---
 5 files changed, 46 insertions(+), 13 deletions(-)
---
diff --git a/libgnac/libgnac-converter.c b/libgnac/libgnac-converter.c
index bef4d6b..675ecb5 100644
--- a/libgnac/libgnac-converter.c
+++ b/libgnac/libgnac-converter.c
@@ -546,8 +546,8 @@ libgnac_converter_class_init(LibgnacConverterClass *klass)
       G_SIGNAL_RUN_LAST,
       G_STRUCT_OFFSET(LibgnacConverterClass, plugin_install),
       NULL, NULL,
-      g_cclosure_marshal_VOID__VOID,
-      G_TYPE_NONE, 0);
+      g_cclosure_marshal_VOID__BOOLEAN,
+      G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
 
   signals[ERROR] = g_signal_new("error",
       G_TYPE_FROM_CLASS(gobject_class),
@@ -633,12 +633,13 @@ libgnac_converter_restart_current(LibgnacConverter *self)
 
   if (priv->current) 
   {
-      libgnac_item_run(priv->current, &err);
-      if (err) {
-        g_clear_error(&err);
-        return FALSE;
-      }
-      return TRUE;
+    libgnac_converter_emit_plugin_installed(self);
+    libgnac_item_run(priv->current, &err);
+    if (err) {
+      g_clear_error(&err);
+      return FALSE;
+    }
+    return TRUE;
   }
   return FALSE;
 }
@@ -883,7 +884,14 @@ libgnac_converter_resume(LibgnacConverter  *self,
 void
 libgnac_converter_emit_plugin_install(LibgnacConverter *self)
 {
-  g_signal_emit(self, signals[PLUGIN_INSTALL], 0);
+  g_signal_emit(self, signals[PLUGIN_INSTALL], 0, FALSE);
+}
+
+
+void
+libgnac_converter_emit_plugin_installed(LibgnacConverter *self)
+{
+  g_signal_emit(self, signals[PLUGIN_INSTALL], 0, TRUE);
 }
 
 
diff --git a/libgnac/libgnac-converter.h b/libgnac/libgnac-converter.h
index 944cd50..e2af733 100644
--- a/libgnac/libgnac-converter.h
+++ b/libgnac/libgnac-converter.h
@@ -82,7 +82,7 @@ typedef struct
   void (*started) (LibgnacConverter *converter);
   void (*stopped) (LibgnacConverter *converter);
   void (*completion) (LibgnacConverter *converter);
-  void (*plugin_install) (LibgnacConverter *converter);
+  void (*plugin_install) (LibgnacConverter *converter, gboolean done);
   void (*error) (LibgnacConverter *converter, gchar *uri, gchar *msg, GError *error);
 
 } LibgnacConverterClass;
@@ -129,6 +129,9 @@ libgnac_converter_resume(LibgnacConverter  *self,
 void
 libgnac_converter_emit_plugin_install(LibgnacConverter *converter);
 
+void
+libgnac_converter_emit_plugin_installed(LibgnacConverter *converter);
+
 /* Callbacks */
 
 void
diff --git a/src/gnac-bars.c b/src/gnac-bars.c
index 1eb9b06..692c09f 100644
--- a/src/gnac-bars.c
+++ b/src/gnac-bars.c
@@ -218,6 +218,19 @@ gnac_bars_on_plugin_install(void)
 
 
 void
+gnac_bars_on_plugin_installed(void)
+{
+  gnac_bars_activate_add(TRUE);
+  gnac_bars_activate_clear(TRUE);
+  gnac_bars_activate_convert(TRUE);
+  gnac_bars_activate_pause(TRUE);
+  gnac_bars_activate_preferences(TRUE);
+  gnac_bars_activate_remove(TRUE);
+  gnac_bars_activate_quit(TRUE);
+}
+
+
+void
 gnac_bars_activate_properties(gboolean activate)
 {
   GtkAction *action;
diff --git a/src/gnac-bars.h b/src/gnac-bars.h
index 4a1b710..78e0514 100644
--- a/src/gnac-bars.h
+++ b/src/gnac-bars.h
@@ -63,6 +63,9 @@ gnac_bars_on_convert_resume(void);
 void
 gnac_bars_on_plugin_install(void);
 
+void
+gnac_bars_on_plugin_installed(void);
+
 void 
 gnac_bars_activate_properties(gboolean activate);
 
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 57ab095..61700bf 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -692,10 +692,16 @@ gnac_on_converter_stopped_cb(LibgnacConverter *converter)
 
 
 static void
-gnac_on_converter_plugin_install_cb(LibgnacConverter *converter)
+gnac_on_converter_plugin_install_cb(LibgnacConverter *converter,
+                                    gboolean          done)
 {
-  gnac_change_state(GNAC_PLUGIN_INSTALL_STATE);
-  gnac_ui_push_status(_("Codec installer started"));
+  if (done) {
+    gnac_bars_on_plugin_installed();
+    gnac_change_state(GNAC_AUDIO_CONVERT_STATE);
+  } else {
+    gnac_change_state(GNAC_PLUGIN_INSTALL_STATE);
+    gnac_ui_push_status(_("Codec installer started"));
+  }
 }
 
 



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