[eog] Keep the dialog alive during saving to lock the main window



commit 295675deeaf0506c38190e9d4e8f95ece9cf0f8f
Author: Felix Riemann <friemann gnome org>
Date:   Sun Nov 15 21:18:11 2009 +0100

    Keep the dialog alive during saving to lock the main window
    
    Make both window and dialog insensitive to avoid any further change to
    the images during longer save operations.

 src/eog-window.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 87dce85..b856cdd 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -2470,7 +2470,8 @@ close_confirmation_dialog_response_handler (EogCloseConfirmationDialog *dlg,
 		case GTK_RESPONSE_YES:
 			/* save selected images */
 			selected_images = eog_close_confirmation_dialog_get_selected_images (dlg);
-
+			gtk_widget_set_sensitive (GTK_WIDGET (dlg), FALSE);
+			gtk_widget_set_sensitive (GTK_WIDGET (window), FALSE);
 			if (eog_window_save_images (window, selected_images)) {
 				g_signal_connect (priv->save_job,
 							  "finished",
@@ -2489,10 +2490,9 @@ close_confirmation_dialog_response_handler (EogCloseConfirmationDialog *dlg,
 
 		default:
 			/* Cancel */
+			gtk_widget_destroy (GTK_WIDGET (dlg));
 			break;
-	}
-
-	gtk_widget_destroy (GTK_WIDGET (dlg));
+	}	
 }
 
 static gboolean
@@ -2533,6 +2533,7 @@ eog_window_unsaved_images_confirm (EogWindow *window)
 				  "response",
 				  G_CALLBACK (close_confirmation_dialog_response_handler),
 				  window);
+		gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
 
 		gtk_widget_show (dialog);
 		return TRUE;



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