brasero r774 - in trunk: . data src src/plugins/checksum



Author: philippr
Date: Thu Apr 24 18:57:09 2008
New Revision: 774
URL: http://svn.gnome.org/viewvc/brasero?rev=774&view=rev

Log:
	Fix #505981 â Default application dialog asks for yes/no
	Also starts to fix #521368 â HIG alert windows

	Fix problem introduced by an earlier patch where track size was set to 0 by imagechecksum

	* data/brasero.schemas.in:
	* src/brasero-burn-dialog.c
	(brasero_burn_dialog_disable_joliet_cb), (brasero_burn_dialog_run):
	* src/brasero-burn-dialog.h:
	* src/brasero-dest-selection.c
	(brasero_dest_selection_image_extension_ask):
	* src/brasero-disc-option-dialog.c
	(brasero_disc_option_dialog_joliet_toggled_cb):
	* src/brasero-project-manager.c (brasero_project_manager_burn):
	* src/brasero-project.c (brasero_project_overburn_dialog),
	(brasero_project_check_default_burning_app),
	(brasero_project_burn), (brasero_project_switch):
	* src/brasero-split-dialog.c (brasero_split_dialog_size_error),
	(brasero_split_dialog_clear_confirm_dialog):
	* src/brasero-sum-dialog.c (brasero_sum_dialog_new):
	* src/burn-job.c (brasero_job_check_output_disc_space):
	* src/burn-volume-obj.c (brasero_volume_is_mounted),
	(brasero_volume_umount):
	* src/burn.c (brasero_burn_lock_dest_media),
	(brasero_burn_run_recorder), (brasero_burn_run_tasks):
	* src/plugins/checksum/burn-checksum-image.c
	(brasero_checksum_image_checksum_file_input),
	(brasero_checksum_image_start):

Modified:
   trunk/ChangeLog
   trunk/data/brasero.schemas.in
   trunk/src/brasero-burn-dialog.c
   trunk/src/brasero-burn-dialog.h
   trunk/src/brasero-dest-selection.c
   trunk/src/brasero-disc-option-dialog.c
   trunk/src/brasero-project-manager.c
   trunk/src/brasero-project.c
   trunk/src/brasero-split-dialog.c
   trunk/src/burn-job.c
   trunk/src/burn-volume-obj.c
   trunk/src/burn.c
   trunk/src/plugins/checksum/burn-checksum-image.c

Modified: trunk/data/brasero.schemas.in
==============================================================================
--- trunk/data/brasero.schemas.in	(original)
+++ trunk/data/brasero.schemas.in	Thu Apr 24 18:57:09 2008
@@ -2,8 +2,22 @@
     <schemalist>    
 
       <schema>
-        <key>/schemas/apps/brasero/ask_default_app</key>
-	<applyto>/apps/brasero/ask_audio_default</applyto>
+        <key>/schemas/apps/brasero/ask_default_audio</key>
+	<applyto>/apps/brasero/ask_default_audio</applyto>
+	<owner>brasero</owner>
+	<type>bool</type>
+	<default>false</default>
+	<locale name="C">
+	  <short>Should brasero ask to be set as the default app to burn</short>
+	  <long>
+	    Should brasero ask to be set as the default app to burn audio or data. Set to true, brasero won't ask.
+	  </long>
+	</locale>
+      </schema>
+
+      <schema>
+        <key>/schemas/apps/brasero/ask_default_data</key>
+	<applyto>/apps/brasero/ask_default_data</applyto>
 	<owner>brasero</owner>
 	<type>bool</type>
 	<default>false</default>

Modified: trunk/src/brasero-burn-dialog.c
==============================================================================
--- trunk/src/brasero-burn-dialog.c	(original)
+++ trunk/src/brasero-burn-dialog.c	Thu Apr 24 18:57:09 2008
@@ -729,10 +729,10 @@
 					  GTK_DIALOG_MODAL,
 					  GTK_MESSAGE_WARNING,
 					  GTK_BUTTONS_NONE,
