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

« back to all changes in this revision

Viewing changes to app/actions/vectors-commands.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
27
27
#include "actions-types.h"
28
28
 
29
29
#include "core/gimp.h"
 
30
#include "core/gimp-utils.h"
30
31
#include "core/gimpchannel.h"
31
32
#include "core/gimpchannel-select.h"
32
 
#include "core/gimpcontainer.h"
33
33
#include "core/gimpcontext.h"
34
34
#include "core/gimpimage.h"
35
35
#include "core/gimpimage-merge.h"
36
36
#include "core/gimpimage-undo.h"
37
37
#include "core/gimpitemundo.h"
 
38
#include "core/gimpparamspecs.h"
38
39
#include "core/gimpprogress.h"
39
40
#include "core/gimpstrokedesc.h"
40
41
#include "core/gimptoolinfo.h"
41
42
 
42
 
#include "pdb/procedural_db.h"
43
 
 
44
 
#include "plug-in/plug-in-run.h"
 
43
#include "pdb/gimppdb.h"
 
44
#include "pdb/gimpprocedure.h"
45
45
 
46
46
#include "vectors/gimpvectors.h"
47
47
#include "vectors/gimpvectors-export.h"
48
48
#include "vectors/gimpvectors-import.h"
49
49
 
50
50
#include "widgets/gimpaction.h"
 
51
#include "widgets/gimpclipboard.h"
51
52
#include "widgets/gimphelp-ids.h"
52
53
 
53
54
#include "display/gimpdisplay.h"
96
97
vectors_vectors_tool_cmd_callback (GtkAction *action,
97
98
                                   gpointer   data)
98
99
{
99
 
  GimpImage   *gimage;
 
100
  GimpImage   *image;
100
101
  GimpVectors *vectors;
101
102
  GimpTool    *active_tool;
102
 
  return_if_no_vectors (gimage, vectors, data);
 
103
  return_if_no_vectors (image, vectors, data);
103
104
 
104
 
  active_tool = tool_manager_get_active (gimage->gimp);
 
105
  active_tool = tool_manager_get_active (image->gimp);
105
106
 
106
107
  if (! GIMP_IS_VECTOR_TOOL (active_tool))
107
108
    {
108
 
      GimpToolInfo  *tool_info;
109
 
 
110
 
      tool_info = (GimpToolInfo *)
111
 
        gimp_container_get_child_by_name (gimage->gimp->tool_info_list,
112
 
                                          "gimp-vector-tool");
 
109
      GimpToolInfo  *tool_info = gimp_get_tool_info (image->gimp,
 
110
                                                     "gimp-vector-tool");
113
111
 
114
112
      if (GIMP_IS_TOOL_INFO (tool_info))
115
113
        {
116
114
          gimp_context_set_tool (action_data_get_context (data), tool_info);
117
 
          active_tool = tool_manager_get_active (gimage->gimp);
 
115
          active_tool = tool_manager_get_active (image->gimp);
118
116
        }
119
117
    }
120
118
 
127
125
                                      gpointer   data)
