From ea74671df0da7607dce9d9c26770912f1a0e9c6e Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 6 May 1998 22:20:43 +0000 Subject: [PATCH] try six of commit --- ChangeLog | 4 ++++ app/fileops.c | 26 ++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a3b6aec65..4178da5d3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu May 7 15:24:31 EDT 1998 Matthew Wilson + + * app/fileops.c: more changes to fileselection + Tue May 5 11:40:28 PDT 1998 Manish Singh * plug-ins/psd/psd.c: updates from Adam diff --git a/app/fileops.c b/app/fileops.c index 2565cdfbcf..dfd0fe637f 100644 --- a/app/fileops.c +++ b/app/fileops.c @@ -300,6 +300,16 @@ static PlugInProcDef *save_file_proc = NULL; static int image_ID = 0; +static void +file_message_box_close_callback (GtkWidget *w, + gpointer client_data) +{ + GtkFileSelection *fs; + + fs = (GtkFileSelection *) client_data; + + gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE); +} void file_ops_pre_init () @@ -843,13 +853,11 @@ file_open_ok_callback (GtkWidget *w, return; } - gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE); - s = g_string_new ("Open failed: "); g_string_append (s, raw_filename); - message_box (s->str, NULL, NULL); + message_box (s->str, file_message_box_close_callback, (void *) fs); g_string_free (s, TRUE); } @@ -870,7 +878,6 @@ file_save_ok_callback (GtkWidget *w, err = stat (filename, &buf); g_assert (filename && raw_filename); - gtk_widget_set_sensitive (GTK_WIDGET (fs), FALSE); if (err == 0) { @@ -884,6 +891,7 @@ file_save_ok_callback (GtkWidget *w, } else if (buf.st_mode & S_IFREG) { + gtk_widget_set_sensitive (GTK_WIDGET (fs), FALSE); file_overwrite (g_strdup (filename), g_strdup (raw_filename)); return; } @@ -893,6 +901,7 @@ file_save_ok_callback (GtkWidget *w, g_string_sprintf (s, "%s is an irregular file (%s)", raw_filename, g_strerror(errno)); } } else { + gtk_widget_set_sensitive (GTK_WIDGET (fs), FALSE); if (file_save (image_ID, filename, raw_filename)) { file_dialog_hide (client_data); @@ -905,10 +914,10 @@ file_save_ok_callback (GtkWidget *w, g_string_append (s, raw_filename); g_string_append (s, "\nYou might have tried to save an RGB image with"); g_string_append (s, "\na plug-in that only supports Indexed or Gray images"); - gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE); } } - message_box (s->str, NULL, NULL); + message_box (s->str, file_message_box_close_callback, (void *) fs); + g_string_free (s, TRUE); } @@ -1010,8 +1019,7 @@ file_overwrite_yes_callback (GtkWidget *w, g_string_append (s, "\nYou might have tried to save an RGB image with"); g_string_append (s, "\na plug-in that only supports Indexed or Gray images"); - message_box (s->str, NULL, NULL); - + message_box (s->str, file_message_box_close_callback, (void *) filesave); g_string_free (s, TRUE); } @@ -1019,8 +1027,6 @@ file_overwrite_yes_callback (GtkWidget *w, g_free (overwrite_box->full_filename); g_free (overwrite_box->raw_filename); g_free (overwrite_box); - - gtk_widget_set_sensitive (GTK_WIDGET(filesave), TRUE); } static gint