[brasero] Fix (or rather workaround) #568358 - Not accessibe error dialog in print preview



commit 2e5daeacec1d6c8ee0d04945124566ae455adc47
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon Dec 7 21:19:57 2009 +0100

    Fix (or rather workaround) #568358 -  Not accessibe error dialog in print preview

 libbrasero-burn/brasero-burn-dialog.c  |    7 ++++++-
 libbrasero-burn/brasero-cover.c        |    4 +---
 libbrasero-utils/brasero-jacket-edit.c |    6 +++++-
 src/brasero-project-manager.c          |    8 +++++++-
 src/brasero-project.c                  |    8 +++++++-
 5 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/libbrasero-burn/brasero-burn-dialog.c b/libbrasero-burn/brasero-burn-dialog.c
index d3712df..f5f908b 100644
--- a/libbrasero-burn/brasero-burn-dialog.c
+++ b/libbrasero-burn/brasero-burn-dialog.c
@@ -1876,7 +1876,12 @@ brasero_burn_dialog_success_run (BraseroBurnDialog *dialog)
 		GtkWidget *window;
 
 		window = brasero_session_edit_cover (priv->session, GTK_WIDGET (dialog));
-		gtk_dialog_run (GTK_DIALOG (window));
+		/* This strange hack is a way to workaround #568358.
+		 * At one point we'll need to hide the dialog which means it
+		 * will anwer with a GTK_RESPONSE_NONE */
+		while (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_NONE)
+			gtk_widget_show (GTK_WIDGET (dialog));
+
 		gtk_widget_destroy (window);
 		return FALSE;
 	}
diff --git a/libbrasero-burn/brasero-cover.c b/libbrasero-burn/brasero-cover.c
index 46b6a3a..754e715 100644
--- a/libbrasero-burn/brasero-cover.c
+++ b/libbrasero-burn/brasero-cover.c
@@ -169,10 +169,8 @@ brasero_jacket_edit_set_audio_tracks_back (BraseroJacketView *back,
 
 	gtk_text_buffer_get_start_iter (buffer, &start);
 
-	if (label) {
+	if (label)
 		BRASERO_JACKET_EDIT_INSERT_TAGGED_TEXT (buffer, label, "Title", &start);
-	}
-
 }
 
 static void
diff --git a/libbrasero-utils/brasero-jacket-edit.c b/libbrasero-utils/brasero-jacket-edit.c
index 5a062c9..586c17e 100644
--- a/libbrasero-utils/brasero-jacket-edit.c
+++ b/libbrasero-utils/brasero-jacket-edit.c
@@ -123,9 +123,13 @@ brasero_jacket_edit_print_pressed_cb (GtkButton *button,
 			  self);
 
 	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
+
+	/* NOTE: when a dialog is hidden while it was run by gtk_dialog_run ()
+	 * a response will be sent (GTK_RESPONSE_NONE) */
+	gtk_widget_hide (toplevel);
 	res = gtk_print_operation_run (print,
 				       GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
-				       GTK_WINDOW (toplevel),
+				       gtk_window_get_transient_for (GTK_WINDOW (toplevel)),
 				       &error);
 	g_object_unref (print);
 }
diff --git a/src/brasero-project-manager.c b/src/brasero-project-manager.c
index 8d9718c..6b9b1e9 100644
--- a/src/brasero-project-manager.c
+++ b/src/brasero-project-manager.c
@@ -218,7 +218,13 @@ brasero_project_manager_new_cover_cb (GtkAction *action,
 
 	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (manager));
 	dialog = brasero_jacket_edit_dialog_new (toplevel, &edit);
-	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	/* This strange hack is a way to workaround #568358.
+	 * At one point we'll need to hide the dialog which means it
+	 * will anwer with a GTK_RESPONSE_NONE */
+	while (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_NONE)
+		gtk_widget_show (GTK_WIDGET (dialog));
+
 	gtk_widget_destroy (dialog);
 }
 
diff --git a/src/brasero-project.c b/src/brasero-project.c
index c394daa..f3d32f3 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -1660,7 +1660,13 @@ brasero_project_create_audio_cover (BraseroProject *project)
 	brasero_project_setup_session (project, BRASERO_BURN_SESSION (project->priv->session));
 	window = brasero_session_edit_cover (BRASERO_BURN_SESSION (project->priv->session),
 					     gtk_widget_get_toplevel (GTK_WIDGET (project)));
-	gtk_dialog_run (GTK_DIALOG (window));
+
+	/* This strange hack is a way to workaround #568358.
+	 * At one point we'll need to hide the dialog which means it
+	 * will anwer with a GTK_RESPONSE_NONE */
+	while (gtk_dialog_run (GTK_DIALOG (window)) == GTK_RESPONSE_NONE)
+		gtk_widget_show (GTK_WIDGET (window));
+
 	gtk_widget_destroy (window);
 }
 



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