brasero r1515 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1515 - in trunk: . src
- Date: Tue, 11 Nov 2008 13:59:15 +0000 (UTC)
Author: philippr
Date: Tue Nov 11 13:59:14 2008
New Revision: 1515
URL: http://svn.gnome.org/viewvc/brasero?rev=1515&view=rev
Log:
Change the way we handle multiple copies to disc and offer the
possibility to reburn another disc after a successful burn.
Fix some problems with medium locking that appeared
* src/brasero-burn-dialog.c (brasero_burn_dialog_insert_disc_cb),
(brasero_burn_dialog_activity_start),
(brasero_burn_dialog_success_run),
(brasero_burn_dialog_notify_success),
(brasero_burn_dialog_end_session),
(brasero_burn_dialog_record_session), (brasero_burn_dialog_run):
* src/brasero-burn-dialog.h:
* src/brasero-burn-options.c (brasero_burn_options_valid_media_cb),
(brasero_burn_options_init):
* src/brasero-progress.c (brasero_burn_progress_create_info),
(brasero_burn_progress_display_session_info),
(brasero_burn_progress_set_property),
(brasero_burn_progress_get_property),
(brasero_burn_progress_reset):
* src/brasero-project-manager.c (brasero_project_manager_burn):
* src/brasero-project.c (brasero_project_burn):
* src/burn-basics.h:
* src/burn-session.c (brasero_burn_session_start):
* src/burn-session.h:
* src/burn.c (brasero_burn_lock_dest_media),
(brasero_burn_check_session_consistency),
(brasero_burn_record_session), (brasero_burn_record):
Modified:
trunk/ChangeLog
trunk/src/brasero-burn-dialog.c
trunk/src/brasero-burn-dialog.h
trunk/src/brasero-burn-options.c
trunk/src/brasero-progress.c
trunk/src/brasero-project-manager.c
trunk/src/brasero-project.c
trunk/src/burn-basics.h
trunk/src/burn-session.c
trunk/src/burn-session.h
trunk/src/burn.c
Modified: trunk/src/brasero-burn-dialog.c
==============================================================================
--- trunk/src/brasero-burn-dialog.c (original)
+++ trunk/src/brasero-burn-dialog.c Tue Nov 11 13:59:14 2008
@@ -510,11 +510,6 @@
secondary_message = g_strdup (_("A data integrity test will begin as soon as the medium is inserted."));
main_message = g_strdup (_("Please, re-insert the disc in the CD/DVD burner."));
}
- else if (error == BRASERO_BURN_WARNING_NEXT_COPY) {
- secondary_message = g_strdup (_("A recording was successfully completed."
- "\nThe next recording will begin as soon as a recordable medium is inserted."));
- main_message = brasero_burn_dialog_get_media_type_string (burn, type, TRUE);
- }
else if (error == BRASERO_BURN_ERROR_MEDIA_BUSY) {
/* Translators: %s is the name of a drive */
main_message = g_strdup_printf (_("\"%s\" is busy."), drive_name);
@@ -553,9 +548,7 @@
main_message = brasero_burn_dialog_get_media_type_string (burn, type, FALSE);
}
else if (error == BRASERO_BURN_ERROR_NONE) {
- secondary_message = brasero_burn_dialog_get_media_type_string (burn, type, FALSE);
- main_message = g_strdup_printf ("<b><big>%s</big></b>", secondary_message);
- g_free (secondary_message);
+ main_message = brasero_burn_dialog_get_media_type_string (burn, type, TRUE);
secondary_message = NULL;
}
else if (error == BRASERO_BURN_ERROR_RELOAD_MEDIA) {
@@ -581,13 +574,20 @@
g_free (secondary_message);
}
}
- else
+ else {
+ gchar *string;
+
message = gtk_message_dialog_new_with_markup (window,
GTK_DIALOG_DESTROY_WITH_PARENT|
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CANCEL,
- "%s", main_message);
+ NULL);
+
+ string = g_strdup_printf ("<b><big>%s</big></b>", main_message);
+ gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (message), string);
+ g_free (string);
+ }
g_free (main_message);
@@ -1242,6 +1242,10 @@
G_CALLBACK (brasero_burn_dialog_cancel_clicked_cb),
dialog);
+ /* Reset or set the speed info */
+ g_object_set (dialog->priv->progress,
+ "show-info", TRUE,
+ NULL);
brasero_burn_progress_set_status (BRASERO_BURN_PROGRESS (dialog->priv->progress),
FALSE,
0.0,
@@ -1606,7 +1610,7 @@
gtk_widget_destroy (message);
}
-static void
+static gboolean
brasero_burn_dialog_success_run (BraseroBurnDialog *dialog)
{
gint answer;
@@ -1625,16 +1629,22 @@
brasero_jacket_edit_set_audio_tracks (BRASERO_JACKET_EDIT (contents), title, tracks);
gtk_dialog_run (GTK_DIALOG (window));
+
+ return FALSE;
}
+
+ return (answer == GTK_RESPONSE_OK);
}
-static void
+static gboolean
brasero_burn_dialog_notify_success (BraseroBurnDialog *dialog)
{
gint64 rate;
+ gboolean res;
BraseroMedia media;
BraseroDrive *drive;
gchar *primary = NULL;
+ GtkWidget *make_another = NULL;
drive = brasero_burn_session_get_burner (dialog->priv->session);
if (dialog->priv->input.type != BRASERO_TRACK_TYPE_DISC)
@@ -1681,6 +1691,14 @@
}
brasero_burn_dialog_activity_stop (dialog, primary);
+ g_free (primary);
+
+ if (!brasero_burn_session_is_dest_file (dialog->priv->session)) {
+ /* Useful button but it shouldn't be used for images */
+ make_another = gtk_dialog_add_button (GTK_DIALOG (dialog),
+ _("Make _Another Copy"),
+ GTK_RESPONSE_OK);
+ }
/* show total required time and average speed */
rate = 0;
@@ -1701,22 +1719,17 @@
media,
dialog->priv->total_size);
-
if (brasero_burn_session_get_input_type (dialog->priv->session, NULL) == BRASERO_TRACK_TYPE_AUDIO) {
- GtkWidget *button;
-
/* since we succeed offer the possibility to create cover if that's an audio disc */
- button = brasero_utils_make_button (_("_Create Cover"),
- NULL,
- NULL,
- GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (button);
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CLOSE);
+ gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Create Cover"), GTK_RESPONSE_CLOSE);
}
- brasero_burn_dialog_success_run (dialog);
+ res = brasero_burn_dialog_success_run (dialog);
- g_free (primary);
+ if (make_another)
+ gtk_widget_destroy (make_another);
+
+ return res;
}
static void
@@ -1786,6 +1799,8 @@
BraseroBurnResult result,
GError *error)
{
+ gboolean retry = FALSE;
+
if (dialog->priv->total_time)
g_timer_stop (dialog->priv->total_time);
@@ -1811,7 +1826,7 @@
}
}
- brasero_burn_dialog_notify_success (dialog);
+ retry = brasero_burn_dialog_notify_success (dialog);
}
if (dialog->priv->burn) {
@@ -1829,17 +1844,46 @@
dialog->priv->total_time = NULL;
}
- return FALSE;
+ return retry;
+}
+
+static BraseroBurnResult
+brasero_burn_dialog_record_session (BraseroBurnDialog *dialog,
+ BraseroMedia media)
+{
+ gboolean retry;
+ GError *error = NULL;
+ BraseroBurnResult result;
+
+ brasero_burn_dialog_update_info (dialog, &dialog->priv->input, media);
+
+ /* start the recording session */
+ brasero_burn_dialog_activity_start (dialog);
+ result = brasero_burn_dialog_setup_session (dialog, &error);
+ if (result != BRASERO_BURN_OK)
+ return result;
+
+ result = brasero_burn_record (dialog->priv->burn,
+ dialog->priv->session,
+ &error);
+ if (result != BRASERO_BURN_OK)
+ return result;
+
+ retry = brasero_burn_dialog_end_session (dialog,
+ result,
+ error);
+
+ if (retry)
+ return BRASERO_BURN_RETRY;
+
+ return BRASERO_BURN_OK;
}
gboolean
brasero_burn_dialog_run (BraseroBurnDialog *dialog,
- BraseroBurnSession *session,
- gboolean *destroy)
+ BraseroBurnSession *session)
{
BraseroMedia media;
- GError *error = NULL;
- gboolean close_dialog;
BraseroBurnResult result;
dialog->priv->session = session;
@@ -1863,27 +1907,13 @@
media = brasero_medium_get_status (medium);
}
- brasero_burn_dialog_update_info (dialog, &dialog->priv->input, media);
+ do {
+ result = brasero_burn_dialog_record_session (dialog, media);
+ } while (result == BRASERO_BURN_RETRY);
- /* start the recording session */
- brasero_burn_dialog_activity_start (dialog);
-
- result = brasero_burn_dialog_setup_session (dialog, &error);
- if (result == BRASERO_BURN_OK)
- result = brasero_burn_record (dialog->priv->burn,
- session,
- &error);
-
- close_dialog = brasero_burn_dialog_end_session (dialog,
- result,
- error);
-
g_object_unref (dialog->priv->session);
dialog->priv->session = NULL;
- if (destroy)
- *destroy = close_dialog;
-
return (result == BRASERO_BURN_OK);
}
Modified: trunk/src/brasero-burn-dialog.h
==============================================================================
--- trunk/src/brasero-burn-dialog.h (original)
+++ trunk/src/brasero-burn-dialog.h Tue Nov 11 13:59:14 2008
@@ -59,7 +59,6 @@
gboolean
brasero_burn_dialog_run (BraseroBurnDialog *dialog,
- BraseroBurnSession *session,
- gboolean *destroy);
+ BraseroBurnSession *session);
#endif /* BURN_DIALOG_H */
Modified: trunk/src/brasero-burn-options.c
==============================================================================
--- trunk/src/brasero-burn-options.c (original)
+++ trunk/src/brasero-burn-options.c Tue Nov 11 13:59:14 2008
@@ -51,8 +51,6 @@
GtkWidget *selection;
GtkWidget *properties;
GtkWidget *warning;
- GtkWidget *copies_box;
- GtkWidget *copies_spin;
GtkWidget *message_output;
GtkWidget *options;
GtkWidget *button;
@@ -165,18 +163,6 @@
}
static void
-brasero_burn_options_copies_num_changed_cb (GtkSpinButton *button,
- BraseroBurnOptions *self)
-{
- gint numcopies;
- BraseroBurnOptionsPrivate *priv;
-
- priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
- numcopies = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (priv->copies_spin));
- brasero_burn_session_set_num_copies (BRASERO_BURN_SESSION (priv->session), numcopies);
-}
-
-static void
brasero_burn_options_message_response_cb (BraseroDiscMessage *message,
GtkResponseType response,
BraseroBurnOptions *self)
@@ -231,7 +217,6 @@
{
BraseroBurnOptionsPrivate *priv;
BraseroSessionError valid;
- gint numcopies;
valid = brasero_session_cfg_get_error (session);
@@ -241,25 +226,15 @@
gtk_widget_set_sensitive (priv->options, valid == BRASERO_SESSION_VALID);
gtk_widget_set_sensitive (priv->properties, valid == BRASERO_SESSION_VALID);
- if (valid != BRASERO_SESSION_VALID) {
+ if (valid != BRASERO_SESSION_VALID)
gtk_widget_hide (priv->warning);
- gtk_widget_hide (priv->copies_box);
- }
- else if (brasero_burn_session_is_dest_file (BRASERO_BURN_SESSION (priv->session))) {
+ else if (brasero_burn_session_is_dest_file (BRASERO_BURN_SESSION (priv->session)))
gtk_widget_hide (priv->warning);
- gtk_widget_hide (priv->copies_box);
- }
else {
- numcopies = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (priv->copies_spin));
- brasero_burn_session_set_num_copies (BRASERO_BURN_SESSION (priv->session), numcopies);
- gtk_widget_set_sensitive (priv->copies_box, TRUE);
-
if (brasero_burn_session_same_src_dest_drive (BRASERO_BURN_SESSION (priv->session)))
gtk_widget_show (priv->warning);
else
gtk_widget_hide (priv->warning);
-
- gtk_widget_show (priv->copies_box);
}
if (priv->message_input) {
@@ -383,7 +358,6 @@
BraseroBurnOptionsPrivate *priv;
GtkWidget *selection;
GtkWidget *button;
- GtkWidget *label;
gchar *string;
priv = BRASERO_BURN_OPTIONS_PRIVATE (object);
@@ -458,22 +432,6 @@
gtk_widget_show (priv->warning);
- /* Number of copies */
- priv->copies_box = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (priv->copies_box);
-
- label = gtk_label_new (_("Number of copies"));
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (priv->copies_box), label, FALSE, FALSE, 0);
-
- priv->copies_spin = gtk_spin_button_new_with_range (1.0, 99.0, 1.0);
- gtk_widget_show (priv->copies_spin);
- gtk_box_pack_start (GTK_BOX (priv->copies_box), priv->copies_spin, FALSE, FALSE, 0);
- g_signal_connect (priv->copies_spin,
- "value-changed",
- G_CALLBACK (brasero_burn_options_copies_num_changed_cb),
- object);
-
/* Box to display warning messages */
priv->message_output = brasero_notify_new ();
gtk_widget_show (priv->message_output);
@@ -481,7 +439,6 @@
string = g_strdup_printf ("<b>%s</b>", _("Select a disc to write to"));
selection = brasero_utils_pack_properties (string,
priv->message_output,
- priv->copies_box,
priv->warning,
selection,
NULL);
Modified: trunk/src/brasero-progress.c
==============================================================================
--- trunk/src/brasero-progress.c (original)
+++ trunk/src/brasero-progress.c Tue Nov 11 13:59:14 2008
@@ -69,7 +69,7 @@
GtkWidget *action;
GtkWidget *speed;
GtkWidget *bytes_written;
- GtkWidget *speed_time_info;
+ GtkWidget *speed_table;
BraseroBurnAction current;
gdouble current_progress;
@@ -133,8 +133,14 @@
GtkWidget *label;
GtkWidget *table;
+ if (obj->priv->speed_table) {
+ gtk_widget_destroy (obj->priv->speed_table);
+ obj->priv->speed_table = NULL;
+ obj->priv->speed = NULL;
+ }
+
table = gtk_table_new (1, 2, FALSE);
- obj->priv->speed_time_info = table;
+ obj->priv->speed_table = table;
gtk_container_set_border_width (GTK_CONTAINER (table), 0);
label = gtk_label_new (_("Estimated drive speed:"));
@@ -177,8 +183,8 @@
gchar *markup;
gchar *text;
- if (obj->priv->speed_time_info)
- gtk_widget_destroy (obj->priv->speed_time_info);
+ if (obj->priv->speed_table)
+ gtk_widget_destroy (obj->priv->speed_table);
hrs = time / 3600;
time = ((int) time) % 3600;
@@ -193,7 +199,7 @@
GtkWidget *table;
table = gtk_table_new (1, 2, FALSE);
- obj->priv->speed_time_info = table;
+ obj->priv->speed_table = table;
gtk_container_set_border_width (GTK_CONTAINER (table), 0);
label = gtk_label_new (_("Average drive speed:"));
@@ -255,13 +261,13 @@
switch (property_id) {
case PROP_SHOW_INFO:
if (!g_value_get_boolean (value)) {
- if (progress->priv->speed_time_info) {
- gtk_widget_destroy (progress->priv->speed_time_info);
- progress->priv->speed_time_info = NULL;
+ if (progress->priv->speed_table) {
+ gtk_widget_destroy (progress->priv->speed_table);
+ progress->priv->speed_table = NULL;
progress->priv->speed = NULL;
}
}
- else if (progress->priv->speed_time_info)
+ else if (progress->priv->speed_table)
brasero_burn_progress_create_info (progress);
break;
@@ -281,7 +287,7 @@
progress = BRASERO_BURN_PROGRESS (object);
switch (property_id) {
case PROP_SHOW_INFO:
- g_value_set_boolean (value, (progress->priv->speed_time_info != NULL));
+ g_value_set_boolean (value, (progress->priv->speed_table != NULL));
break;
default:
@@ -516,8 +522,8 @@
if (progress->priv->speed)
gtk_label_set_text (GTK_LABEL (progress->priv->speed), NULL);
- if (progress->priv->speed_time_info)
- gtk_label_set_text (GTK_LABEL (progress->priv->speed_time_info), NULL);
+ if (progress->priv->speed_table)
+ gtk_label_set_text (GTK_LABEL (progress->priv->speed_table), NULL);
gtk_label_set_text (GTK_LABEL (progress->priv->action), NULL);
gtk_label_set_text (GTK_LABEL (progress->priv->bytes_written), NULL);
Modified: trunk/src/brasero-project-manager.c
==============================================================================
--- trunk/src/brasero-project-manager.c (original)
+++ trunk/src/brasero-project-manager.c Tue Nov 11 13:59:14 2008
@@ -525,7 +525,6 @@
{
GtkWidget *toplevel;
GtkWidget *dialog;
- gboolean destroy;
/* now setup the burn dialog */
dialog = brasero_burn_dialog_new ();
@@ -538,21 +537,16 @@
gtk_widget_show (dialog);
brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog),
- session,
- &destroy);
+ session);
gtk_widget_destroy (dialog);
- if (!destroy) {
- brasero_project_manager_switch (manager,
- BRASERO_PROJECT_TYPE_INVALID,
- NULL,
- NULL,
- TRUE);
- gtk_widget_show (toplevel);
- }
- else
- gtk_widget_destroy (toplevel);
+ brasero_project_manager_switch (manager,
+ BRASERO_PROJECT_TYPE_INVALID,
+ NULL,
+ NULL,
+ TRUE);
+ gtk_widget_show (toplevel);
}
static void
Modified: trunk/src/brasero-project.c
==============================================================================
--- trunk/src/brasero-project.c (original)
+++ trunk/src/brasero-project.c Tue Nov 11 13:59:14 2008
@@ -833,7 +833,6 @@
BraseroDiscResult result;
GtkWidget *toplevel;
GtkWidget *dialog;
- gboolean destroy;
gboolean success;
result = brasero_project_check_status (project, project->priv->current);
@@ -856,7 +855,6 @@
return;
project->priv->is_burning = 1;
- destroy = FALSE;
/* This is to stop the preview widget from playing */
brasero_uri_container_uri_selected (BRASERO_URI_CONTAINER (project));
@@ -891,8 +889,7 @@
gtk_widget_show (dialog);
success = brasero_burn_dialog_run (BRASERO_BURN_DIALOG (dialog),
- session,
- &destroy);
+ session);
g_object_unref (session);
project->priv->burnt = success;
@@ -901,11 +898,7 @@
project->priv->is_burning = 0;
gtk_widget_destroy (dialog);
-
- if (destroy)
- gtk_widget_destroy (toplevel);
- else
- gtk_widget_show (toplevel);
+ gtk_widget_show (toplevel);
}
/******************************** ******************************************/
Modified: trunk/src/burn-basics.h
==============================================================================
--- trunk/src/burn-basics.h (original)
+++ trunk/src/burn-basics.h Tue Nov 11 13:59:14 2008
@@ -81,7 +81,6 @@
BRASERO_BURN_ERROR_BAD_CHECKSUM,
/* these are not necessarily error */
- BRASERO_BURN_WARNING_NEXT_COPY,
BRASERO_BURN_WARNING_CHECKSUM,
BRASERO_BURN_WARNING_INSERT_AFTER_COPY
} BraseroBurnError;
Modified: trunk/src/burn-session.c
==============================================================================
--- trunk/src/burn-session.c (original)
+++ trunk/src/burn-session.c Tue Nov 11 13:59:14 2008
@@ -53,8 +53,6 @@
struct _BraseroSessionSetting {
BraseroDrive *burner;
- guint num_copies;
-
/**
* Used when outputting an image instead of burning
*/
@@ -488,37 +486,6 @@
return MIN (max_rate, priv->settings->rate);
}
-void
-brasero_burn_session_set_num_copies (BraseroBurnSession *self,
- guint copies)
-{
- BraseroBurnSessionPrivate *priv;
-
- g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
-
- priv = BRASERO_BURN_SESSION_PRIVATE (self);
-
- if (!BRASERO_BURN_SESSION_WRITE_TO_DISC (priv))
- return;
-
- priv->settings->num_copies = copies;
-}
-
-guint
-brasero_burn_session_get_num_copies (BraseroBurnSession *self)
-{
- BraseroBurnSessionPrivate *priv;
-
- g_return_val_if_fail (BRASERO_IS_BURN_SESSION (self), 0);
-
- priv = BRASERO_BURN_SESSION_PRIVATE (self);
-
- if (!BRASERO_BURN_SESSION_WRITE_TO_DISC (priv))
- return 1;
-
- return priv->settings->num_copies;
-}
-
/**
* This function returns a path only if we should output to a file image
* and not burn.
@@ -1446,7 +1413,6 @@
medium = brasero_drive_get_medium (priv->settings->burner);
BRASERO_BURN_LOG_DISC_TYPE (brasero_medium_get_status (medium), "media type\t=");
BRASERO_BURN_LOG ("speed\t= %i", priv->settings->rate);
- BRASERO_BURN_LOG ("number of copies\t= %i", priv->settings->num_copies);
}
else {
type.type = BRASERO_TRACK_TYPE_IMAGE;
Modified: trunk/src/burn-session.h
==============================================================================
--- trunk/src/burn-session.h (original)
+++ trunk/src/burn-session.h Tue Nov 11 13:59:14 2008
@@ -282,13 +282,6 @@
guint64
brasero_burn_session_get_rate (BraseroBurnSession *session);
-void
-brasero_burn_session_set_num_copies (BraseroBurnSession *session,
- guint copies);
-
-guint
-brasero_burn_session_get_num_copies (BraseroBurnSession *session);
-
G_END_DECLS
#endif /* BURN_SESSION_H */
Modified: trunk/src/burn.c
==============================================================================
--- trunk/src/burn.c (original)
+++ trunk/src/burn.c Tue Nov 11 13:59:14 2008
@@ -762,6 +762,7 @@
medium = brasero_drive_get_medium (priv->dest);
if (!medium) {
+ g_print ("REALOOD\n");
result = BRASERO_BURN_NEED_RELOAD;
berror = BRASERO_BURN_ERROR_MEDIA_NONE;
goto end;
@@ -771,7 +772,7 @@
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
- _("the drive has no burning capabilities"));
+ _("The drive cannot burn or the medium cannot be burnt"));
BRASERO_BURN_NOT_SUPPORTED_LOG (burn);
}
@@ -832,7 +833,9 @@
/* we warn the user is going to lose data even if in the case of
* DVD+/-RW we don't really blank the disc we rather overwrite */
- result = brasero_burn_emit_signal (burn, WARN_DATA_LOSS_SIGNAL, BRASERO_BURN_CANCEL);
+ result = brasero_burn_emit_signal (burn,
+ WARN_DATA_LOSS_SIGNAL,
+ BRASERO_BURN_CANCEL);
if (result != BRASERO_BURN_OK)
goto end;
}
@@ -844,7 +847,9 @@
* append audio to appendable disc. That's because audio
* tracks have little chance to be readable by common CD
* player as last tracks */
- result = brasero_burn_emit_signal (burn, WARN_AUDIO_TO_APPENDABLE_SIGNAL, BRASERO_BURN_CANCEL);
+ result = brasero_burn_emit_signal (burn,
+ WARN_AUDIO_TO_APPENDABLE_SIGNAL,
+ BRASERO_BURN_CANCEL);
if (result != BRASERO_BURN_OK)
goto end;
}
@@ -857,7 +862,9 @@
/* warn the users that their previous data
* session (s) will not be mounted by default by
* the OS and that it'll be invisible */
- result = brasero_burn_emit_signal (burn, WARN_PREVIOUS_SESSION_LOSS_SIGNAL, BRASERO_BURN_CANCEL);
+ result = brasero_burn_emit_signal (burn,
+ WARN_PREVIOUS_SESSION_LOSS_SIGNAL,
+ BRASERO_BURN_CANCEL);
if (result != BRASERO_BURN_OK)
goto end;
}
@@ -906,7 +913,7 @@
brasero_drive_unlock (priv->dest);
}
- if (result == BRASERO_BURN_ERROR_RELOAD_MEDIA && ret_error)
+ if (result == BRASERO_BURN_NEED_RELOAD && ret_error)
*ret_error = berror;
return result;
@@ -1893,11 +1900,6 @@
return BRASERO_BURN_ERR;
}
}
- else {
- /* check number of copies must be 1 */
- if (brasero_burn_session_get_num_copies (priv->session) != 1)
- brasero_burn_session_set_num_copies (priv->session, 1);
- }
media = brasero_burn_session_get_dest_media (priv->session);
@@ -2137,13 +2139,17 @@
/* this may be necessary for the drive to settle down and possibly be
* mounted by gnome-volume-manager (just temporarily) */
result = brasero_burn_sleep (burn, 5000);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_burn_session_pop_tracks (priv->session);
return result;
+ }
/* reprobe the medium and wait for it to be probed */
result = brasero_burn_reprobe (burn);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_burn_session_pop_tracks (priv->session);
return result;
+ }
medium = brasero_drive_get_medium (priv->dest);
@@ -2461,15 +2467,16 @@
goto end;
}
else if (!brasero_burn_session_is_dest_file (session)) {
- BraseroBurnError berror;
+ BraseroBurnError berror = BRASERO_BURN_ERROR_NONE;
/* do some drive locking quite early to make sure we have a
* media in the drive so that we'll have all the necessary
* information */
result = brasero_burn_lock_dest_media (burn, &berror, error);
+ g_print ("BERR %i\n", berror);
while (result == BRASERO_BURN_NEED_RELOAD) {
BraseroMedia required_media;
-
+g_print ("berror %i\n", berror);
required_media = brasero_burn_caps_get_required_media_type (priv->caps,
priv->session);
if (required_media == BRASERO_MEDIUM_NONE)
@@ -2479,7 +2486,7 @@
berror,
required_media,
error);
- if (result == BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK)
goto end;
result = brasero_burn_lock_dest_media (burn, &berror, error);
@@ -2498,31 +2505,6 @@
/* burn the session a first time whatever the number of copies required
* except if dummy session */
result = brasero_burn_record_session (burn, TRUE, error);
- if (result == BRASERO_BURN_OK) {
- gint num_copies;
-
- /* burn all other required copies */
- num_copies = brasero_burn_session_get_num_copies (session);
- while (--num_copies > 0 && result == BRASERO_BURN_OK) {
- BRASERO_BURN_LOG ("Burning additional copies (%i left)",
- num_copies);
-
- /* we only need to reload and lock dest media */
- result = brasero_burn_reload_dest_media (burn,
- BRASERO_BURN_WARNING_NEXT_COPY,
- error);
- if (result != BRASERO_BURN_OK)
- break;
-
- /* see if we still need it to be locked */
- if (brasero_burn_session_get_input_type (session, NULL) != BRASERO_TRACK_TYPE_DISC)
- brasero_burn_unlock_src_media (burn, NULL);
-
- result = brasero_burn_record_session (burn, TRUE, error);
- if (result != BRASERO_BURN_OK)
- break;
- }
- }
end:
@@ -2539,7 +2521,7 @@
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
- _("internal error (code %i)"),
+ _("Internal error (code %i)"),
result);
if (result == BRASERO_BURN_CANCEL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]