let the return value indicate whether the file has been saved.

2007-02-05  Sven Neumann  <sven@gimp.org>

	* app/dialogs/file-save-dialog.c (file_save_dialog_save_image):
	let the return value indicate whether the file has been saved.
	(file_save_dialog_response): only hide the dialog after the 
image
	has been saved.


svn path=/trunk/; revision=21852
This commit is contained in:
Sven Neumann 2007-02-05 20:07:42 +00:00 committed by Sven Neumann
parent ad2ec0b52d
commit 9e1202f025
2 changed files with 14 additions and 16 deletions

View file

@ -1,3 +1,10 @@
2007-02-05 Sven Neumann <sven@gimp.org>
* app/dialogs/file-save-dialog.c (file_save_dialog_save_image):
let the return value indicate whether the file has been saved.
(file_save_dialog_response): only hide the dialog after the image
has been saved.
2007-02-05 Sven Neumann <sven@gimp.org>
* gimpui.pc.in (Requires): require gimp-2.0 >= $GIMP_APP_VERSION.

View file

@ -67,8 +67,7 @@ static gboolean file_save_dialog_save_image (GtkWidget *save_dial
GimpImage *image,
const gchar *uri,
GimpPlugInProcedure *save_proc,
gboolean save_a_copy,
gboolean *file_saved);
gboolean save_a_copy);
/* public functions */
@ -132,20 +131,17 @@ file_save_dialog_response (GtkWidget *save_dialog,
if (file_save_dialog_check_uri (save_dialog, gimp,
&uri, &basename, &save_proc))
{
gboolean file_saved = FALSE;
if (file_save_dialog_save_image (save_dialog,
dialog->image,
uri,
save_proc,
dialog->save_a_copy,
&file_saved))
dialog->save_a_copy))
{
if (dialog)
{
gtk_widget_hide (save_dialog);
if (file_saved && dialog->close_after_saving)
if (dialog->close_after_saving)
{
GtkWindow *parent;
@ -498,13 +494,12 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
GimpImage *image,
const gchar *uri,
GimpPlugInProcedure *save_proc,
gboolean save_a_copy,
gboolean *file_saved)
gboolean save_a_copy)
{
GimpPDBStatusType status;
GError *error = NULL;
GList *list;
gboolean success = TRUE;
gboolean success = FALSE;
for (list = gimp_action_groups_from_name ("file");
list;
@ -526,13 +521,11 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
g_object_unref (image);
*file_saved = FALSE;
switch (status)
{
case GIMP_PDB_SUCCESS:
*file_saved = TRUE;
/* fallthru */
success = TRUE;
break;
case GIMP_PDB_CANCEL:
break;
@ -545,8 +538,6 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
_("Saving '%s' failed:\n\n%s"), filename, error->message);
g_clear_error (&error);
g_free (filename);
success = FALSE;
}
break;
}