128
126
{
129
127
  VectorsOptionsDialog *options;
130
 
  GimpImage            *gimage;
 
128
  GimpImage            *image;
131
129
  GimpVectors          *vectors;
132
130
  GtkWidget            *widget;
133
 
  return_if_no_vectors (gimage, vectors, data);
 
131
  return_if_no_vectors (image, vectors, data);
134
132
  return_if_no_widget (widget, data);
135
133
 
136
 
  options = vectors_options_dialog_new (gimage,
137
 
                                        vectors,
 
134
  options = vectors_options_dialog_new (image, vectors,
 
135
                                        action_data_get_context (data),
138
136
                                        widget,
139
137
                                        gimp_object_get_name (GIMP_OBJECT (vectors)),
140
138
                                        _("Path Attributes"),
141
139
                                        "gimp-vectors-edit",
142
 
                                        GIMP_STOCK_EDIT,
 
140
                                        GTK_STOCK_EDIT,
143
141
                                        _("Edit Path Attributes"),
144
142
                                        GIMP_HELP_PATH_EDIT);
145
143
 
155
153
                          gpointer   data)
156
154
{
157
155
  VectorsOptionsDialog *options;
158
 
  GimpImage            *gimage;
 
156
  GimpImage            *image;
159
157
  GtkWidget            *widget;
160
 
  return_if_no_image (gimage, data);
 
158
  return_if_no_image (image, data);
161
159
  return_if_no_widget (widget, data);
162
160
 
163
 
  options = vectors_options_dialog_new (gimage,
164
 
                                        NULL,
 
161
  options = vectors_options_dialog_new (image, NULL,
 
162
                                        action_data_get_context (data),
165
163
                                        widget,
166
164
                                        vectors_name ? vectors_name :
167
165
                                        _("New Path"),
182
180
vectors_new_last_vals_cmd_callback (GtkAction *action,
183
181
                                    gpointer   data)
184
182
{
185
 
  GimpImage   *gimage;
 
183
  GimpImage   *image;
186
184
  GimpVectors *new_vectors;
187
 
  return_if_no_image (gimage, data);
 
185
  return_if_no_image (image, data);
188
186
 
189
 
  new_vectors = gimp_vectors_new (gimage,
 
187
  new_vectors = gimp_vectors_new (image,
190
188
                                  vectors_name ? vectors_name : _("New Path"));
191
189
 
192
 
  gimp_image_add_vectors (gimage, new_vectors, -1);
 
190
  gimp_image_add_vectors (image, new_vectors, -1);
193
191
 
194
 
  gimp_image_flush (gimage);
 
192
  gimp_image_flush (image);
195
193
}
196
194
 
197
195
void
198
196
vectors_raise_cmd_callback (GtkAction *action,
199
197
                            gpointer   data)
200
198
{
201
 
  GimpImage   *gimage;
 
199
  GimpImage   *image;
202
200
  GimpVectors *vectors;
203
 
  return_if_no_vectors (gimage, vectors, data);
 
201
  return_if_no_vectors (image, vectors, data);
204
202
 
205
 
  gimp_image_raise_vectors (gimage, vectors);
206
 
  gimp_image_flush (gimage);
 
203
  gimp_image_raise_vectors (image, vectors);
 
204
  gimp_image_flush (image);
207
205
}
208
206
 
209
207
void
210
208
vectors_raise_to_top_cmd_callback (GtkAction *action,
211
209
                                   gpointer   data)
212
210
{
213
 
  GimpImage   *gimage;
 
211
  GimpImage   *image;
214
212
  GimpVectors *vectors;
215
 
  return_if_no_vectors (gimage, vectors, data);
 
213
  return_if_no_vectors (image, vectors, data);
216
214
 
217
 
  gimp_image_raise_vectors_to_top (gimage, vectors);
218
 
  gimp_image_flush (gimage);
 
215
  gimp_image_raise_vectors_to_top (image, vectors);
 
216
  gimp_image_flush (image);
219
217
}
220
218
 
221
219
void
222
220
vectors_lower_cmd_callback (GtkAction *action,
223
221
                            gpointer   data)
224
222
{
225
 
  GimpImage   *gimage;
 
223
  GimpImage   *image;
226
224
  GimpVectors *vectors;
227
 
  return_if_no_vectors (gimage, vectors, data);
 
225
  return_if_no_vectors (image, vectors, data);
228
226
 
229
 
  gimp_image_lower_vectors (gimage, vectors);
230
 
  gimp_image_flush (gimage);
 
227
  gimp_image_lower_vectors (image, vectors);
 
228
  gimp_image_flush (image);
231
229
}
232
230
 
233
231
void
234
232
vectors_lower_to_bottom_cmd_callback (GtkAction *action,
235
233
                                      gpointer   data)
236
234
{
237
 
  GimpImage   *gimage;
 
235
  GimpImage   *image;
238
236
  GimpVectors *vectors;
239
 
  return_if_no_vectors (gimage, vectors, data);
 
237
  return_if_no_vectors (image, vectors, data);
240
238
 
241
 
  gimp_image_lower_vectors_to_bottom (gimage, vectors);
242
 
  gimp_image_flush (gimage);
 
239
  gimp_image_lower_vectors_to_bottom (image, vectors);
 
240
  gimp_image_flush (image);
243
241
}
244
242
 
245
243
void
246
244
vectors_duplicate_cmd_callback (GtkAction *action,
247
245
                                gpointer   data)
248
246
{
249
 
  GimpImage   *gimage;
 
247
  GimpImage   *image;
250
248
  GimpVectors *vectors;
251
249
  GimpVectors *new_vectors;
252
 
  return_if_no_vectors (gimage, vectors, data);
 
250
  return_if_no_vectors (image, vectors, data);
253
251
 
254
252
  new_vectors =
255
253
    GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
256
254
                                       G_TYPE_FROM_INSTANCE (vectors),
257
255
                                       TRUE));
258
 
  gimp_image_add_vectors (gimage, new_vectors, -1);
259
 
  gimp_image_flush (gimage);
 
256
  gimp_image_add_vectors (image, new_vectors, -1);
 
257
  gimp_image_flush (image);
260
258
}
261
259
 
262
260
void
263
261
vectors_delete_cmd_callback (GtkAction *action,
264
262
                             gpointer   data)
265
263
{
266
 
  GimpImage   *gimage;
 
264
  GimpImage   *image;
267
265
  GimpVectors *vectors;
268
 
  return_if_no_vectors (gimage, vectors, data);
 
266
  return_if_no_vectors (image, vectors, data);
269
267
 
270
 
  gimp_image_remove_vectors (gimage, vectors);
271
 
  gimp_image_flush (gimage);
 
268
  gimp_image_remove_vectors (image, vectors);
 
269
  gimp_image_flush (image);
272
270
}
273
271
 
274
272
void
275
273
vectors_merge_visible_cmd_callback (GtkAction *action,
276
274
                                    gpointer   data)
277
275
{
278
 
  GimpImage   *gimage;
 
276
  GimpImage   *image;
279
277
  GimpVectors *vectors;
280
 
  return_if_no_vectors (gimage, vectors, data);
 
278
  return_if_no_vectors (image, vectors, data);
281
279
 
282
 
  gimp_image_merge_visible_vectors (gimage);
283
 
  gimp_image_flush (gimage);
 
280
  gimp_image_merge_visible_vectors (image);
 
281
  gimp_image_flush (image);
284
282
}
285
283
 
286
284
void
289
287
                                   gpointer   data)
290
288
{
291
289
  GimpChannelOps  op;
292
 
  GimpImage      *gimage;
 
290
  GimpImage      *image;
293
291
  GimpVectors    *vectors;
294
 
  return_if_no_vectors (gimage, vectors, data);
 
292
  return_if_no_vectors (image, vectors, data);
295
293
 
296
294
  op = (GimpChannelOps) value;
297
295
 
298
 
  gimp_channel_select_vectors (gimp_image_get_mask (gimage),
 
296
  gimp_channel_select_vectors (gimp_image_get_mask (image),
299
297
                               _("Path to Selection"),
300
298
                               vectors,
301
 
                               op, TRUE, FALSE, 0, 0);
302
 
  gimp_image_flush (gimage);
 
299
                               op, TRUE, FALSE, 0, 0, TRUE);
 
300
  gimp_image_flush (image);
303
301
}
304
302
 
305
303
void
307
305
                                           gint       value,
308
306
                                           gpointer   data)
309
307
{
310
 
  GimpImage   *gimage;
311
 
  ProcRecord  *proc_rec;
312
 
  Argument    *args;
313
 
  GimpDisplay *gdisp;
314
 
  return_if_no_image (gimage, data);
 
308
  GimpImage     *image;
 
309
  GtkWidget     *widget;
 
310
  GimpProcedure *procedure;
 
311
  GValueArray   *args;
 
312
  GimpDisplay   *display;
 
313
  return_if_no_image (image, data);
 
314
  return_if_no_widget (widget, data);
315
315
 
316
316
  if (value)
317
 
    proc_rec = procedural_db_lookup (gimage->gimp,
318
 
                                     "plug_in_sel2path_advanced");
 
317
    procedure = gimp_pdb_lookup_procedure (image->gimp->pdb,
 
318
                                           "plug-in-sel2path-advanced");
319
319
  else
320
 
    proc_rec = procedural_db_lookup (gimage->gimp,
321
 
                                     "plug_in_sel2path");
 
320
    procedure = gimp_pdb_lookup_procedure (image->gimp->pdb,
 
321
                                           "plug-in-sel2path");
322
322
 
323
 
  if (! proc_rec)
 
323
  if (! procedure)
324
324
    {
325
 
      g_message ("Selection to path procedure lookup failed.");
 
325
      gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_ERROR,
 
326
                    "Selection to path procedure lookup failed.");
326
327
      return;
327
328
    }
328
329
 
329
 
  gdisp = gimp_context_get_display (action_data_get_context (data));
330
 
 
331
 
  /*  plug-in arguments as if called by <Image>/Filters/...  */
332
 
  args = g_new (Argument, 3);
333
 
 
334
 
  args[0].arg_type      = GIMP_PDB_INT32;
335
 
  args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
336
 
  args[1].arg_type      = GIMP_PDB_IMAGE;
337
 
  args[1].value.pdb_int = (gint32) gimp_image_get_ID (gimage);
338
 
  args[2].arg_type      = GIMP_PDB_DRAWABLE;
339
 
  args[2].value.pdb_int = -1;  /*  unused  */
340
 
 
341
 
  plug_in_run (gimage->gimp, action_data_get_context (data),
342
 
               gdisp ? GIMP_PROGRESS (gdisp) : NULL,
343
 
               proc_rec, args, 3, FALSE, TRUE,
344
 
               gdisp ? gimp_display_get_ID (gdisp) : 0);
345
 
 
346
 
  g_free (args);
 
330
  display = gimp_context_get_display (action_data_get_context (data));
 
331
 
 
332
  args = gimp_procedure_get_arguments (procedure);
 
333
  gimp_value_array_truncate (args, 2);
 
334
 
 
335
  g_value_set_int      (&args->values[0], GIMP_RUN_INTERACTIVE);
 
336
  gimp_value_set_image (&args->values[1], image);
 
337
 
 
338
  gimp_procedure_execute_async (procedure, image->gimp,
 
339
                                action_data_get_context (data),
 
340
                                GIMP_PROGRESS (display), args,
 
341
                                GIMP_OBJECT (display));
 
342
 
 
343
  g_value_array_free (args);
347
344
}
348
345
 
