[Goodies-commits] r7718 - xfburn/trunk/xfburn

David Mohr squisher at xfce.org
Mon Jul 13 05:24:04 CEST 2009


Author: squisher
Date: 2009-07-13 03:24:04 +0000 (Mon, 13 Jul 2009)
New Revision: 7718

Added:
   xfburn/trunk/xfburn/xfburn-cclosure-marshal.list
Modified:
   xfburn/trunk/xfburn/Makefile.am
   xfburn/trunk/xfburn/xfburn-audio-composition.c
   xfburn/trunk/xfburn/xfburn-blank-dialog.c
   xfburn/trunk/xfburn/xfburn-burn-audio-cd-composition-dialog.c
   xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c
   xfburn/trunk/xfburn/xfburn-burn-image-dialog.c
   xfburn/trunk/xfburn/xfburn-data-composition.c
   xfburn/trunk/xfburn/xfburn-device-box.c
   xfburn/trunk/xfburn/xfburn-device-box.h
   xfburn/trunk/xfburn/xfburn-device-list.c
   xfburn/trunk/xfburn/xfburn-device-list.h
Log:
Fixing the signal mess; use proper c closure marshal, DeviceBox now relays a signal from DeviceList for ease of use

Modified: xfburn/trunk/xfburn/Makefile.am
===================================================================
--- xfburn/trunk/xfburn/Makefile.am	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/Makefile.am	2009-07-13 03:24:04 UTC (rev 7718)
@@ -45,6 +45,7 @@
 	xfburn-fs-browser.h						\
 	xfburn-directory-browser.h					\
 	xfburn-preferences-dialog.h					\
+	xfburn-cclosure-marshal.h					\
 	xfburn-stock.h							\
 	xfburn-utils.h							\
 	xfburn-main.h
@@ -86,6 +87,7 @@
 	xfburn-fs-browser.c 						\
 	xfburn-directory-browser.c					\
 	xfburn-preferences-dialog.c					\
+	xfburn-cclosure-marshal.c					\
 	xfburn-stock.c							\
 	xfburn-utils.c
 
@@ -120,6 +122,16 @@
 
 endif
 
+xfburn-cclosure-marshal.h: xfburn-cclosure-marshal.list
+	glib-genmarshal --header --prefix=xfburn_cclosure_marshal $< > $@
+
+xfburn-cclosure-marshal.c: xfburn-cclosure-marshal.list
+	glib-genmarshal --body --prefix=xfburn_cclosure_marshal $< > $@
+
+BUILT_SOURCES = 							\
+	xfburn-cclosure-marshal.h					\
+	xfburn-cclosure-marshal.c
+
 # remove these when they're added to the build; needed
 # for make distcheck (--brian)
 missing_files = \
@@ -132,5 +144,6 @@
 	xfburn-create-iso-progress-dialog.c
 
 EXTRA_DIST = $(missing_files)
+DISTCLEANFILES = $(BUILT_SOURCES)
 
 # vi:set ts=8 sw=8 noet ai nocindent softtabstop=0 list listchars=tab\:>-:

Modified: xfburn/trunk/xfburn/xfburn-audio-composition.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-audio-composition.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-audio-composition.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -1718,6 +1718,8 @@
         continue;
       full_path = thunar_vfs_path_dup_string (vfs_path);
 
+      thunar_vfs_path_unref (vfs_path);
+
 #else /* no thunar-vfs */
 
       if (g_str_has_prefix (file, "file://"))

Modified: xfburn/trunk/xfburn/xfburn-blank-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-blank-dialog.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-blank-dialog.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -104,7 +104,7 @@
 static gboolean thread_blank_perform_blank (ThreadBlankParams * params, struct burn_drive_info *drive_info);
 static void thread_blank (ThreadBlankParams * params);
 static void xfburn_blank_dialog_response_cb (XfburnBlankDialog * dialog, gint response_id, gpointer user_data);