-					  _("Some files don't have a suitable name for a Windows-compatible CD:"));
+					  _("Do you want to continue with Windows compatibility disabled?"));
 
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
-						  _("Do you want to continue with Windows compatibility disabled?"));
+						  _("Some files don't have a suitable name for a Windows-compatible CD:"));
 
 	gtk_window_set_title (GTK_WINDOW (message), _("Windows compatibility"));
 	gtk_dialog_add_buttons (GTK_DIALOG (message),
@@ -1793,7 +1793,8 @@
 
 gboolean
 brasero_burn_dialog_run (BraseroBurnDialog *dialog,
-			 BraseroBurnSession *session)
+			 BraseroBurnSession *session,
+			 gboolean *destroy)
 {
 	BraseroMedia media;
 	GError *error = NULL;
@@ -1834,7 +1835,10 @@
 	g_object_unref (dialog->priv->session);
 	dialog->priv->session = NULL;
 
-	return close_dialog;
+	if (destroy)
+		*destroy = close_dialog;
+
+	return (result == BRASERO_BURN_OK);
 }
 
 static gboolean

Modified: trunk/src/brasero-burn-dialog.h
==============================================================================
--- trunk/src/brasero-burn-dialog.h	(original)
+++ trunk/src/brasero-burn-dialog.h	Thu Apr 24 18:57:09 2008
@@ -57,6 +57,7 @@
 
 gboolean
 brasero_burn_dialog_run (BraseroBurnDialog *dialog,
-			 BraseroBurnSession *session);
+			 BraseroBurnSession *session,
+			 gboolean *destroy);
 
 #endif				/* BURN_DIALOG_H */

Modified: trunk/src/brasero-dest-selection.c
==============================================================================
--- trunk/src/brasero-dest-selection.c	(original)
+++ trunk/src/brasero-dest-selection.c	Thu Apr 24 18:57:09 2008
@@ -568,7 +568,7 @@
 					 GTK_DIALOG_DESTROY_WITH_PARENT |
 					 GTK_DIALOG_MODAL,
 					 GTK_MESSAGE_WARNING,
-					 GTK_BUTTONS_YES_NO,
+					 GTK_BUTTONS_NONE,
 					 _("Do you really want to keep the current extension for the disc image name?"));
 
 		
@@ -576,6 +576,13 @@
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 						  _("If you choose to keep it programs may not be able to recognize the file type properly."));
 
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       _("_Don't change extension"),
+			       GTK_RESPONSE_CANCEL);
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       _("Change _extension"),
+			       GTK_RESPONSE_YES);
+
 	answer = gtk_dialog_run (GTK_DIALOG (dialog));
 	gtk_widget_destroy (dialog);
 

Modified: trunk/src/brasero-disc-option-dialog.c
==============================================================================
--- trunk/src/brasero-disc-option-dialog.c	(original)
+++ trunk/src/brasero-disc-option-dialog.c	Thu Apr 24 18:57:09 2008
@@ -442,28 +442,46 @@
 
 	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
 
-	brasero_disc_option_dialog_set_joliet (dialog);
 	if (!GTK_WIDGET_VISIBLE (dialog)) {
 		gtk_widget_show (GTK_WIDGET (dialog));
 		hide = TRUE;
 	}
 
-	if (priv->joliet_warning)
+	if (priv->joliet_warning) {
+		brasero_disc_option_dialog_set_joliet (dialog);
 		return;
+	}
+
+	priv->joliet_warning = TRUE;
 
 	message = gtk_message_dialog_new (GTK_WINDOW (dialog),
 					  GTK_DIALOG_DESTROY_WITH_PARENT|
 					  GTK_DIALOG_MODAL,
 					  GTK_MESSAGE_INFO,
-					  GTK_BUTTONS_CLOSE,
-					  _("Some files don't have a suitable name for a Windows-compatible CD:"));
+					  GTK_BUTTONS_NONE,
+					  _("Should files be renamed to be windows-compatible?"));
 
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
-						  _("their names will be changed and truncated to 64 characters."));
+						  _("Some files don't have a suitable name for a Windows-compatible CD. Those names will be changed and truncated to 64 characters."));
 
 	gtk_window_set_title (GTK_WINDOW (message), _("Windows compatibility"));