349
346
void
350
347
vectors_stroke_cmd_callback (GtkAction *action,
351
348
                             gpointer   data)
352
349
{
353
 
  GimpImage    *gimage;
 
350
  GimpImage    *image;
354
351
  GimpVectors  *vectors;
355
352
  GimpDrawable *drawable;
356
353
  GtkWidget    *widget;
357
354
  GtkWidget    *dialog;
358
 
  return_if_no_vectors (gimage, vectors, data);
 
355
  return_if_no_vectors (image, vectors, data);
359
356
  return_if_no_widget (widget, data);
360
357
 
361
 
  drawable = gimp_image_active_drawable (gimage);
 
358
  drawable = gimp_image_active_drawable (image);
362
359
 
363
360
  if (! drawable)
364
361
    {
365
 
      g_message (_("There is no active layer or channel to stroke to."));
 
362
      gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
 
363
                    _("There is no active layer or channel to stroke to."));
366
364
      return;
367
365
    }
368
366
 
369
367
  dialog = stroke_dialog_new (GIMP_ITEM (vectors),
 
368
                              action_data_get_context (data),
370
369
                              _("Stroke Path"),
371
370
                              GIMP_STOCK_PATH_STROKE,
372
371
                              GIMP_HELP_PATH_STROKE,
382
381
  GimpVectors    *vectors;
383
382
  GimpDrawable   *drawable;
384
383
  GimpContext    *context;
 
384
  GtkWidget      *widget;
385
385
  GimpStrokeDesc *desc;
386
386
  return_if_no_vectors (image, vectors, data);
 
387
  return_if_no_context (context, data);
 
388
  return_if_no_widget (widget, data);
387
389
 
388
390
  drawable = gimp_image_active_drawable (image);
389
391
 
390
392
  if (! drawable)
391
393
    {
392
 
      g_message (_("There is no active layer or channel to stroke to."));
 
394
      gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
 
395
                    _("There is no active layer or channel to stroke to."));
393
396
      return;
394
397
    }
