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

« back to all changes in this revision

Viewing changes to app/dialogs/template-options-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
20
20
 
21
21
#include <gtk/gtk.h>
22
22
 
 
23
#include "libgimpconfig/gimpconfig.h"
23
24
#include "libgimpwidgets/gimpwidgets.h"
24
25
 
25
26
#include "dialogs-types.h"
26
27
 
27
 
#include "config/gimpconfig.h"
28
28
#include "config/gimpcoreconfig.h"
29
29
 
30
30
#include "core/gimp.h"
 
31
#include "core/gimpcontext.h"
31
32
#include "core/gimptemplate.h"
32
33
 
33
34
#include "widgets/gimptemplateeditor.h"
41
42
/*  public functions */
42
43
 
43
44
TemplateOptionsDialog *
44
 
template_options_dialog_new (Gimp         *gimp,
45
 
                             GimpTemplate *template,
 
45
template_options_dialog_new (GimpTemplate *template,
 
46
                             GimpContext  *context,
46
47
                             GtkWidget    *parent,
47
48
                             const gchar  *title,
48
49
                             const gchar  *role,
54
55
  GimpViewable          *viewable = NULL;
55
56
  GtkWidget             *vbox;
56
57
 
57
 
  g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
58
58
  g_return_val_if_fail (template == NULL || GIMP_IS_TEMPLATE (template), NULL);
 
59
  g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
59
60
  g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
60
61
  g_return_val_if_fail (title != NULL, NULL);
61
62
  g_return_val_if_fail (role != NULL, NULL);
65
66
 
66
67
  options = g_new0 (TemplateOptionsDialog, 1);
67
68
 
68
 
  options->gimp     = gimp;
 
69
  options->gimp     = context->gimp;
69
70
  options->template = template;
70
71
 
71
72
  if (template)
76
77
  else
77
78
    {
78
79
      template =
79
 
        gimp_config_duplicate (GIMP_CONFIG (gimp->config->default_image));
80
 
      gimp_object_set_name (GIMP_OBJECT (template), _("Unnamed"));
 
80
        gimp_config_duplicate (GIMP_CONFIG (options->gimp->config->default_image));
 
81
 
 
82
      gimp_object_set_static_name (GIMP_OBJECT (template), _("Unnamed"));
81
83
    }
82
84
 
83
85
  options->dialog =
84
 
    gimp_viewable_dialog_new (viewable,
 
86
    gimp_viewable_dialog_new (viewable, context,
85
87
                              title, role, stock_id, desc,
86
88
                              parent,
87
89
                              gimp_standard_help_func, help_id,
91
93
 
92
94
                              NULL);
93
95
 
 
96
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (options->dialog),
 
97
                                           GTK_RESPONSE_OK,
 
98
                                           GTK_RESPONSE_CANCEL,
 
99
                                           -1);
 
100
 
94
101
  g_object_weak_ref (G_OBJECT (options->dialog),
95
102
                     (GWeakNotify) g_free, options);
96
103
 
99
106
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->dialog)->vbox), vbox);
100
107
  gtk_widget_show (vbox);
101
108
 
102
 
  options->editor = gimp_template_editor_new (template, gimp, TRUE);
 
109
  options->editor = gimp_template_editor_new (template, options->gimp, TRUE);
103
110
  gtk_box_pack_start (GTK_BOX (vbox), options->editor, FALSE, FALSE, 0);
104
111
  gtk_widget_show (options->editor);
105
112