+
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Don't rename"),
+			       GTK_RESPONSE_CANCEL);
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Rename"),
+			       GTK_RESPONSE_YES);
+
 	answer = gtk_dialog_run (GTK_DIALOG (message));
 	gtk_widget_destroy (message);
+
+	if (answer != GTK_RESPONSE_YES)
+		gtk_toggle_button_set_active (toggle, FALSE);
+	else
+		brasero_disc_option_dialog_set_joliet (dialog);
+
+	priv->joliet_warning = FALSE;
 }
 
 static void

Modified: trunk/src/brasero-project-manager.c
==============================================================================
--- trunk/src/brasero-project-manager.c	(original)
+++ trunk/src/brasero-project-manager.c	Thu Apr 24 18:57:09 2008
@@ -422,8 +422,9 @@
 	gtk_widget_hide (toplevel);
 	gtk_widget_show (dialog);
 
-	destroy = brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog),
-					   session);
+	brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog),
+				 session,
+				 &destroy);
 
 	gtk_widget_destroy (dialog);
 

Modified: trunk/src/brasero-project.c
==============================================================================
--- trunk/src/brasero-project.c	(original)
+++ trunk/src/brasero-project.c	Thu Apr 24 18:57:09 2008
@@ -246,7 +246,8 @@
 
 #define KEY_DEFAULT_DATA_BURNING_APP		"/desktop/gnome/volume_manager/autoburn_data_cd_command"
 #define KEY_DEFAULT_AUDIO_BURNING_APP		"/desktop/gnome/volume_manager/autoburn_audio_cd_command"
-#define KEY_ASK_DEFAULT_BURNING_APP		"/apps/brasero/ask_default_app"
+#define KEY_ASK_DEFAULT_BURNING_AUDIO		"/apps/brasero/ask_default_audio"
+#define KEY_ASK_DEFAULT_BURNING_DATA		"/apps/brasero/ask_default_data"
 
 #define BRASERO_KEY_SHOW_PREVIEW		"/apps/brasero/display/preview"
 
@@ -542,15 +543,22 @@
 					 GTK_DIALOG_DESTROY_WITH_PARENT|
 					 GTK_DIALOG_MODAL,
 					 GTK_MESSAGE_WARNING,
-					 GTK_BUTTONS_YES_NO,
-					 _("The size of the project is too large for the disc:"));
+					 GTK_BUTTONS_NONE,
+					 _("Would you like to activate overburn?"));
 
 	gtk_window_set_title (GTK_WINDOW (dialog), _("Project size"));
 
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-						  _("Would you like to activate overburn (otherwise you must delete files) ?"
+						  _("The size of the project is too large for the disc and you must delete files otherwise."
 						    "\nNOTE: This option might cause failure."));
 
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       _("_Don't use overburn"),
+			       GTK_RESPONSE_CANCEL);
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       _("Use _overburn"),
+			       GTK_RESPONSE_YES);
+
 	result = gtk_dialog_run (GTK_DIALOG (dialog));
 	gtk_widget_destroy (dialog);
 
@@ -866,6 +874,86 @@
 	gtk_widget_destroy (message);
 }
 