395
398
 
396
 
  context = gimp_get_user_context (image->gimp);
397
399
 
398
 
  desc = g_object_get_data (G_OBJECT (context), "saved-stroke-desc");
 
400
  desc = g_object_get_data (G_OBJECT (image->gimp), "saved-stroke-desc");
399
401
 
400
402
  if (desc)
401
403
    g_object_ref (desc);
413
415
vectors_copy_cmd_callback (GtkAction *action,
414
416
                           gpointer   data)
415
417
{
416
 
  GimpImage   *gimage;
 
418
  GimpImage   *image;
417
419
  GimpVectors *vectors;
418
 
  return_if_no_vectors (gimage, vectors, data);
419
 
 
420
 
#ifdef __GNUC__
421
 
#warning FIXME: need vectors clipboard
422
 
#endif
 
420
  gchar       *svg;
 
421
  return_if_no_vectors (image, vectors, data);
 
422
 
 
423
  svg = gimp_vectors_export_string (image, vectors);
 
424
 
 
425
  if (svg)
 
426
    {
 
427
      gimp_clipboard_set_svg (image->gimp, svg);
 
428
      g_free (svg);
 
429
    }
423
430
}
424
431
 
425
432
void
426
433
vectors_paste_cmd_callback (GtkAction *action,
427
434
                            gpointer   data)