-static void cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBlankDialog * dialog);
+static void cb_volume_changed (GtkWidget *device_box, gboolean device_changed, XfburnDevice *device, XfburnBlankDialog * dialog);
 
 static XfceTitledDialogClass *parent_class = NULL;
 
@@ -204,7 +204,7 @@
 
   /* devices list */
   priv->device_box = xfburn_device_box_new (SHOW_CDRW_WRITERS | BLANK_MODE);
-  g_signal_connect (G_OBJECT (priv->device_box), "disc-refreshed", G_CALLBACK (cb_disc_refreshed), obj);
+  g_signal_connect (G_OBJECT (priv->device_box), "volume-changed", G_CALLBACK (cb_volume_changed), obj);
   gtk_widget_show (priv->device_box);
 
   frame = xfce_create_framebox_with_content (_("Burning device"), priv->device_box);
@@ -285,7 +285,7 @@
 
   XfburnDeviceList *devlist = xfburn_device_list_new ();
 
-  g_object_get (G_OBJECT (xfburn_device_list_get_current_device (devlist)), "profile-no", &profile_no, "erasable", &erasable, "disc-status)", &disc_state, NULL);
+  g_object_get (G_OBJECT (xfburn_device_list_get_current_device (devlist)), "profile-no", &profile_no, "erasable", &erasable, "disc-status", &disc_state, NULL);
   g_object_unref (devlist);
   
   if (profile_no == 0x13) {
@@ -522,7 +522,7 @@
 }
    
 static void
-cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBlankDialog * dialog)
+cb_volume_changed (GtkWidget *device_box, gboolean device_changed, XfburnDevice *device, XfburnBlankDialog * dialog)
 {
   //XfburnBlankDialogPrivate *priv = XFBURN_BLANK_DIALOG_GET_PRIVATE (dialog);
 
@@ -537,7 +537,7 @@
   GtkWidget *obj;
 
   obj = GTK_WIDGET (g_object_new (XFBURN_TYPE_BLANK_DIALOG, NULL));
-  cb_disc_refreshed (NULL, NULL, XFBURN_BLANK_DIALOG (obj));
+  cb_volume_changed (NULL, TRUE, NULL, XFBURN_BLANK_DIALOG (obj));
 
   xfburn_main_enter_window ();
 

Modified: xfburn/trunk/xfburn/xfburn-burn-audio-cd-composition-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-audio-cd-composition-dialog.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-burn-audio-cd-composition-dialog.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -76,7 +76,7 @@
 static void xfburn_burn_audio_cd_composition_dialog_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec);
 static void xfburn_burn_audio_cd_composition_dialog_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec);
 
-static void cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBurnAudioCdCompositionDialog * dialog);
+static void cb_volume_changed (GtkWidget *device_box, gboolean device_changed, XfburnDevice *device, XfburnBurnAudioCdCompositionDialog * dialog);
 static void cb_dialog_response (XfburnBurnAudioCdCompositionDialog * dialog, gint response_id,
                                 XfburnBurnAudioCdCompositionDialogPrivate * priv);
 
@@ -154,8 +154,7 @@
 
   /* burning devices list */
   priv->device_box = xfburn_device_box_new (SHOW_CD_WRITERS | SHOW_CDRW_WRITERS | SHOW_SPEED_SELECTION | ACCEPT_ONLY_CD);
-  g_signal_connect (G_OBJECT (priv->device_box), "disc-refreshed", G_CALLBACK (cb_disc_refreshed), obj);
-  g_signal_connect (G_OBJECT (priv->device_box), "device-changed", G_CALLBACK (cb_disc_refreshed), obj);
+  g_signal_connect (G_OBJECT (priv->device_box), "volume-changed", G_CALLBACK (cb_volume_changed), obj);
   gtk_widget_show (priv->device_box);
 
   priv->frame_device = xfce_create_framebox_with_content (_("Burning device"), priv->device_box);
@@ -229,7 +228,7 @@
   gtk_widget_grab_focus (button);
   gtk_widget_grab_default (button);
 
