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

« back to all changes in this revision

Viewing changes to app/dialogs/scale-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
24
24
 
25
25
#include "dialogs-types.h"
26
26
 
 
27
#include "core/gimpcontext.h"
27
28
#include "core/gimpimage.h"
28
29
#include "core/gimpitem.h"
29
30
 
30
 
#include "widgets/gimpenumcombobox.h"
31
31
#include "widgets/gimphelp-ids.h"
 
32
#include "widgets/gimpmessagebox.h"
32
33
#include "widgets/gimpsizebox.h"
33
34
#include "widgets/gimpviewabledialog.h"
34
35
 
62
63
 
63
64
GtkWidget *
64
65
scale_dialog_new (GimpViewable          *viewable,
 
66
                  GimpContext           *context,
65
67
                  const gchar           *title,
66
68
                  const gchar           *role,
67
69
                  GtkWidget             *parent,
84
86
  gdouble      xres, yres;
85
87
 
86
88
  g_return_val_if_fail (GIMP_IS_VIEWABLE (viewable), NULL);
 
89
  g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
87
90
  g_return_val_if_fail (callback != NULL, NULL);
88
91
 
89
92
  if (GIMP_IS_IMAGE (viewable))
111
114
      g_return_val_if_reached (NULL);
112
115
    }
113
116
 
114
 
  dialog = gimp_viewable_dialog_new (viewable,
 
117
  dialog = gimp_viewable_dialog_new (viewable, context,
115
118
                                     title, role, GIMP_STOCK_SCALE, title,
116
119
                                     parent,
117
120
                                     help_func, help_id,
122
125
 
123
126
                                     NULL);
124
127
 
 
128
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
 
129
                                           RESPONSE_RESET,
 
130
                                           GTK_RESPONSE_OK,
 
131
                                           GTK_RESPONSE_CANCEL,
 
132
                                           -1);
 
133
 
125
134
  gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
126
135
 
127
136
  private = g_new0 (ScaleDialog, 1);
179
188
  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
180
189
  gtk_widget_show (label);
181
190
 
 
191
  gtk_size_group_add_widget (GIMP_SIZE_BOX (private->box)->size_group, label);
 
192
 
182
193
  private->combo = gimp_enum_combo_box_new (GIMP_TYPE_INTERPOLATION_TYPE);
183
194
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), private->combo);
184
195
  gtk_box_pack_start (GTK_BOX (hbox), private->combo, TRUE, TRUE, 0);
189
200
 
190
201
  if (gimp_image_base_type (image) == GIMP_INDEXED)
191
202
    {
192
 
      label = gtk_label_new (_("Indexed color layers are always scaled "
193
 
                               "without interpolation. The chosen "
194
 
                               "interpolation type will affect channels "
195
 
                               "and masks only."));
196
 
 
197
 
      gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
198
 
      gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
199
 
      gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
200
 
      gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
201
 
      gtk_widget_show (label);
 
203
      GtkWidget *box = gimp_message_box_new (GIMP_STOCK_INFO);
 
204
 
 
205
      gimp_message_box_set_text (GIMP_MESSAGE_BOX (box),
 
206
                                 _("Indexed color layers are always scaled "
 
207
                                   "without interpolation. The chosen "
 
208
                                   "interpolation type will affect channels "
 
209
                                   "and masks only."));
 
210
 
 
211
      gtk_container_set_border_width (GTK_CONTAINER (box), 0);
 
212
      gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 0);
 
213
      gtk_widget_show (box);
202
214
    }
203
215
 
204
216
  return dialog;