428
435
{
429
 
  GimpImage *gimage;
430
 
  return_if_no_image (gimage, data);
431
 
 
432
 
#ifdef __GNUC__
433
 
#warning FIXME: need vectors clipboard
434
 
#endif
 
436
  GimpImage *image;
 
437
  GtkWidget *widget;
 
438
  gchar     *svg;
 
439
  gsize      svg_size;
 
440
  return_if_no_image (image, data);
 
441
  return_if_no_widget (widget, data);
 
442
 
 
443
  svg = gimp_clipboard_get_svg (image->gimp, &svg_size);
 
444
 
 
445
  if (svg)
 
446
    {
 
447
      GError *error = NULL;
 
448
 
 
449
      if (! gimp_vectors_import_buffer (image, svg, svg_size,
 
450
                                        TRUE, TRUE, -1, NULL, &error))
 
451
        {
 
452
          gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_ERROR,
 
453
                        "%s", error->message);
 
454
          g_clear_error (&error);
 
455
        }
 
456
      else
 
457
        {
 
458
          gimp_image_flush (image);
 
459
        }
 
460
 
 
461
      g_free (svg);
 
462
    }
 
463
}
 
464
 
 
465
void
 
466
vectors_export_cmd_callback (GtkAction *action,
 
467
                             gpointer   data)
 
468
{
 
469
  VectorsExportDialog *dialog;
 
470
  GimpImage           *image;
 
471
  GimpVectors         *vectors;
 
472
  GtkWidget           *widget;
 
473
  return_if_no_vectors (image, vectors, data);
 
474
  return_if_no_widget (widget, data);
 
475
 
 
476
  dialog = vectors_export_dialog_new (image, widget,
 
477
                                      vectors_export_active_only);
 
478
 
 
479
  g_signal_connect (dialog->dialog, "response",
 
480
                    G_CALLBACK (vectors_export_response),
 
481
                    dialog);
 
482
 
 
483
  gtk_widget_show (dialog->dialog);
435
484
}
436
485
 
437
486
void
439
488
                             gpointer   data)
440
489
{
441
490
  VectorsImportDialog *dialog;
442
 
  GimpImage           *gimage;
 
491
  GimpImage           *image;
443
492
  GtkWidget           *widget;
444
 
  return_if_no_image (gimage, data);
 
493
  return_if_no_image (image, data);
445
494
  return_if_no_widget (widget, data);
446
495
 
447
 
  dialog = vectors_import_dialog_new (gimage, widget,
 
496
  dialog = vectors_import_dialog_new (image, widget,
448
497
                                      vectors_import_merge,
449
498
                                      vectors_import_scale);
450
499
 
456
505
}
457
506
 
458
507
void
459
 
vectors_export_cmd_callback (GtkAction *action,
460
 
                             gpointer   data)
461
 
{
462
 
  VectorsExportDialog *dialog;
463
 
  GimpImage           *gimage;
464
 
  GimpVectors         *vectors;
465
 
  GtkWidget           *widget;
466
 
  return_if_no_vectors (gimage, vectors, data);
467
 
  return_if_no_widget (widget, data);
468
 
 
469
 
  dialog = vectors_export_dialog_new (gimage, widget,
470
 
                                      vectors_export_active_only);
471
 
 
472
 
  g_signal_connect (dialog->dialog, "response",
473
 
                    G_CALLBACK (vectors_export_response),
474
 
                    dialog);
475
 
 
476
 
  gtk_widget_show (dialog->dialog);
477
 
}
478
 
 
479
 
void
480
508
vectors_visible_cmd_callback (GtkAction *action,
481
509
                              gpointer   data)
482
510
{
483
 
  GimpImage   *gimage;
 
511
  GimpImage   *image;
484
512
  GimpVectors *vectors;
485
513
  gboolean     visible;
486
 
  return_if_no_vectors (gimage, vectors, data);
 
514
  return_if_no_vectors (image, vectors, data);
487
515
 
488
516
  visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
489
517
 
492
520
      GimpUndo *undo;
493
521
      gboolean  push_undo = TRUE;
494
522
 
495
 
      undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
 
523
      undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
496
524
                                           GIMP_UNDO_ITEM_VISIBILITY);
497
525
 
498
526
      if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (vectors))
