after appending an extension, invoke "response" on the dialog and bail

2006-09-10  Michael Natterer  <mitch@gimp.org>

	* app/dialogs/file-save-dialog.c (file_save_dialog_check_uri):
	after appending an extension, invoke "response" on the dialog and
	bail out, so the file chooser re-runs the overwrite-confirm check.
This commit is contained in:
Michael Natterer 2006-09-10 11:55:43 +00:00 committed by Michael Natterer
parent 3ff51fb4e3
commit ba4db39c9d
2 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2006-09-10 Michael Natterer <mitch@gimp.org>
* app/dialogs/file-save-dialog.c (file_save_dialog_check_uri):
after appending an extension, invoke "response" on the dialog and
bail out, so the file chooser re-runs the overwrite-confirm check.
2006-09-10 Sven Neumann <sven@gimp.org>
* app/errors.c

View File

@ -234,8 +234,8 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
uri = ext_uri;
basename = ext_basename;
uri_proc = file_utils_find_proc (gimp->plug_in_manager->save_procs,
uri, NULL);
uri_proc = file_utils_find_proc (gimp->plug_in_manager->save_procs,
uri, NULL);
basename_proc = file_utils_find_proc (gimp->plug_in_manager->save_procs,
basename, NULL);
@ -243,6 +243,21 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (save_dialog),
utf8);
g_free (utf8);
#ifdef DEBUG_SPEW
g_print ("%s: set basename to %s, rerunning response and "
"bailing out\n", G_STRFUNC, basename);
#endif
/* call the response callback again, so the
* overwrite-confirm logic can check the changed uri
*/
gtk_dialog_response (GTK_DIALOG (save_dialog), GTK_RESPONSE_OK);
g_free (uri);
g_free (basename);
return FALSE;
}
else
{