[brasero] Handle the case where despite our locking the medium, the user manages to eject it while the option
- From: Philippe Rouquier <philippr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [brasero] Handle the case where despite our locking the medium, the user manages to eject it while the option
- Date: Sat, 19 Jun 2010 18:42:51 +0000 (UTC)
commit e25bc00e3f027e2c3e90acde2489e195ff80a3e7
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Sat Jun 19 22:42:26 2010 +0200
Handle the case where despite our locking the medium, the user manages to eject it while the option dialog is showing
src/brasero-project.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/brasero-project.c b/src/brasero-project.c
index a1fc2d0..75a3e73 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -1464,6 +1464,14 @@ brasero_project_setup_session (BraseroProject *project,
}
}
+static void
+brasero_project_output_changed (BraseroBurnSession *session,
+ BraseroMedium *former_medium,
+ GtkDialog *dialog)
+{
+ gtk_dialog_response (dialog, GTK_RESPONSE_CANCEL);
+}
+
static BraseroBurnResult
brasero_project_drive_properties (BraseroProject *project)
{
@@ -1475,6 +1483,7 @@ brasero_project_drive_properties (BraseroProject *project)
GtkWidget *options;
GtkWidget *button;
GtkWidget *dialog;
+ glong cancel_sig;
GtkWidget *box;
gchar *header;
gchar *string;
@@ -1495,6 +1504,12 @@ brasero_project_drive_properties (BraseroProject *project)
NULL);
g_free (header);
+ /* This is in case the medium gets ejected instead of our locking it */
+ cancel_sig = g_signal_connect (project->priv->session,
+ "output-changed",
+ G_CALLBACK (brasero_project_output_changed),
+ dialog);
+
gtk_dialog_add_button (GTK_DIALOG (dialog),
_("Burn _Several Copies"),
GTK_RESPONSE_ACCEPT);
@@ -1539,6 +1554,8 @@ brasero_project_drive_properties (BraseroProject *project)
answer = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
+ g_signal_handler_disconnect (project->priv->session, cancel_sig);
+
if (answer == GTK_RESPONSE_OK)
return BRASERO_BURN_OK;
@@ -1616,8 +1633,7 @@ brasero_project_burn (BraseroProject *project)
if (brasero_project_check_plugins_not_ready (project, BRASERO_BURN_SESSION (project->priv->session)) != BRASERO_BURN_OK)
return;
- /* Set saved temporary directory for the session.
- * NOTE: BraseroBurnSession can cope with NULL path */
+ /* Set saved parameters for the session */
settings = brasero_drive_settings_new ();
brasero_drive_settings_set_session (settings, BRASERO_BURN_SESSION (project->priv->session));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]