Author: pollux
Date: 2006-07-30 15:41:50 +0000 (Sun, 30 Jul 2006)
New Revision: 22567

Modified:
   xfburn/trunk/xfburn/xfburn-burn-data-composition-dialog.c
   xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.c
   xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.h
   xfburn/trunk/xfburn/xfburn-burn-image-progress-dialog.c
   xfburn/trunk/xfburn/xfburn-progress-dialog.c
Log:
Compilation burning implemented

Modified: xfburn/trunk/xfburn/xfburn-burn-data-composition-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-data-composition-dialog.c   2006-07-30 
15:00:08 UTC (rev 22566)
+++ xfburn/trunk/xfburn/xfburn-burn-data-composition-dialog.c   2006-07-30 
15:41:50 UTC (rev 22567)
@@ -301,12 +301,15 @@
   gchar *dummy_dir = NULL;
   
   if (response_id == GTK_RESPONSE_OK) {
+    gchar *volid = NULL;
     gchar *command = NULL;
     GtkWidget *dialog_progress = NULL;
+  
+    volid = xfburn_data_composition_get_volume_id (priv->composition);
     
     if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(priv->check_only_iso))) {
-      command = g_strconcat ("sh -c \"mkisofs -gui -graft-points -joliet 
-full-iso9660-filenames -iso-level 2 -path-list ",
-                             priv->file_list, " > ", gtk_entry_get_text 
(GTK_ENTRY (priv->entry_path_iso)), "\"", NULL);
+      command = g_strconcat ("sh -c \"mkisofs -gui -graft-points -joliet 
-full-iso9660-filenames -iso-level 2 -volid '",
+                             volid, "' -path-list ", priv->file_list, " > ", 
gtk_entry_get_text (GTK_ENTRY (priv->entry_path_iso)), "\"", NULL);
 
       dialog_progress = xfburn_create_iso_from_composition_progress_dialog_new 
();
     }
@@ -314,7 +317,6 @@
       gchar *speed = NULL;
       gchar *write_mode = NULL;
       gchar *device_name = NULL;
-      gchar *volid = NULL;
       XfburnDevice *device;
       
       device_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX 
(priv->combo_device));
@@ -338,10 +340,8 @@
         write_mode = g_strdup (" -tao");
       }
 
-      volid = xfburn_data_composition_get_volume_id (priv->composition);
-      
-      command = g_strconcat ("sh -c \"mkisofs -gui -graft-points -joliet 
-full-iso9660-filenames -iso-level 2 -path-list ",
-                             priv->file_list, " -volid ", volid, " | cdrecord 
-v gracetime=2", " dev=", device->node_path, write_mode, " speed=", speed,
+      command = g_strconcat ("sh -c \"mkisofs -gui -graft-points -joliet 
-full-iso9660-filenames -iso-level 2 -volid '", volid,
+                             "' -path-list ", priv->file_list, " | cdrecord -v 
gracetime=2", " dev=", device->node_path, write_mode, " speed=", speed,
                              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(priv->check_eject)) ? " -eject" : "",
                              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(priv->check_dummy)) ? " -dummy" : "",
                              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(priv->check_burnfree)) ? " driveropts=burnfree" : "",
@@ -349,7 +349,6 @@
       g_free (device_name);
       g_free (speed);
       g_free (write_mode);
-      g_free (volid);
       
       dialog_progress = xfburn_burn_data_composition_progress_dialog_new ();
     }
@@ -361,6 +360,7 @@
     gtk_dialog_run (GTK_DIALOG (dialog_progress));
     
     g_free (command);
+    g_free (volid);
   }
   
   unlink (priv->file_list);

Modified: xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.c  
2006-07-30 15:00:08 UTC (rev 22566)
+++ xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.c  
2006-07-30 15:41:50 UTC (rev 22567)
@@ -21,18 +21,18 @@
 #include <config.h>
 #endif /* !HAVE_CONFIG_H */
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 #include "xfburn-progress-dialog.h"
 
 #include "xfburn-burn-data-composition-progress-dialog.h"
 
 static void xfburn_burn_data_composition_progress_dialog_class_init 