+static void
+brasero_project_check_default_burning_app (BraseroProject *project,
+					   const gchar *primary,
+					   const gchar *key,
+					   const gchar *key_ask,
+					   const gchar *default_command)
+{
+	GtkResponseType response;
+	GConfClient *client;
+	GtkWidget *toplevel;
+	GtkWidget *message;
+	gchar *command;
+	gboolean ask;
+	gchar *text;
+
+	client = gconf_client_get_default ();
+	command = gconf_client_get_string (client,
+					   key,
+					   NULL);
+
+	if (command && g_str_has_prefix (command, "brasero")) {
+		g_object_unref (client);
+		g_free (command);
+		return;
+	}
+
+	ask = gconf_client_get_bool (client,
+				     key_ask,
+				     NULL);
+	if (ask) {
+		g_object_unref (client);
+		g_free (command);
+		return;
+	}
+
+	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (project));
+	message = gtk_message_dialog_new (GTK_WINDOW (toplevel),
+					  GTK_DIALOG_MODAL|
+					  GTK_DIALOG_DESTROY_WITH_PARENT,
+					  GTK_MESSAGE_WARNING,
+					  GTK_BUTTONS_NONE,
+					  primary);
+
+	gtk_window_set_title (GTK_WINDOW (message), _("Default burning application"));
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
+						  _("This is a first time running dialog that won't be shown again. If you change your mind, you can change your choice later in the Removable Drives and Media Preferences wether or not you chose brasero."));
+
+	/* NOTE for translators the %s is the old application name */
+	if (command)
+		text = g_strdup_printf (_("_Keep Using \"%s\""), command);
+	else
+		text = g_strdup (GTK_STOCK_CANCEL);
+
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       text,
+			       GTK_RESPONSE_CANCEL);
+	g_free (text);
+	g_free (command);
+
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Use Brasero next time"),
+			       GTK_RESPONSE_YES);
+
+	response = gtk_dialog_run (GTK_DIALOG (message));
+	gconf_client_set_bool (client,
+			       key_ask,
+			       TRUE,
+			       NULL);
+
+	gtk_widget_destroy (message);
+
+	if (response == GTK_RESPONSE_YES)
+		gconf_client_set_string (client,
+					 key,
+					 default_command,
+					 NULL);
+
+	g_object_unref (client);
+}
+
 void
 brasero_project_burn (BraseroProject *project)
 {
@@ -875,6 +963,7 @@
 	GtkWidget *dialog;
 	gboolean overburn;
 	gboolean destroy;
+	gboolean success;
 
 	overburn = FALSE;
 	result = brasero_project_size_check_status (BRASERO_PROJECT_SIZE (project->priv->size_display),
@@ -943,10 +1032,27 @@
 	gtk_widget_hide (toplevel);
 	gtk_widget_show (dialog);
 
-	destroy = brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog), session);
+	success = brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog),
+					   session,
+					   &destroy);
 	g_object_unref (session);
 
-    	project->priv->burnt = 1;
+    	project->priv->burnt = success;
+
+	if (success) {
+		if (BRASERO_IS_AUDIO_DISC (project->priv->current))
+			brasero_project_check_default_burning_app (project,
+								   _("Would you like to use Brasero in the future to burn audio discs?"),
+								   KEY_DEFAULT_AUDIO_BURNING_APP,
+								   KEY_ASK_DEFAULT_BURNING_AUDIO,
+								   "brasero -a");
+		else
+			brasero_project_check_default_burning_app (project,
+								   _("Would you like to use Brasero in the future to burn data discs?"),
+								   KEY_DEFAULT_DATA_BURNING_APP,
+								   KEY_ASK_DEFAULT_BURNING_DATA,
+								   "brasero -d");
+	}
 
 end:
 
@@ -961,105 +1067,6 @@
 
 /********************************     ******************************************/
 static void
