added "gboolean set_image_clean" and call gimp_image_clean_all() only if

2003-04-09  Michael Natterer  <mitch@gimp.org>

	* app/file/file-save.[ch] (file_save_as): added "gboolean
	set_image_clean" and call gimp_image_clean_all() only if it
	was passed as TRUE.
	(file_save): pass TRUE.

	* app/gui/file-save-dialog.c: pass TRUE from the "Save as" and
	FALSE from the "Save a Copy" dialog (bug #109464).
This commit is contained in:
Michael Natterer 2003-04-09 09:52:01 +00:00 committed by Michael Natterer
parent 13a9252950
commit 43c341c055
5 changed files with 43 additions and 11 deletions

View File

@ -1,3 +1,13 @@
2003-04-09 Michael Natterer <mitch@gimp.org>
* app/file/file-save.[ch] (file_save_as): added "gboolean
set_image_clean" and call gimp_image_clean_all() only if it
was passed as TRUE.
(file_save): pass TRUE.
* app/gui/file-save-dialog.c: pass TRUE from the "Save as" and
FALSE from the "Save a Copy" dialog (bug #109464).
2003-04-09 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_remove_channel): say

View File

@ -70,7 +70,8 @@ static void file_save_dialog_save_image (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc);
gboolean set_uri_and_proc,
gboolean set_image_clean);
static GtkWidget *filesave = NULL;
@ -78,6 +79,7 @@ static GtkWidget *filesave = NULL;
static PlugInProcDef *save_file_proc = NULL;
static GimpImage *the_gimage = NULL;
static gboolean set_uri_and_proc = TRUE;
static gboolean set_image_clean = TRUE;
/* public functions */
@ -106,6 +108,7 @@ file_save_dialog_show (GimpImage *gimage,
the_gimage = gimage;
set_uri_and_proc = TRUE;
set_image_clean = TRUE;
if (! filesave)
filesave = file_save_dialog_create (gimage->gimp, menu_factory);
@ -153,6 +156,7 @@ file_save_a_copy_dialog_show (GimpImage *gimage,
the_gimage = gimage;
set_uri_and_proc = FALSE;
set_image_clean = FALSE;
uri = gimp_object_get_name (GIMP_OBJECT (gimage));
@ -292,7 +296,8 @@ file_save_ok_callback (GtkWidget *widget,
uri,
raw_filename,
save_file_proc,
set_uri_and_proc);
set_uri_and_proc,
set_image_clean);
gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE);
}
@ -366,7 +371,8 @@ file_save_overwrite_callback (GtkWidget *widget,
overwrite_data->uri,
overwrite_data->raw_filename,
save_file_proc,
set_uri_and_proc);
set_uri_and_proc,
set_image_clean);
}
gtk_widget_set_sensitive (overwrite_data->save_dialog, TRUE);
@ -382,7 +388,8 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc)
gboolean set_uri_and_proc,
gboolean set_image_clean)
{
GimpPDBStatusType status;
GError *error = NULL;
@ -393,6 +400,7 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
save_proc,
GIMP_RUN_INTERACTIVE,
set_uri_and_proc,
set_image_clean,
&error);
if (status != GIMP_PDB_SUCCESS &&

View File

@ -79,7 +79,8 @@ file_save (GimpImage *gimage,
file_proc = gimp_image_get_save_proc (gimage);
return file_save_as (gimage, uri, uri, file_proc, run_mode, FALSE, error);
return file_save_as (gimage, uri, uri, file_proc, run_mode,
FALSE, TRUE, error);
}
GimpPDBStatusType
@ -89,6 +90,7 @@ file_save_as (GimpImage *gimage,
PlugInProcDef *file_proc,
GimpRunMode run_mode,
gboolean set_uri_and_proc,
gboolean set_image_clean,
GError **error)
{
ProcRecord *proc;
@ -170,8 +172,11 @@ file_save_as (GimpImage *gimage,
GimpDocumentList *documents;
GimpImagefile *imagefile;
/* set this image to clean */
gimp_image_clean_all (gimage);
if (set_image_clean)
{
/* set this image to clean */
gimp_image_clean_all (gimage);
}
documents = GIMP_DOCUMENT_LIST (gimage->gimp->documents);
imagefile = gimp_document_list_add_uri (documents, uri);

View File

@ -29,6 +29,7 @@ GimpPDBStatusType file_save_as (GimpImage *gimage,
PlugInProcDef *file_proc,
GimpRunMode run_mode,
gboolean set_uri_and_proc,
gboolean set_image_clean,
GError **error);

View File

@ -70,7 +70,8 @@ static void file_save_dialog_save_image (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc);
gboolean set_uri_and_proc,
gboolean set_image_clean);
static GtkWidget *filesave = NULL;
@ -78,6 +79,7 @@ static GtkWidget *filesave = NULL;
static PlugInProcDef *save_file_proc = NULL;
static GimpImage *the_gimage = NULL;
static gboolean set_uri_and_proc = TRUE;
static gboolean set_image_clean = TRUE;
/* public functions */
@ -106,6 +108,7 @@ file_save_dialog_show (GimpImage *gimage,
the_gimage = gimage;
set_uri_and_proc = TRUE;
set_image_clean = TRUE;
if (! filesave)
filesave = file_save_dialog_create (gimage->gimp, menu_factory);
@ -153,6 +156,7 @@ file_save_a_copy_dialog_show (GimpImage *gimage,
the_gimage = gimage;
set_uri_and_proc = FALSE;
set_image_clean = FALSE;
uri = gimp_object_get_name (GIMP_OBJECT (gimage));
@ -292,7 +296,8 @@ file_save_ok_callback (GtkWidget *widget,
uri,
raw_filename,
save_file_proc,
set_uri_and_proc);
set_uri_and_proc,
set_image_clean);
gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE);
}
@ -366,7 +371,8 @@ file_save_overwrite_callback (GtkWidget *widget,
overwrite_data->uri,
overwrite_data->raw_filename,
save_file_proc,
set_uri_and_proc);
set_uri_and_proc,
set_image_clean);
}
gtk_widget_set_sensitive (overwrite_data->save_dialog, TRUE);
@ -382,7 +388,8 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
const gchar *uri,
const gchar *raw_filename,
PlugInProcDef *save_proc,
gboolean set_uri_and_proc)
gboolean set_uri_and_proc,
gboolean set_image_clean)
{
GimpPDBStatusType status;
GError *error = NULL;
@ -393,6 +400,7 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
save_proc,
GIMP_RUN_INTERACTIVE,
set_uri_and_proc,
set_image_clean,
&error);
if (status != GIMP_PDB_SUCCESS &&