-  cb_disc_refreshed (priv->device_box, xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box)), obj);
+  cb_volume_changed (priv->device_box, TRUE, xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box)), obj);
   g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (cb_dialog_response), priv);
 
   return gobj;
@@ -275,7 +274,7 @@
 
 /* internals */
 static void
-cb_disc_refreshed (GtkWidget *device_box, XfburnDevice *device, XfburnBurnAudioCdCompositionDialog * dialog)
+cb_volume_changed (GtkWidget *device_box, gboolean device_changed, XfburnDevice *device, XfburnBurnAudioCdCompositionDialog * dialog)
 {
   XfburnBurnAudioCdCompositionDialogPrivate *priv = XFBURN_BURN_AUDIO_CD_COMPOSITION_DIALOG_GET_PRIVATE (dialog);
   gboolean valid_disc;

Modified: xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -67,8 +67,6 @@
   */
 
   gint response;
-
-  XfburnDeviceList *devlist;
 } XfburnBurnDataCompositionBaseDialogPrivate;
 
 enum {
@@ -105,7 +103,7 @@
 */
 static void cb_check_only_iso_toggled (GtkToggleButton * button, XfburnBurnDataCompositionBaseDialog * dialog);
 static void cb_browse_iso (GtkButton * button, XfburnBurnDataCompositionBaseDialog * dialog);
-static void cb_disc_refreshed (XfburnDeviceList *devlist, XfburnDevice *device, XfburnBurnDataCompositionBaseDialog * dialog);
+static void cb_volume_changed (XfburnDeviceBox *box, gboolean device_changed, XfburnDevice *device, XfburnBurnDataCompositionBaseDialog * dialog);
 static void cb_dialog_response (XfburnBurnDataCompositionBaseDialog * dialog, gint response_id,
                                 XfburnBurnDataCompositionBaseDialogPrivate * priv);
 
@@ -188,10 +186,7 @@
   priv->device_box = xfburn_device_box_new (SHOW_CD_WRITERS | SHOW_CDRW_WRITERS | SHOW_MODE_SELECTION | SHOW_SPEED_SELECTION);
   gtk_widget_show (priv->device_box);
 
-  priv->devlist = xfburn_device_list_new ();
-  /* FIXME: change name of callback */
-  g_signal_connect (G_OBJECT (priv->devlist), "device-change-end", G_CALLBACK (cb_disc_refreshed), obj);
-  g_signal_connect (G_OBJECT (priv->devlist), "volume-change-end", G_CALLBACK (cb_disc_refreshed), obj);
+  g_signal_connect (G_OBJECT (priv->device_box), "volume-changed", G_CALLBACK (cb_volume_changed), obj);
 
   priv->frame_device = xfce_create_framebox_with_content (_("Burning device"), priv->device_box);
   gtk_widget_show (priv->frame_device);
@@ -295,7 +290,7 @@
   gtk_widget_grab_focus (button);
   gtk_widget_grab_default (button);
 
-  cb_disc_refreshed (priv->devlist, xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box)), obj);
+  cb_volume_changed (XFBURN_DEVICE_BOX (priv->device_box), TRUE, xfburn_device_box_get_selected_device (XFBURN_DEVICE_BOX (priv->device_box)), obj);
   g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (cb_dialog_response), priv);
 
   return gobj;
@@ -338,8 +333,6 @@
 
   iso_image_unref (priv->image);
   
-  g_object_unref (G_OBJECT (priv->devlist));
-
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -419,15 +412,13 @@
 }
 
 static void