-brasero_project_check_default_burning_app (BraseroProject *project,
-					   const gchar *primary,
-					   const gchar *secondary,
-					   const gchar *key,
-					   const gchar *default_command)
-{
-	GtkResponseType response;
-	GConfClient *client;
-	GtkWidget *alignment;
-	GtkWidget *toplevel;
-	GtkWidget *message;
-	GtkWidget *check;
-	gchar *command;
-	gboolean ask;
-	GList *children;
-	GList *iter;
-
-	client = gconf_client_get_default ();
-	command = gconf_client_get_string (client,
-					   key,
-					   NULL);
-
-	if (command && g_str_has_prefix (command, "brasero")) {
-		g_object_unref (client);
-		g_free (command);
-		return;
-	}
-	g_free (command);
-
-	ask = gconf_client_get_bool (client,
-				     KEY_ASK_DEFAULT_BURNING_APP,
-				     NULL);
-	if (ask) {
-		g_object_unref (client);
-		return;
-	}
-
-	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (project));
-	message = gtk_message_dialog_new (GTK_WINDOW (toplevel),
-					  GTK_DIALOG_MODAL|
-					  GTK_DIALOG_DESTROY_WITH_PARENT,
-					  GTK_MESSAGE_WARNING,
-					  GTK_BUTTONS_YES_NO,
-					  primary);
-
-	gtk_window_set_title (GTK_WINDOW (message), _("Default burning application"));
-	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
-						  secondary);
-
-	alignment = gtk_alignment_new (0.0, 0.0, 0, 0);
-	gtk_widget_show (alignment);
-
-	children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (message)->vbox));
-	for (iter = children; iter; iter = iter->next) {
-		GtkWidget *child;
-
-		child = children->data;
-		if (GTK_IS_HBOX (child)) {
-			g_list_free (children);
-			children = gtk_container_get_children (GTK_CONTAINER (child));
-			for (iter = children; iter; iter = iter->next) {
-				child = iter->data;
-				if (GTK_IS_VBOX (child)) {
-					gtk_box_pack_end (GTK_BOX (child),
-							  alignment,
-							  FALSE,
-							  FALSE,
-							  0);
-					break;
-				}
-			}
-			g_list_free (children);
-			break;
-		}
-	}
-
-	check = gtk_check_button_new_with_mnemonic (_("don't _show this dialog again"));
-	gtk_container_add (GTK_CONTAINER (alignment), check);
-	gtk_widget_show (check);
-
-	response = gtk_dialog_run (GTK_DIALOG (message));
-	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)))
-		gconf_client_set_bool (client,
-				       KEY_ASK_DEFAULT_BURNING_APP,
-				       TRUE,
-				       NULL);
-
-	gtk_widget_destroy (message);
-
-	if (response == GTK_RESPONSE_YES)
-		gconf_client_set_string (client,
-					 key,
-					 default_command,
-					 NULL);
-
-	g_object_unref (client);
-}
-
-static void
 brasero_project_switch (BraseroProject *project, gboolean audio)
 {
 	GtkAction *action;
@@ -1098,12 +1105,6 @@
 
 		gtk_notebook_set_current_page (GTK_NOTEBOOK (project->priv->discs), 0);
 		brasero_project_size_set_context (BRASERO_PROJECT_SIZE (project->priv->size_display), TRUE);
-
-		brasero_project_check_default_burning_app (project,
-							   _("Brasero is not the default application to burn audio CDs:"),
-							   _("Would you like to make brasero the default application to burn audio CDs?"),
-							   KEY_DEFAULT_AUDIO_BURNING_APP,
-							   "brasero -a");
 	}
 	else {
 		project->priv->current = BRASERO_DISC (project->priv->data);
@@ -1112,12 +1113,6 @@
 
 		gtk_notebook_set_current_page (GTK_NOTEBOOK (project->priv->discs), 1);
 		brasero_project_size_set_context (BRASERO_PROJECT_SIZE (project->priv->size_display), FALSE);
-
-		brasero_project_check_default_burning_app (project,
-							   _("Brasero is not the default application to burn data discs:"),
-							   _("Would you like to make brasero the default application to burn data discs?"),
-							   KEY_DEFAULT_DATA_BURNING_APP,
-							   "brasero -d");
 	}
 
 	/* update the menus */

