allow to discard invisible layers as suggested in bug #337557.

2006-04-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage-merge.[ch] (gimp_image_merge_visible_layers):
	allow to discard invisible layers as suggested in bug #337557.

	* app/actions/image-commands.c
	* app/dialogs/image-merge-layers-dialog.[ch]: added a check button
	to the Merge Visible Layers dialog to control the new feature.

	* app/file/file-open.c
	* tools/pdbgen/pdb/image.pdb: pass FALSE for the new parameter.

	* app/pdb/image_cmds.c: regenerated.
This commit is contained in:
Sven Neumann
2006-04-07 08:01:02 +00:00
committed by Sven Neumann
parent 3e3ff52aa1
commit e43b8ea082
9 changed files with 87 additions and 17 deletions

View File

@ -41,10 +41,13 @@ ImageMergeLayersDialog *
image_merge_layers_dialog_new (GimpImage *image,
GimpContext *context,
GtkWidget *parent,
GimpMergeType merge_type)
GimpMergeType merge_type,
gboolean discard_invisible)
{
ImageMergeLayersDialog *dialog;
GtkWidget *vbox;
GtkWidget *frame;
GtkWidget *button;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
@ -79,6 +82,11 @@ image_merge_layers_dialog_new (GimpImage *image,
GTK_RESPONSE_CANCEL,
-1);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox), vbox);
gtk_widget_show (vbox);
frame = gimp_int_radio_group_new (TRUE, _("Final, Merged Layer should be:"),
G_CALLBACK (gimp_radio_button_update),
&dialog->merge_type, dialog->merge_type,
@ -94,9 +102,19 @@ image_merge_layers_dialog_new (GimpImage *image,
NULL);
gtk_container_set_border_width (GTK_CONTAINER (frame), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox), frame);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
button = gtk_check_button_new_with_mnemonic (_("_Discard invisible layers"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
dialog->discard_invisible);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect (button, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&dialog->discard_invisible);
return dialog;
}