-cb_disc_refreshed (XfburnDeviceList *devlist, XfburnDevice *device, XfburnBurnDataCompositionBaseDialog * dialog)
+cb_volume_changed (XfburnDeviceBox *box, gboolean device_changed, XfburnDevice *device, XfburnBurnDataCompositionBaseDialog * dialog)
 {
   XfburnBurnDataCompositionBaseDialogPrivate *priv = XFBURN_BURN_DATA_COMPOSITION_BASE_DIALOG_GET_PRIVATE (dialog);
   gboolean valid_disc;
 
-  DBG ("trace");
+  g_object_get (box, "valid", &valid_disc, NULL);
 
-  g_object_get (G_OBJECT (priv->device_box), "valid", &valid_disc, NULL);
-
   /*
    * Disabled: change button_proceed functionality
   if (!valid_disc && xfburn_device_list_get_disc_status () == BURN_DISC_FULL && xfburn_device_list_disc_is_erasable ()) {

Modified: xfburn/trunk/xfburn/xfburn-burn-image-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-image-dialog.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-burn-image-dialog.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -74,8 +74,7 @@
 static void xfburn_burn_image_dialog_init (XfburnBurnImageDialog * sp);
 
 void burn_image_dialog_error (XfburnBurnImageDialog * dialog, const gchar * msg_error);
-static void cb_device_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnBurnImageDialog * dialog);
-static void cb_volume_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnBurnImageDialog * dialog);
+static void cb_volume_change_end (XfburnDeviceList *devlist, gboolean device_changed, XfburnDevice *device, XfburnBurnImageDialog * dialog);
 static void cb_dialog_response (XfburnBurnImageDialog * dialog, gint response_id, gpointer user_data);
 
 static void update_image_label (GtkFileChooser *chooser, XfburnBurnImageDialog * dialog);
@@ -211,12 +210,11 @@
 
   devlist = xfburn_device_list_new ();
 
-  g_signal_connect (G_OBJECT (devlist), "device-change-end", G_CALLBACK (cb_device_change_end), obj);
   g_signal_connect (G_OBJECT (devlist), "volume-change-end", G_CALLBACK (cb_volume_change_end), obj);
   g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (cb_dialog_response), obj);
   device = xfburn_device_list_get_current_device (devlist);
 
-  cb_volume_change_end (devlist, device, obj);
+  cb_volume_change_end (devlist, TRUE, device, obj);
 
   if (device)
     gtk_widget_set_sensitive (priv->check_dummy, xfburn_device_can_dummy_write (device));
@@ -383,16 +381,12 @@
 }
 
 static void
-cb_device_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnBurnImageDialog * dialog)
+cb_volume_change_end (XfburnDeviceList *devlist, gboolean device_changed, XfburnDevice *device, XfburnBurnImageDialog * dialog)
 {
   XfburnBurnImageDialogPrivate *priv = XFBURN_BURN_IMAGE_DIALOG_GET_PRIVATE (dialog);
 
-  gtk_widget_set_sensitive (priv->check_dummy, xfburn_device_can_dummy_write (device));
-}
-
-static void
-cb_volume_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnBurnImageDialog * dialog)
-{
+  if (device_changed)
+    gtk_widget_set_sensitive (priv->check_dummy, xfburn_device_can_dummy_write (device));
   check_burn_button (dialog);
 }
 

Added: xfburn/trunk/xfburn/xfburn-cclosure-marshal.list
===================================================================
--- xfburn/trunk/xfburn/xfburn-cclosure-marshal.list	                        (rev 0)
+++ xfburn/trunk/xfburn/xfburn-cclosure-marshal.list	2009-07-13 03:24:04 UTC (rev 7718)
@@ -0,0 +1 @@
+VOID:BOOLEAN,OBJECT

Modified: xfburn/trunk/xfburn/xfburn-data-composition.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-data-composition.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-data-composition.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -1633,6 +1633,8 @@
         continue;
       full_path = thunar_vfs_path_dup_string (vfs_path);
 
+      thunar_vfs_path_unref (vfs_path);
+
 #else /* no thunar-vfs */
 
       if (g_str_has_prefix (file, "file://"))

Modified: xfburn/trunk/xfburn/xfburn-device-box.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-box.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-device-box.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -34,6 +34,7 @@
 #include "xfburn-settings.h"
 #include "xfburn-utils.h"
 #include "xfburn-blank-dialog.h"
+#include "xfburn-cclosure-marshal.h"
 
 #define XFBURN_DEVICE_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), XFBURN_TYPE_DEVICE_BOX, XfburnDeviceBoxPrivate))
 
@@ -59,6 +60,11 @@
   MODE_N_COLUMNS,
 };
 