Modified: trunk/src/brasero-split-dialog.c
==============================================================================
--- trunk/src/brasero-split-dialog.c	(original)
+++ trunk/src/brasero-split-dialog.c	Thu Apr 24 18:57:09 2008
@@ -171,11 +171,19 @@
 					  GTK_DIALOG_DESTROY_WITH_PARENT|
 					  GTK_DIALOG_MODAL,
 					  GTK_MESSAGE_QUESTION,
-					  GTK_BUTTONS_YES_NO,
-					  _("The size of the new track is shorter than 6 seconds and will be padded."));
+					  GTK_BUTTONS_NONE,
+					  _("Do you really want to split the track?"));
+
 	gtk_window_set_title (GTK_WINDOW (message), _("size error"));
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
-						  _("Do you want to split it nevertheless?"));
+						  _("If you split the track, the size of the new track will be shorter than 6 seconds and will be padded."));
+
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Don't split"),
+			       GTK_RESPONSE_CANCEL);
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Split"),
+			       GTK_RESPONSE_YES);
 
 	answer = gtk_dialog_run (GTK_DIALOG (message));
 	gtk_widget_destroy (message);
@@ -671,11 +679,19 @@
 					  GTK_DIALOG_DESTROY_WITH_PARENT|
 					  GTK_DIALOG_MODAL,
 					  GTK_MESSAGE_QUESTION,
-					  GTK_BUTTONS_YES_NO,
-					  _("This will remove all previous results."));
+					  GTK_BUTTONS_NONE,
+					  _("Do you really want to carry on with automatic splitting?"));
+
 	gtk_window_set_title (GTK_WINDOW (message), _("automatic split"));
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
-						  _("Do you want to carry on with automatic splitting nevertheless?"));
+						  _("This will remove all previous results."));
+
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Don't split"),
+			       GTK_RESPONSE_CANCEL);
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Split"),
+			       GTK_RESPONSE_YES);
 
 	answer = gtk_dialog_run (GTK_DIALOG (message));
 	gtk_widget_destroy (message);

Modified: trunk/src/burn-job.c
==============================================================================
--- trunk/src/burn-job.c	(original)
+++ trunk/src/burn-job.c	Thu Apr 24 18:57:09 2008
@@ -381,8 +381,7 @@
 	flags = brasero_burn_session_get_flags (session);
 
 	/* FIXME: if we can't recover the size of the medium 
-	 * what should we do ? do as if we could ?
-	 */
+	 * what should we do ? do as if we could ? */
 
 	/* see if we are appending or not */
 	if (flags & (BRASERO_BURN_FLAG_APPEND|BRASERO_BURN_FLAG_MERGE))

Modified: trunk/src/burn-volume-obj.c
==============================================================================
--- trunk/src/burn-volume-obj.c	(original)
+++ trunk/src/burn-volume-obj.c	Thu Apr 24 18:57:09 2008
@@ -119,6 +119,12 @@
 	priv = BRASERO_VOLUME_PRIVATE (self);
 
 	volume = brasero_volume_get_gvolume (self);
+	if (!g_volume_can_mount (volume)) {
+		/* if it can't be mounted then it's unmounted ... */
+		g_object_unref (volume);
+		return FALSE;
+	}
+
 	mount = g_volume_get_mount (volume);
 	g_object_unref (volume);
 	if (!mount)
@@ -290,6 +296,12 @@
 	priv = BRASERO_VOLUME_PRIVATE (self);
 
 	volume = brasero_volume_get_gvolume (self);
+	if (!g_volume_can_mount (volume)) {
+		/* if it can't be mounted then it's unmounted ... */
+		g_object_unref (volume);
+		return TRUE;
+	}
+
 	mount = g_volume_get_mount (volume);
 	g_object_unref (volume);
 

