~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/dialogs/image-merge-layers-dialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
41
41
image_merge_layers_dialog_new (GimpImage     *image,
42
42
                               GimpContext   *context,
43
43
                               GtkWidget     *parent,
44
 
                               GimpMergeType  merge_type)
 
44
                               GimpMergeType  merge_type,
 
45
                               gboolean       discard_invisible)
45
46
{
46
47
  ImageMergeLayersDialog *dialog;
 
48
  GtkWidget              *vbox;
47
49
  GtkWidget              *frame;
 
50
  GtkWidget              *button;
48
51
 
49
52
  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
50
53
  g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
51
54
 
52
55
  dialog = g_new0 (ImageMergeLayersDialog, 1);
53
56
 
54
 
  dialog->gimage     = image;
 
57
  dialog->image      = image;
55
58
  dialog->context    = context;
56
59
  dialog->merge_type = GIMP_EXPAND_AS_NECESSARY;
57
60
 
58
61
  dialog->dialog =
59
 
    gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
 
62
    gimp_viewable_dialog_new (GIMP_VIEWABLE (image), context,
60
63
                              _("Merge Layers"), "gimp-image-merge-layers",
61
64
                              GIMP_STOCK_MERGE_DOWN,
62
65
                              _("Layers Merge Options"),
65
68
                              GIMP_HELP_IMAGE_MERGE_LAYERS,
66
69
 
67
70
                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
68
 
                              GTK_STOCK_OK,     GTK_RESPONSE_OK,
 
71
                              _("_Merge"),      GTK_RESPONSE_OK,
69
72
 
70
73
                              NULL);
71
74
 
74
77
  g_object_weak_ref (G_OBJECT (dialog->dialog),
75
78
                     (GWeakNotify) g_free, dialog);
76
79
 
 
80
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog->dialog),
 
81
                                           GTK_RESPONSE_OK,
 
82
                                           GTK_RESPONSE_CANCEL,
 
83
                                           -1);
 
84
 
 
85
  vbox = gtk_vbox_new (FALSE, 12);
 
86
  gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
 
87
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox), vbox);
 
88
  gtk_widget_show (vbox);
 
89
 
77
90
  frame = gimp_int_radio_group_new (TRUE, _("Final, Merged Layer should be:"),
78
91
                                    G_CALLBACK (gimp_radio_button_update),
79
92
                                    &dialog->merge_type, dialog->merge_type,
89
102
 
90
103
                                    NULL);
91
104
 
92
 
  gtk_container_set_border_width (GTK_CONTAINER (frame), 12);
93
 
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox), frame);
 
105
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
94
106
  gtk_widget_show (frame);
95
107
 
 
108
  button = gtk_check_button_new_with_mnemonic (_("_Discard invisible layers"));
 
109
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
 
110
                                dialog->discard_invisible);
 
111
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
 
112
  gtk_widget_show (button);
 
113
 
 
114
  g_signal_connect (button, "toggled",
 
115
                    G_CALLBACK (gimp_toggle_button_update),
 
116
                    &dialog->discard_invisible);
 
117
 
 
118
 
96
119
  return dialog;
97
120
}