499
527
        push_undo = FALSE;
500
528
 
501
529
      gimp_item_set_visible (GIMP_ITEM (vectors), visible, push_undo);
502
 
      gimp_image_flush (gimage);
 
530
      gimp_image_flush (image);
503
531
    }
504
532
}
505
533
 
507
535
vectors_linked_cmd_callback (GtkAction *action,
508
536
                             gpointer   data)
509
537
{
510
 
  GimpImage   *gimage;
 
538
  GimpImage   *image;
511
539
  GimpVectors *vectors;
512
540
  gboolean     linked;
513
 
  return_if_no_vectors (gimage, vectors, data);
 
541
  return_if_no_vectors (image, vectors, data);
514
542
 
515
543
  linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
516
544
 
519
547
      GimpUndo *undo;
520
548
      gboolean  push_undo = TRUE;
521
549
 
522
 
      undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
 
550
      undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
523
551
                                           GIMP_UNDO_ITEM_LINKED);
524
552
 
525
553
      if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (vectors))
526
554
        push_undo = FALSE;
527
555
 
528
556
      gimp_item_set_linked (GIMP_ITEM (vectors), linked, push_undo);
529
 
      gimp_image_flush (gimage);
 
557
      gimp_image_flush (image);
530
558
    }
531
559
}
532
560
 
548
576
      vectors_name =
549
577
        g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
550
578
 
551
 
      new_vectors = gimp_vectors_new (options->gimage, vectors_name);
552
 
 
553
 
      gimp_image_add_vectors (options->gimage, new_vectors, -1);
554
 
 
555
 
      gimp_image_flush (options->gimage);
 
579
      new_vectors = gimp_vectors_new (options->image, vectors_name);
 
580
 
 
581
      gimp_image_add_vectors (options->image, new_vectors, -1);
 
582
 
 
583
      gimp_image_flush (options->image);
556
584
    }
557
585
 
558
586
  gtk_widget_destroy (options->dialog);
573
601
      if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (vectors))))
574
602
        {
575
603
          gimp_item_rename (GIMP_ITEM (vectors), new_name);
576
 
          gimp_image_flush (options->gimage);
 
604
          gimp_image_flush (options->image);
577
605
        }
578
606
    }
579
607
 
597
625
 
598
626
      if (gimp_vectors_import_file (dialog->image, filename,
599
627
                                    vectors_import_merge, vectors_import_scale,
600
 
                                    -1, &error))
 
628
                                    -1, NULL, &error))
601
629
        {
602
630
          gimp_image_flush (dialog->image);
603
631
        }
604
632
      else
605
633
        {
606
 
          g_message (error->message);
 
634
          gimp_message (dialog->image->gimp, G_OBJECT (widget),
 
635
                        GIMP_MESSAGE_ERROR,
 
636
                        "%s", error->message);
607
637
          g_error_free (error);
 
638
          return;
608
639
        }
609
640
 
610
641
      g_free (filename);
633
664
 
634
665
      if (! gimp_vectors_export_file (dialog->image, vectors, filename, &error))
635
666
        {
636
 
          g_message (error->message);
 
667
          gimp_message (dialog->image->gimp, G_OBJECT (widget),
 
668
                        GIMP_MESSAGE_ERROR,
 
669
                        "%s", error->message);
637
670
          g_error_free (error);
 
671
          return;
638
672
        }
639
673
 
640
674
      g_free (filename);