Modified: trunk/src/burn.c
==============================================================================
--- trunk/src/burn.c	(original)
+++ trunk/src/burn.c	Thu Apr 24 18:57:09 2008
@@ -719,8 +719,8 @@
 	/* if drive is mounted then unmount before checking anything */
 	if (brasero_volume_is_mounted (BRASERO_VOLUME (medium))) {
 		if (!brasero_volume_umount (BRASERO_VOLUME (medium), TRUE, NULL))
-			g_warning ("Couldn't unmount volume in drive: %s",
-				   brasero_drive_get_device (priv->dest));
+			BRASERO_BURN_LOG ("Couldn't unmount volume in drive: %s",
+					  brasero_drive_get_device (priv->dest));
 	}
 
 	berror = BRASERO_BURN_ERROR_NONE;
@@ -1357,12 +1357,14 @@
 			     _("the drive seems to be busy"));
 		return BRASERO_BURN_ERR;
 	}
-	else if (brasero_volume_is_mounted (BRASERO_VOLUME (burnt_medium))
-	     && !brasero_volume_umount (BRASERO_VOLUME (burnt_medium), TRUE, NULL)) {
-		ret_error = g_error_new (BRASERO_BURN_ERROR,
-					 BRASERO_BURN_ERROR_BUSY_DRIVE,
-					 _("the drive seems to be busy"));
-		result = BRASERO_BURN_ERR;
+
+	if (brasero_volume_is_mounted (BRASERO_VOLUME (burnt_medium))
+	&& !brasero_volume_umount (BRASERO_VOLUME (burnt_medium), TRUE, NULL)) {
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_BUSY_DRIVE,
+			     _("the drive seems to be busy"));
+		return BRASERO_BURN_ERR;
 	}
 
 	/* actual running of task */
@@ -1551,7 +1553,7 @@
 		/* see what type of task it is. It could be a blank/erase one */
 		action = brasero_task_ctx_get_action (BRASERO_TASK_CTX (priv->task));
 		if (action == BRASERO_TASK_ACTION_ERASE) {
-			/* this is to avoid a potential problem when running a 
+			/* This is to avoid a potential problem when running a 
 			 * dummy session first. When running dummy session the 
 			 * media gets erased if need be. Since it is not
 			 * reloaded afterwards, for brasero it has still got 

Modified: trunk/src/plugins/checksum/burn-checksum-image.c
==============================================================================
--- trunk/src/plugins/checksum/burn-checksum-image.c	(original)
+++ trunk/src/plugins/checksum/burn-checksum-image.c	Thu Apr 24 18:57:09 2008
@@ -258,11 +258,6 @@
 
 	priv = BRASERO_CHECKSUM_IMAGE_PRIVATE (self);
 
-	BRASERO_JOB_LOG (self,
-			 "Starting checksuming file %s (size = %i)",
-			 path,
-			 priv->total);
-
 	/* get all information */
 	brasero_job_get_current_track (BRASERO_JOB (self), &track);
 	path = brasero_track_get_image_source (track, FALSE);
@@ -274,6 +269,11 @@
 		return BRASERO_BURN_ERR;
 	}
 
+	BRASERO_JOB_LOG (self,
+			 "Starting checksuming file %s (size = %i)",
+			 path,
+			 priv->total);
+
 	fd_in = open (path, O_RDONLY);
 	if (!fd_in) {
 		gchar *name = NULL;
@@ -565,7 +565,13 @@
 
 	brasero_job_get_action (job, &action);
 	if (action == BRASERO_JOB_ACTION_SIZE) {
-		/* say we won't write to disc */
+		/* say we won't write to disc if we're just checksuming "live" */
+		if (brasero_job_get_fd_in (job, NULL) == BRASERO_BURN_OK)
+			return BRASERO_BURN_NOT_SUPPORTED;
+
+		/* otherwise return an output of 0 since we're not actually 
+		 * writing anything to the disc. That will prevent a disc space
+		 * failure. */
 		brasero_job_set_output_size_for_current_track (job, 0, 0);
 		return BRASERO_BURN_NOT_RUNNING;
 	}



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