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

« back to all changes in this revision

Viewing changes to app/gui/themes.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 <errno.h>
22
22
#include <stdarg.h>
23
 
#include <stdio.h>
24
23
 
 
24
#include <glib/gstdio.h>
25
25
#include <gtk/gtk.h>
26
26
 
27
27
#include "libgimpbase/gimpbase.h"
 
28
#include "libgimpconfig/gimpconfig.h"
28
29
 
29
30
#include "gui-types.h"
30
31
 
31
 
#include "config/gimpconfig-path.h"
32
32
#include "config/gimpguiconfig.h"
33
33
 
34
34
#include "core/gimp.h"
68
68
  config = GIMP_GUI_CONFIG (gimp->config);
69
69
 
70
70
  themes_hash = g_hash_table_new_full (g_str_hash,
71
 
                                       g_str_equal,
72
 
                                       g_free,
73
 
                                       g_free);
 
71
                                       g_str_equal,
 
72
                                       g_free,
 
73
                                       g_free);
74
74
 
75
75
  if (config->theme_path)
76
76
    {
79
79
      path = gimp_config_path_expand (config->theme_path, TRUE, NULL);
80
80
 
81
81
      gimp_datafiles_read_directories (path,
82
 
                                       G_FILE_TEST_IS_DIR,
83
 
                                       themes_directories_foreach,
84
 
                                       gimp);
 
82
                                       G_FILE_TEST_IS_DIR,
 
83
                                       themes_directories_foreach,
 
84
                                       gimp);
85
85
 
86
86
      g_free (path);
87
87
    }
228
228
  themerc = gimp_personal_rc_file ("themerc");
229
229
 
230
230
  if (gimp->be_verbose)
231
 
    g_print (_("Writing '%s'\n"),
232
 
             gimp_filename_to_utf8 (themerc));
 
231
    g_print ("Writing '%s'\n",
 
232
             gimp_filename_to_utf8 (themerc));
233
233
 
234
 
  file = fopen (themerc, "w");
 
234
  file = g_fopen (themerc, "w");
235
235
 
236
236
  if (! file)
237
237
    {
238
 
      g_message (_("Could not open '%s' for writing: %s"),
239
 
                 gimp_filename_to_utf8 (themerc), g_strerror (errno));
 
238
      gimp_message (gimp, NULL, GIMP_MESSAGE_ERROR,
 
239
                    _("Could not open '%s' for writing: %s"),
 
240
                    gimp_filename_to_utf8 (themerc), g_strerror (errno));
240
241
      goto cleanup;
241
242
    }
242
243
 
281
282
  Gimp *gimp = GIMP (user_data);
282
283
 
283
284
  if (gimp->be_verbose)
284
 
    g_print (_("Adding theme '%s' (%s)\n"),
 
285
    g_print ("Adding theme '%s' (%s)\n",
285
286
             gimp_filename_to_utf8 (file_data->basename),
286
 
             gimp_filename_to_utf8 (file_data->filename));
 
287
             gimp_filename_to_utf8 (file_data->filename));
287
288
 
288
289
  g_hash_table_insert (themes_hash,
289
 
                       g_strdup (file_data->basename),
290
 
                       g_strdup (file_data->filename));
 
290
                       g_strdup (file_data->basename),
 
291
                       g_strdup (file_data->filename));
291
292
}
292
293
 
293
294
static void