(XfburnBurnDataCompositionProgressDialogClass * klass);
 static void xfburn_burn_data_composition_progress_dialog_init 
(XfburnBurnDataCompositionProgressDialog * sp);
-static void xfburn_burn_data_composition_progress_dialog_finalize (GObject * 
object);
 
-struct XfburnBurnDataCompositionProgressDialogPrivate
-{
-  /* Place Private Members Here */
-};
+static void cb_new_output (XfburnBurnDataCompositionProgressDialog * dialog, 
const gchar * output, gpointer data);
 
 static XfburnProgressDialogClass *parent_class = NULL;
 
@@ -63,36 +63,54 @@
 static void
 xfburn_burn_data_composition_progress_dialog_class_init 
(XfburnBurnDataCompositionProgressDialogClass * klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
   parent_class = g_type_class_peek_parent (klass);
-  object_class->finalize = 
xfburn_burn_data_composition_progress_dialog_finalize;
-
 }
 
 static void
 xfburn_burn_data_composition_progress_dialog_init 
(XfburnBurnDataCompositionProgressDialog * obj)
 {
-  obj->priv = g_new0 (XfburnBurnDataCompositionProgressDialogPrivate, 1);
-  /* Initialize private members, etc. */
+  g_signal_connect_after (G_OBJECT (obj), "output", G_CALLBACK 
(cb_new_output), NULL);
 }
 
+/*           */
+/* internals */
+/*           */
 static void
-xfburn_burn_data_composition_progress_dialog_finalize (GObject * object)
+cb_new_output (XfburnBurnDataCompositionProgressDialog * dialog, const gchar * 
output, gpointer data)
 {
-  XfburnBurnDataCompositionProgressDialog *cobj;
-  cobj = XFBURN_BURN_COMPOSITION_PROGRESS_DIALOG (object);
+  if (strstr (output, CDRECORD_FIXATING_TIME)) {
+    xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), 
_("Finishing"));
+    xfburn_progress_dialog_set_fifo_bar_fraction (XFBURN_PROGRESS_DIALOG 
(dialog), -1);
+    xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG 
(dialog), -1);
+    xfburn_progress_dialog_set_status (XFBURN_PROGRESS_DIALOG (dialog), 
XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED);
+  }
+  else if (strstr (output, CDRECORD_FIXATING)) {
+    xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), 
_("Fixating..."));
+  }
+  else if (strstr (output, CDRECORD_COPY)) {
+    gint current = 0, fifo = 0, buf = 0;
+    gfloat speed = 0;
 
-  /* Free private members, etc. */
+    if (sscanf (output, "%*s %*d: %d %*s %*s (%*s %d%%) [%*s %d%%] %fx.", 
&current, &fifo, &buf, &speed) == 4) {
 
-  g_free (cobj->priv);
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+      xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), 
_("Writing composition..."));
+      xfburn_progress_dialog_set_writing_speed (XFBURN_PROGRESS_DIALOG 
(dialog), speed);
+      xfburn_progress_dialog_set_fifo_bar_fraction (XFBURN_PROGRESS_DIALOG 
(dialog), ((gdouble) fifo) / 100);
+      xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG 
(dialog), ((gdouble) buf) / 100);
+    }
+  } else if (strstr (output, MKISOFS_RUNNING)) {
+    gfloat percent = 0;
+    if (sscanf (output, "%f%% done", &percent) == 1) {
+      gdouble fraction;
+
+      fraction = (gdouble) (percent / 100);
+
+      xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), 
_("Writing composition..."));
+      xfburn_progress_dialog_set_progress_bar_fraction (XFBURN_PROGRESS_DIALOG 
(dialog), fraction);
+    }
+  }
 }
 
-/*           */
-/* internals */
-/*           */
-
 /*        */
 /* public */
 /*        */
