~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to libgimpwidgets/gimppatheditor.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * gimppatheditor.c
5
5
 * Copyright (C) 1999-2004 Michael Natterer <mitch@gimp.org>
6
6
 *
7
 
 * This library is free software; you can redistribute it and/or
 
7
 * This library is free software: you can redistribute it and/or
8
8
 * modify it under the terms of the GNU Lesser General Public
9
9
 * License as published by the Free Software Foundation; either
10
 
 * version 2 of the License, or (at your option) any later version.
 
10
 * version 3 of the License, or (at your option) any later version.
11
11
 *
12
12
 * This library is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
 * Library General Public License for more details.
16
16
 *
17
17
 * You should have received a copy of the GNU Lesser General Public
18
 
 * License along with this library; if not, write to the
19
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
 * Boston, MA 02111-1307, USA.
 
18
 * License along with this library.  If not, see
 
19
 * <http://www.gnu.org/licenses/>.
21
20
 */
22
21
 
23
22
#include "config.h"
34
33
#include "gimpfileentry.h"
35
34
 
36
35
#include "gimppatheditor.h"
 
36
#include "gimp3migration.h"
37
37
 
38
38
#include "libgimp/libgimp-intl.h"
39
39
 
40
40
 
 
41
/**
 
42
 * SECTION: gimppatheditor
 
43
 * @title: GimpPathEditor
 
44
 * @short_description: Widget for editing a file search path.
 
45
 * @see_also: #GimpFileEntry, #G_SEARCHPATH_SEPARATOR
 
46
 *
 
47
 * This widget is used to edit file search paths.
 
48
 *
 
49
 * It shows a list of all directories which are in the search
 
50
 * path. You can click a directory to select it. The widget provides a
 
51
 * #GimpFileEntry to change the currently selected directory.
 
52
 *
 
53
 * There are buttons to add or delete directories as well as "up" and
 
54
 * "down" buttons to change the order in which the directories will be
 
55
 * searched.
 
56
 *
 
57
 * Whenever the user adds, deletes, changes or reorders a directory of
 
58
 * the search path, the "path_changed" signal will be emitted.
 
59
 **/
 
60
 
 
61
 
41
62
enum
42
63
{
43
64
  PATH_CHANGED,
69
90
                                                   GimpPathEditor      *editor);
70
91
 
71
92
 
72
 
G_DEFINE_TYPE (GimpPathEditor, gimp_path_editor, GTK_TYPE_VBOX)
 
93
G_DEFINE_TYPE (GimpPathEditor, gimp_path_editor, GTK_TYPE_BOX)
73
94
 
74
95
#define parent_class gimp_path_editor_parent_class
75
96
 
129
150
  editor->sel_path   = NULL;
130
151
  editor->num_items  = 0;
131
152
 
132
 
  editor->upper_hbox = gtk_hbox_new (FALSE, 2);
 
153
  gtk_orientable_set_orientation (GTK_ORIENTABLE (editor),
 
154
                                  GTK_ORIENTATION_VERTICAL);
 
155
 
 
156
  editor->upper_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
133
157
  gtk_box_pack_start (GTK_BOX (editor), editor->upper_hbox, FALSE, TRUE, 0);
134
158
  gtk_widget_show (editor->upper_hbox);
135
159
 
136
 
  button_box = gtk_hbox_new (TRUE, 0);
 
160
  button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 
161
  gtk_box_set_homogeneous (GTK_BOX (button_box), TRUE);
137
162
  gtk_box_pack_start (GTK_BOX (editor->upper_hbox), button_box, FALSE, TRUE, 0);
138
163
  gtk_widget_show (button_box);
139
164
 
348
373
 
349
374
  g_free (old_path);
350
375
 
351
 
  path_list = gimp_path_parse (path, 16, TRUE, NULL);
 
376
  path_list = gimp_path_parse (path, 16, FALSE, NULL);
352
377
 
353
378
  gtk_list_store_clear (editor->dir_list);
354
379
 
431
456
 
432
457
  gtk_tree_view_column_set_visible (editor->writable_column, TRUE);
433
458
 
434
 
  path_list = gimp_path_parse (path, 16, TRUE, NULL);
 
459
  path_list = gimp_path_parse (path, 16, FALSE, NULL);
435
460
 
436
461
  model = GTK_TREE_MODEL (editor->dir_list);
437
462