1
1
/* GIMP - The GNU Image Manipulation Program
2
2
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
4
* This program is free software: you can redistribute it and/or modify
5
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
6
* the Free Software Foundation; either version 3 of the License, or
7
7
* (at your option) any later version.
9
9
* This program is distributed in the hope that it will be useful,
12
12
* GNU General Public License for more details.
14
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
18
#include "config.h"
39
38
#include "widgets/gimpcontainercombobox.h"
40
39
#include "widgets/gimpcontainerview.h"
41
40
#include "widgets/gimpcontrollerlist.h"
42
#include "widgets/gimpdeviceinfo.h"
43
41
#include "widgets/gimpdevices.h"
44
42
#include "widgets/gimpdialogfactory.h"
45
43
#include "widgets/gimpgrideditor.h"
50
48
#include "widgets/gimpprofilechooserdialog.h"
51
49
#include "widgets/gimppropwidgets.h"
52
50
#include "widgets/gimptemplateeditor.h"
51
#include "widgets/gimptooleditor.h"
53
52
#include "widgets/gimpwidgets-constructors.h"
54
53
#include "widgets/gimpwidgets-utils.h"
100
99
GtkWidget *entry);
101
100
static void prefs_input_devices_dialog (GtkWidget *widget,
103
static void prefs_input_dialog_able_callback (GtkWidget *widget,
102
static void prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
106
104
static void prefs_menus_save_callback (GtkWidget *widget,
108
106
static void prefs_menus_clear_callback (GtkWidget *widget,
488
489
prefs_input_devices_dialog (GtkWidget *widget,
491
static GtkWidget *input_dialog = NULL;
495
gtk_window_present (GTK_WINDOW (input_dialog));
499
input_dialog = g_object_new (GTK_TYPE_INPUT_DIALOG,
500
"title", _("Configure Input Devices"),
503
g_object_add_weak_pointer (G_OBJECT (input_dialog),
504
(gpointer) &input_dialog);
506
gtk_window_set_transient_for (GTK_WINDOW (input_dialog),
507
GTK_WINDOW (prefs_dialog));
508
gtk_window_set_destroy_with_parent (GTK_WINDOW (input_dialog), TRUE);
510
g_signal_connect_swapped (GTK_INPUT_DIALOG (input_dialog)->save_button,
512
G_CALLBACK (gimp_devices_save),
515
g_signal_connect_swapped (GTK_INPUT_DIALOG (input_dialog)->close_button,
517
G_CALLBACK (gtk_widget_destroy),
520
g_signal_connect (input_dialog, "enable-device",
521
G_CALLBACK (prefs_input_dialog_able_callback),
523
g_signal_connect (input_dialog, "disable-device",
524
G_CALLBACK (prefs_input_dialog_able_callback),
527
gtk_widget_show (input_dialog);
531
prefs_input_dialog_able_callback (GtkWidget *widget,
535
gimp_device_info_changed_by_device (device);
492
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
493
gtk_widget_get_screen (widget),
494
"gimp-input-devices-dialog", 0);
539
498
prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
542
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_from_name ("toplevel"),
501
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
543
502
gtk_widget_get_screen (widget),
544
503
"gimp-keyboard-shortcuts-dialog", 0);
748
707
gimp_help_set_help_data (event_box, NULL, help_id);
750
vbox = gtk_vbox_new (FALSE, 12);
709
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
751
710
gtk_container_add (GTK_CONTAINER (event_box), vbox);
752
711
gtk_widget_show (vbox);
946
905
frame = gimp_frame_new (label);
948
vbox = gtk_vbox_new (FALSE, 6);
907
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
949
908
gtk_container_add (GTK_CONTAINER (frame), vbox);
950
909
gtk_widget_show (vbox);
1124
hbox = gtk_hbox_new (FALSE, 6);
1083
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
1125
1084
gtk_box_pack_start (vbox, hbox, FALSE, FALSE, 0);
1126
1085
gtk_widget_show (hbox);
1177
#ifdef HAVE_ISO_CODES
1179
prefs_language_combo_box_add (GObject *config,
1180
const gchar *property_name,
1183
GtkWidget *combo = gimp_prop_language_combo_box_new (config, property_name);
1187
gtk_box_pack_start (vbox, combo, FALSE, FALSE, 0);
1188
gtk_widget_show (combo);
1218
1195
static GtkWidget *
1219
1196
prefs_spin_button_add (GObject *config,
1220
1197
const gchar *property_name,
1277
1254
vbox = prefs_frame_new (label, parent, FALSE);
1279
hbox = gtk_hbox_new (FALSE, 6);
1256
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
1280
1257
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
1281
1258
gtk_widget_show (hbox);
1283
checks_vbox = gtk_vbox_new (FALSE, 2);
1260
checks_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
1284
1261
gtk_box_pack_start (GTK_BOX (hbox), checks_vbox, TRUE, TRUE, 0);
1285
1262
gtk_widget_show (checks_vbox);
1299
1276
_("Show s_tatusbar"),
1300
1277
GTK_BOX (checks_vbox));
1302
checks_vbox = gtk_vbox_new (FALSE, 2);
1279
checks_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
1303
1280
gtk_box_pack_start (GTK_BOX (hbox), checks_vbox, TRUE, TRUE, 0);
1304
1281
gtk_widget_show (checks_vbox);
1414
1391
core_config = GIMP_CORE_CONFIG (config);
1415
1392
display_config = GIMP_DISPLAY_CONFIG (config);
1417
dialog = gimp_dialog_new (_("Preferences"), "preferences",
1394
dialog = gimp_dialog_new (_("Preferences"), "gimp-preferences",
1419
1396
prefs_help_func,
1420
1397
GIMP_HELP_PREFS_DIALOG,
1438
1415
/* The main hbox */
1439
hbox = gtk_hbox_new (FALSE, 12);
1416
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
1440
1417
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
1441
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
1418
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
1419
hbox, TRUE, TRUE, 0);
1442
1420
gtk_widget_show (hbox);
1444
1422
/* The categories tree */
1473
1451
gtk_container_add (GTK_CONTAINER (frame), tv);
1475
vbox = gtk_vbox_new (FALSE, 12);
1453
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
1476
1454
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
1477
1455
gtk_widget_show (vbox);
1481
1459
gtk_box_pack_start (GTK_BOX (vbox), ebox, FALSE, TRUE, 0);
1482
1460
gtk_widget_show (ebox);
1484
hbox = gtk_hbox_new (FALSE, 6);
1462
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
1485
1463
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
1486
1464
gtk_container_add (GTK_CONTAINER (ebox), hbox);
1487
1465
gtk_widget_show (hbox);
1596
/* Only add the language entry if the iso-codes package is available. */
1597
#ifdef HAVE_ISO_CODES
1598
vbox2 = prefs_frame_new (_("Language"), GTK_CONTAINER (vbox), FALSE);
1600
prefs_language_combo_box_add (object, "language", GTK_BOX (vbox2));
1617
1604
vbox2 = prefs_frame_new (_("Previews"), GTK_CONTAINER (vbox), FALSE);
1633
1620
vbox2 = prefs_frame_new (_("Keyboard Shortcuts"),
1634
1621
GTK_CONTAINER (vbox), FALSE);
1636
prefs_check_button_add (object, "menu-mnemonics",
1637
_("Show menu _mnemonics (access keys)"),
1639
1623
prefs_check_button_add (object, "can-change-accels",
1640
1624
_("_Use dynamic keyboard shortcuts"),
1641
1625
GTK_BOX (vbox2));
1769
hbox = gtk_hbox_new (FALSE, 6);
1753
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
1770
1754
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1771
1755
gtk_widget_show (hbox);
1831
1815
text = _("The user manual is not installed locally.");
1834
hbox = gtk_hbox_new (FALSE, 6);
1818
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
1835
1819
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, 1, 2);
1836
1820
gtk_widget_show (hbox);
1858
1842
_("H_elp browser to use:"),
1859
1843
GTK_TABLE (table), 0, size_group);
1861
/* Web Browser (unused on win32) */
1863
vbox2 = prefs_frame_new (_("Web Browser"), GTK_CONTAINER (vbox), FALSE);
1864
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
1866
prefs_widget_add_aligned (gimp_prop_entry_new (object, "web-browser", 0),
1867
_("_Web browser to use:"),
1868
GTK_TABLE (table), 0, FALSE, size_group);
1871
1845
g_object_unref (size_group);
1872
1846
size_group = NULL;
1939
1913
prefs_check_button_add_with_icon (object, "global-brush",
1940
1914
_("_Brush"), GIMP_STOCK_BRUSH,
1941
1915
GTK_BOX (vbox2), size_group);
1916
prefs_check_button_add_with_icon (object, "global-dynamics",
1917
_("_Dynamics"), GIMP_STOCK_DYNAMICS,
1918
GTK_BOX (vbox2), size_group);
1942
1919
prefs_check_button_add_with_icon (object, "global-pattern",
1943
1920
_("_Pattern"), GIMP_STOCK_PATTERN,
1944
1921
GTK_BOX (vbox2), size_group);
1946
1923
_("_Gradient"), GIMP_STOCK_GRADIENT,
1947
1924
GTK_BOX (vbox2), size_group);
1949
1927
vbox2 = prefs_frame_new (_("Move Tool"),
1950
1928
GTK_CONTAINER (vbox), FALSE);
1994
1972
g_object_unref (size_group);
1995
1973
size_group = NULL;
1976
vbox2 = prefs_frame_new (_("Tools configuration"),
1977
GTK_CONTAINER (vbox), TRUE);
1978
tool_editor = gimp_tool_editor_new (gimp->tool_info_list, gimp->user_context,
1979
gimp_tools_get_default_order (gimp),
1980
GIMP_VIEW_SIZE_SMALL, 1);
1982
gtk_box_pack_start (GTK_BOX (vbox2), tool_editor, TRUE, TRUE, 0);
1983
gtk_widget_show (tool_editor);
1998
1986
/***********************/
1999
1987
/* Default New Image */
2033
2021
gtk_box_pack_start (GTK_BOX (vbox), editor, FALSE, FALSE, 0);
2034
2022
gtk_widget_show (editor);
2024
/* Quick Mask Color */
2025
vbox2 = prefs_frame_new (_("Quick Mask"), GTK_CONTAINER (vbox), FALSE);
2026
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
2027
button = gimp_prop_color_button_new (object, "quick-mask-color",
2028
_("Set the default Quick Mask color"),
2030
COLOR_BUTTON_HEIGHT,
2031
GIMP_COLOR_AREA_SMALL_CHECKS);
2032
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
2033
gimp_get_user_context (gimp));
2034
prefs_widget_add_aligned (button, _("Quick Mask color:"),
2035
GTK_TABLE (table), 0, TRUE, NULL);
2038
2039
/******************/
2053
2054
editor = gimp_grid_editor_new (core_config->default_grid,
2054
2055
gimp_get_user_context (gimp),
2055
core_config->default_image->xresolution,
2056
core_config->default_image->yresolution);
2058
gtk_container_add (GTK_CONTAINER (vbox), editor);
2056
gimp_template_get_resolution_x (core_config->default_image),
2057
gimp_template_get_resolution_y (core_config->default_image));
2058
gtk_box_pack_start (GTK_BOX (vbox), editor, TRUE, TRUE, 0);
2059
2059
gtk_widget_show (editor);
2128
2128
_("Show pointer for paint _tools"),
2129
2129
GTK_BOX (vbox2));
2131
table = prefs_table_new (2, GTK_CONTAINER (vbox2));
2131
table = prefs_table_new (3, GTK_CONTAINER (vbox2));
2133
2133
prefs_enum_combo_box_add (object, "cursor-mode", 0, 0,
2134
2134
_("Pointer _mode:"),
2136
2136
prefs_enum_combo_box_add (object, "cursor-format", 0, 0,
2137
2137
_("Pointer re_ndering:"),
2138
2138
GTK_TABLE (table), 1, size_group);
2139
prefs_enum_combo_box_add (object, "cursor-handedness", 0, 0,
2140
_("Pointer _handedness:"),
2141
GTK_TABLE (table), 2, NULL);
2140
2143
g_object_unref (size_group);
2141
2144
size_group = NULL;
2346
2349
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
2347
2350
_("ppi"), 1, 4, 0.0);
2349
hbox = gtk_hbox_new (FALSE, 0);
2352
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
2351
2354
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 24);
2352
2355
gtk_widget_show (entry);
2373
2376
gtk_widget_show (button);
2375
2378
g_object_set_data (G_OBJECT (button), "monitor_resolution_sizeentry", entry);
2376
g_object_set_data (G_OBJECT (button), "set_sensitive", label);
2377
g_object_set_data (G_OBJECT (button), "inverse_sensitive", entry);
2379
2380
g_signal_connect (button, "toggled",
2380
2381
G_CALLBACK (prefs_resolution_source_callback),
2391
2392
if (! display_config->monitor_res_from_gdk)
2392
2393
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
2394
hbox = gtk_hbox_new (FALSE, 0);
2395
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
2395
2396
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
2396
2397
gtk_widget_show (hbox);
2403
2404
gtk_widget_set_sensitive (calibrate_button,
2404
2405
! display_config->monitor_res_from_gdk);
2406
g_object_set_data (G_OBJECT (entry), "inverse_sensitive", calibrate_button);
2407
g_object_bind_property (button, "active",
2409
G_BINDING_SYNC_CREATE);
2410
g_object_bind_property (button, "active",
2411
calibrate_button, "sensitive",
2412
G_BINDING_SYNC_CREATE);
2408
2414
g_signal_connect (calibrate_button, "clicked",
2409
2415
G_CALLBACK (prefs_resolution_calibrate_callback),
2513
2519
g_object_unref (store);
2515
hbox = gtk_hbox_new (FALSE, 6);
2521
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
2516
2522
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, row, row + 1);
2517
2523
gtk_widget_show (hbox);
2626
2632
vbox2 = prefs_frame_new (_("Window Manager Hints"),
2627
2633
GTK_CONTAINER (vbox), FALSE);
2629
table = prefs_table_new (2, GTK_CONTAINER (vbox2));
2631
prefs_enum_combo_box_add (object, "toolbox-window-hint", 0, 0,
2632
_("Hint for the _toolbox:"),
2633
GTK_TABLE (table), 0, size_group);
2635
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
2635
2637
prefs_enum_combo_box_add (object, "dock-window-hint", 0, 0,
2636
_("Hint for other _docks:"),
2638
_("Hint for _docks and toolbox:"),
2637
2639
GTK_TABLE (table), 1, size_group);
2639
#ifdef GIMP_UNSTABLE
2640
prefs_check_button_add (object, "transient-docks",
2641
_("Toolbox and other docks are transient "
2642
"to the active image window"),
2646
2641
vbox2 = prefs_frame_new (_("Focus"),
2647
2642
GTK_CONTAINER (vbox), FALSE);
2745
2740
GIMP_HELP_PREFS_FOLDERS_BRUSHES,
2746
2741
N_("Select Brush Folders"),
2747
2742
"brush-path", "brush-path-writable" },
2743
{ N_("Dynamics"), N_("Dynamics Folders"), "folders-dynamics",
2744
GIMP_HELP_PREFS_FOLDERS_DYNAMICS,
2745
N_("Select Dynamics Folders"),
2746
"dynamics-path", "dynamics-path-writable" },
2748
2747
{ N_("Patterns"), N_("Pattern Folders"), "folders-patterns",
2749
2748
GIMP_HELP_PREFS_FOLDERS_PATTERNS,
2750
2749
N_("Select Pattern Folders"),
2761
2760
GIMP_HELP_PREFS_FOLDERS_FONTS,
2762
2761
N_("Select Font Folders"),
2763
2762
"font-path", NULL },
2763
{ N_("Tool Presets"), N_("Tool Preset Folders"), "folders-tool-presets",
2764
GIMP_HELP_PREFS_FOLDERS_TOOL_PRESETS,
2765
N_("Select Tool Preset Folders"),
2766
"tool-preset-path", "tool-preset-path-writable" },
2764
2767
{ N_("Plug-Ins"), N_("Plug-In Folders"), "folders-plug-ins",
2765
2768
GIMP_HELP_PREFS_FOLDERS_PLUG_INS,
2766
2769
N_("Select Plug-In Folders"),
2806
2809
paths[i].path_property_name,
2807
2810
paths[i].writable_property_name,
2808
2811
gettext (paths[i].fs_label));
2809
gtk_container_add (GTK_CONTAINER (vbox), editor);
2812
gtk_box_pack_start (GTK_BOX (vbox), editor, TRUE, TRUE, 0);
2810
2813
gtk_widget_show (editor);