@@ -102,7 +120,8 @@
 {
   XfburnBurnDataCompositionProgressDialog *obj;
 
-  obj = XFBURN_BURN_COMPOSITION_PROGRESS_DIALOG (g_object_new 
(XFBURN_TYPE_BURN_COMPOSITION_PROGRESS_DIALOG, NULL));
+  obj = XFBURN_BURN_COMPOSITION_PROGRESS_DIALOG (g_object_new 
(XFBURN_TYPE_BURN_COMPOSITION_PROGRESS_DIALOG, 
+                                                               "title", 
_("Burn data composition"), NULL));
 
   return GTK_WIDGET (obj);
 }

Modified: xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.h
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.h  
2006-07-30 15:00:08 UTC (rev 22566)
+++ xfburn/trunk/xfburn/xfburn-burn-data-composition-progress-dialog.h  
2006-07-30 15:41:50 UTC (rev 22567)
@@ -37,19 +37,18 @@
 #define XFBURN_IS_BURN_COMPOSITION_PROGRESS_DIALOG_CLASS(k)  
(G_TYPE_CHECK_CLASS_TYPE ((k), XFBURN_TYPE_BURN_COMPOSITION_PROGRESS_DIALOG))
 #define XFBURN_BURN_COMPOSITION_PROGRESS_DIALOG_GET_CLASS(o) 
(G_TYPE_INSTANCE_GET_CLASS ((o), XFBURN_TYPE_BURN_COMPOSITION_PROGRESS_DIALOG, 
XfburnBurnDataCompositionProgressDialogClass))
 
-typedef struct XfburnBurnDataCompositionProgressDialogPrivate 
XfburnBurnDataCompositionProgressDialogPrivate;
-
 typedef struct {
        XfburnProgressDialog parent;
-       XfburnBurnDataCompositionProgressDialogPrivate *priv;
 } XfburnBurnDataCompositionProgressDialog;
 
 typedef struct {
        XfburnProgressDialogClass parent_class;
-       /* Add Signal Functions Here */
 } XfburnBurnDataCompositionProgressDialogClass;
 
 GtkType xfburn_burn_data_composition_progress_dialog_get_type ();
+
 GtkWidget *xfburn_burn_data_composition_progress_dialog_new ();
 
+G_END_DECLS 
+
 #endif /* XFBURN_BURN_COMPOSITION_PROGRESS_DIALOG_H */

Modified: xfburn/trunk/xfburn/xfburn-burn-image-progress-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-image-progress-dialog.c     2006-07-30 
15:00:08 UTC (rev 22566)
+++ xfburn/trunk/xfburn/xfburn-burn-image-progress-dialog.c     2006-07-30 
15:41:50 UTC (rev 22567)
@@ -107,7 +107,7 @@
                XfburnBurnImageProgressDialogPrivate * priv)
 {
   if (strstr (output, CDRECORD_FIXATING_TIME)) {
-    xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), 
_("no info"));
+    xfburn_progress_dialog_set_action_text (XFBURN_PROGRESS_DIALOG (dialog), 
_("Finishing"));
     xfburn_progress_dialog_set_fifo_bar_fraction (XFBURN_PROGRESS_DIALOG 
(dialog), -1);
     xfburn_progress_dialog_set_buffer_bar_fraction (XFBURN_PROGRESS_DIALOG 
(dialog), -1);
     xfburn_progress_dialog_set_status (XFBURN_PROGRESS_DIALOG (dialog), 
XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED);

Modified: xfburn/trunk/xfburn/xfburn-progress-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-progress-dialog.c        2006-07-30 15:00:08 UTC 
(rev 22566)
+++ xfburn/trunk/xfburn/xfburn-progress-dialog.c        2006-07-30 15:41:50 UTC 
(rev 22567)
@@ -192,7 +192,7 @@
   /* buffers */
   priv->hbox_buffers = gtk_hbox_new (FALSE, BORDER);
   gtk_widget_show (priv->hbox_buffers);
-  gtk_box_pack_start (box, priv->hbox_buffers, TRUE, TRUE, BORDER);
+  gtk_box_pack_start (box, priv->hbox_buffers, FALSE, TRUE, BORDER);
 
   frame = gtk_frame_new (_("Estimated writing speed:"));
   gtk_widget_show (frame);

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to