+enum {
+  VOLUME_CHANGED,
+  LAST_SIGNAL
+};
+
 /* private struct */
 typedef struct
 {
@@ -84,6 +90,9 @@
 
   gboolean have_asked_for_blanking;
   gboolean accept_only_cd;
+
+  gulong handler_volume_change_start;
+  gulong handler_volume_change_end;
   
   XfburnDeviceList *devlist;
 } XfburnDeviceBoxPrivate;
@@ -103,10 +112,8 @@
 static void fill_combo_speed (XfburnDeviceBox *box, XfburnDevice *device);
 static void fill_combo_mode (XfburnDeviceBox *box, XfburnDevice *device);
 
-static void cb_device_change_start (XfburnDeviceList *devlist, XfburnDeviceBox *box);
-static void cb_device_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnDeviceBox *box);
-static void cb_volume_change_start (XfburnDeviceList *devlist, XfburnDevice *device, XfburnDeviceBox *box);
-static void cb_volume_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnDeviceBox *box);
+static void cb_volume_change_start (XfburnDeviceList *devlist, gboolean device_changed, XfburnDeviceBox *box);
+static void cb_volume_change_end (XfburnDeviceList *devlist, gboolean device_changed, XfburnDevice *device, XfburnDeviceBox *box);
 
 /* globals */
 static GtkVBoxClass *parent_class = NULL;
@@ -115,6 +122,8 @@
 /* XfburnDeviceBox class */
 /*************************/
 
+static guint signals[LAST_SIGNAL];
+
 GType
 xfburn_device_box_get_type (void)
 {
@@ -155,6 +164,10 @@
   object_class->set_property = xfburn_device_box_set_property;
   object_class->get_property = xfburn_device_box_get_property;
   
+  signals[VOLUME_CHANGED] = g_signal_new ("volume_changed", XFBURN_TYPE_DEVICE_BOX, G_SIGNAL_ACTION,
+                                          G_STRUCT_OFFSET (XfburnDeviceBoxClass, volume_changed),
+                                          NULL, NULL, xfburn_cclosure_marshal_VOID__BOOLEAN_OBJECT,
+                                          G_TYPE_NONE, 2, G_TYPE_BOOLEAN, XFBURN_TYPE_DEVICE);
     
   g_object_class_install_property (object_class, PROP_SHOW_WRITERS_ONLY, 
                                    g_param_spec_boolean ("show-writers-only", _("Show writers only"),
@@ -200,10 +213,8 @@
   priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
 
   priv->devlist = devlist = xfburn_device_list_new ();
-  g_signal_connect (G_OBJECT (devlist), "device-change-start", G_CALLBACK (cb_device_change_start), box);
-  g_signal_connect (G_OBJECT (devlist), "device-change-end", G_CALLBACK (cb_device_change_end), box);
-  g_signal_connect (G_OBJECT (devlist), "volume-change-start", G_CALLBACK (cb_volume_change_start), box);
-  g_signal_connect (G_OBJECT (devlist), "volume-change-end", G_CALLBACK (cb_volume_change_end), box);
+  priv->handler_volume_change_start = g_signal_connect (G_OBJECT (devlist), "volume-change-start", G_CALLBACK (cb_volume_change_start), box);
+  priv->handler_volume_change_end   = g_signal_connect (G_OBJECT (devlist), "volume-change-end", G_CALLBACK (cb_volume_change_end), box);
 
   /* devices */
   priv->combo_device = xfburn_device_list_get_device_combo (devlist);
@@ -285,7 +296,11 @@
 {
   XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (object);
 
+  g_signal_handler_disconnect (priv->devlist, priv->handler_volume_change_start);
+  g_signal_handler_disconnect (priv->devlist, priv->handler_volume_change_end);
+
   g_object_unref (G_OBJECT (priv->devlist));
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -693,40 +708,27 @@
 }
 
 static void
-cb_device_change_start (XfburnDeviceList *devlist, XfburnDeviceBox *box)
+cb_volume_change_start (XfburnDeviceList *devlist, gboolean device_changed, XfburnDeviceBox *box)
 {
   if (GTK_WIDGET_REALIZED (box))
     xfburn_busy_cursor (GTK_WIDGET (box));
 }
 
 static void
-cb_device_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnDeviceBox *box)
+cb_volume_change_end (XfburnDeviceList *devlist, gboolean device_changed, XfburnDevice *device, XfburnDeviceBox *box)
 {
-  /* FIXME: adjust selected device?  */
-
-  cb_volume_change_end (devlist, device, box);
-
-  /* not going back to a regular cursor, that'll happen in cb_volume_change_end */
-}
-
-static void
-cb_volume_change_start (XfburnDeviceList *devlist, XfburnDevice *device, XfburnDeviceBox *box)
-{
-  if (GTK_WIDGET_REALIZED (box))
-    xfburn_busy_cursor (GTK_WIDGET (box));
-}
-
-static void
-cb_volume_change_end (XfburnDeviceList *devlist, XfburnDevice *device, XfburnDeviceBox *box)
-{
   g_return_if_fail (XFBURN_IS_DEVICE_LIST (devlist));
   g_return_if_fail (XFBURN_IS_DEVICE (device));
   g_return_if_fail (XFBURN_IS_DEVICE_BOX (box));
 
+  /* FIXME: adjust selected device?  */
+
   refresh_drive_info (box, device);
 
   if (GTK_WIDGET_REALIZED (box))
     xfburn_default_cursor (GTK_WIDGET (box));
+
+  g_signal_emit (box, signals[VOLUME_CHANGED], 0, device_changed, device);
 }
 
 static void 

Modified: xfburn/trunk/xfburn/xfburn-device-box.h
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-box.h	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-device-box.h	2009-07-13 03:24:04 UTC (rev 7718)
@@ -45,6 +45,8 @@
 typedef struct
 {
   GtkVBoxClass parent_class;
+
+  void (*volume_changed) (XfburnDeviceBox *box, gboolean device_changed, XfburnDevice *device);
 } XfburnDeviceBoxClass;
 
 typedef enum

Modified: xfburn/trunk/xfburn/xfburn-device-list.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-list.c	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-device-list.c	2009-07-13 03:24:04 UTC (rev 7718)
@@ -38,6 +38,7 @@
 #include "xfburn-utils.h"
 
 #include "xfburn-device-list.h"
+#include "xfburn-cclosure-marshal.h"
 
 /*- private prototypes -*/
 
@@ -75,8 +76,6 @@
 };
 
 enum {
-  DEVICE_CHANGE_START,
-  DEVICE_CHANGE_END,
   VOLUME_CHANGE_START,
   VOLUME_CHANGE_END,
   LAST_SIGNAL,
@@ -194,22 +193,14 @@
   object_class->constructor  = xfburn_device_list_constructor;
   object_class->finalize     = xfburn_device_list_finalize;
 
-  signals[DEVICE_CHANGE_START] = g_signal_new ("device-change-start", XFBURN_TYPE_DEVICE_LIST, G_SIGNAL_ACTION,
-                                          0,
-                                          NULL, NULL, g_cclosure_marshal_VOID__VOID,
-                                          G_TYPE_NONE, 1, G_TYPE_STRING);
-  signals[DEVICE_CHANGE_END] = g_signal_new ("device-change-end", XFBURN_TYPE_DEVICE_LIST, G_SIGNAL_ACTION,
-                                          G_STRUCT_OFFSET (XfburnDeviceListClass, device_changed),
-                                          NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
-                                          G_TYPE_NONE, 1, XFBURN_TYPE_DEVICE);
   signals[VOLUME_CHANGE_START] = g_signal_new ("volume-change-start", XFBURN_TYPE_DEVICE_LIST, G_SIGNAL_ACTION,
                                           0,
-                                          NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
-                                          G_TYPE_NONE, 1, XFBURN_TYPE_DEVICE);
+                                          NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN,
+                                          G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
   signals[VOLUME_CHANGE_END] = g_signal_new ("volume-change-end", XFBURN_TYPE_DEVICE_LIST, G_SIGNAL_ACTION,
                                           G_STRUCT_OFFSET (XfburnDeviceListClass, volume_changed),
-                                          NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
-                                          G_TYPE_NONE, 1, XFBURN_TYPE_DEVICE);
+                                          NULL, NULL, xfburn_cclosure_marshal_VOID__BOOLEAN_OBJECT,
+                                          G_TYPE_NONE, 2, G_TYPE_BOOLEAN, XFBURN_TYPE_DEVICE);
     
   g_object_class_install_property (object_class, PROP_NUM_BURNERS, 
                                    g_param_spec_int ("num-burners", _("Number of burners in the system"),
@@ -379,9 +370,7 @@
   XfburnDeviceListPrivate *priv = GET_PRIVATE (devlist);
   XfburnDevice *device;
 
-  DBG ("trace");
-  
-  g_signal_emit (G_OBJECT (devlist), signals[DEVICE_CHANGE_START], 0);
+  g_signal_emit (G_OBJECT (devlist), signals[VOLUME_CHANGE_START], 0, TRUE);
   device = get_selected_device (combo);
 
   if (device == NULL)
@@ -389,7 +378,7 @@
 
   priv->curr_device = device;
   xfburn_device_refresh_info (device, TRUE);
-  g_signal_emit (G_OBJECT (devlist), signals[DEVICE_CHANGE_END], 0, device);
+  g_signal_emit (G_OBJECT (devlist), signals[VOLUME_CHANGE_END], 0, TRUE, device);
 }
 
 #ifdef HAVE_HAL
@@ -404,7 +393,6 @@
 static void
 cb_refresh_clicked (GtkButton *button, XfburnDeviceList *devlist)
 {
-  DBG ("trace");
   refresh (devlist);
 }
 
@@ -413,10 +401,10 @@
 {
   XfburnDeviceListPrivate *priv = GET_PRIVATE (devlist);
 
-  g_signal_emit (G_OBJECT (devlist), signals[VOLUME_CHANGE_START], 0, priv->curr_device);
+  g_signal_emit (G_OBJECT (devlist), signals[VOLUME_CHANGE_START], 0, FALSE);
   usleep (1000001);
   xfburn_device_refresh_info (priv->curr_device, TRUE);
-  g_signal_emit (G_OBJECT (devlist), signals[VOLUME_CHANGE_END], 0, priv->curr_device);
+  g_signal_emit (G_OBJECT (devlist), signals[VOLUME_CHANGE_END], 0, FALSE, priv->curr_device);
 }
 
 

Modified: xfburn/trunk/xfburn/xfburn-device-list.h
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-list.h	2009-07-12 23:06:06 UTC (rev 7717)
+++ xfburn/trunk/xfburn/xfburn-device-list.h	2009-07-13 03:24:04 UTC (rev 7718)
@@ -55,8 +55,7 @@
 typedef struct {
   GObjectClass parent_class;
   
-  void (*device_changed) (XfburnDeviceList *devlist, XfburnDevice *device);
-  void (*volume_changed) (XfburnDeviceList *devlist, XfburnDevice *device);
+  void (*volume_changed) (XfburnDeviceList *devlist, guint device_changed, XfburnDevice *device);
 } XfburnDeviceListClass;
 
 




More information about the Goodies-commits mailing list