1999-03-28 02:16:30 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
2000-11-18 08:25:42 +08:00
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
1999-03-28 02:16:30 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-06-06 08:28:28 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "tools/tools-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/base-config.h"
|
|
|
|
#include "base/tile-cache.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "core/gimpcoreconfig.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpimage.h"
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "tools/tool_manager.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "layer-select.h"
|
2001-05-23 05:12:43 +08:00
|
|
|
#include "resolution-calibrate-dialog.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "session.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "app_procs.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
#include "colormaps.h"
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "gdisplay.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
#include "gdisplay_ops.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "gimphelp.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
#include "gimprc.h"
|
|
|
|
#include "image_render.h"
|
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2001-07-27 07:35:00 +08:00
|
|
|
/* gimprc will be parsed with a buffer size of 1024,
|
|
|
|
* so don't set this too large
|
|
|
|
*/
|
2000-03-12 08:17:30 +08:00
|
|
|
#define MAX_COMMENT_LENGTH 512
|
2000-01-08 04:40:55 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
2000-01-08 04:40:55 +08:00
|
|
|
PREFS_OK,
|
|
|
|
PREFS_CORRUPT,
|
|
|
|
PREFS_RESTART
|
|
|
|
} PrefsState;
|
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
/* preferences local functions */
|
2000-09-25 09:27:47 +08:00
|
|
|
static PrefsState prefs_check_settings (void);
|
2001-07-27 07:35:00 +08:00
|
|
|
static void prefs_ok_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg);
|
|
|
|
static void prefs_save_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg);
|
|
|
|
static void prefs_cancel_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg);
|
|
|
|
|
|
|
|
static void prefs_toggle_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_preview_size_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_nav_preview_size_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_string_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_text_callback (GtkTextBuffer *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_filename_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_path_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_clear_session_info_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_default_size_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_default_resolution_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_res_source_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_monitor_resolution_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2000-09-25 09:27:47 +08:00
|
|
|
static void prefs_restart_notification (void);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
/* static variables */
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_perfectmouse;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_transparency_type;
|
|
|
|
static gint old_transparency_size;
|
|
|
|
static gint old_levels_of_undo;
|
|
|
|
static gint old_marching_speed;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_allow_resize_windows;
|
|
|
|
static gboolean old_auto_save;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_preview_size;
|
|
|
|
static gint old_nav_preview_size;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_no_cursor_updating;
|
|
|
|
static gboolean old_show_tool_tips;
|
|
|
|
static gboolean old_show_rulers;
|
|
|
|
static gboolean old_show_statusbar;
|
2000-01-26 07:05:47 +08:00
|
|
|
static InterpolationType old_interpolation_type;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_confirm_on_close;
|
|
|
|
static gboolean old_save_session_info;
|
|
|
|
static gboolean old_save_device_status;
|
|
|
|
static gboolean old_always_restore_session;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_default_width;
|
|
|
|
static gint old_default_height;
|
2000-02-08 04:35:13 +08:00
|
|
|
static GimpUnit old_default_units;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gdouble old_default_xresolution;
|
|
|
|
static gdouble old_default_yresolution;
|
2000-02-08 04:35:13 +08:00
|
|
|
static GimpUnit old_default_resolution_units;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_default_type;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gchar * old_default_comment;
|
|
|
|
static gboolean old_default_dot_for_dot;
|
|
|
|
static gboolean old_stingy_memory_use;
|
2000-05-21 02:39:02 +08:00
|
|
|
static guint old_tile_cache_size;
|
2000-05-01 02:17:55 +08:00
|
|
|
static gint old_min_colors;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_install_cmap;
|
|
|
|
static gboolean old_cycled_marching_ants;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_last_opened_size;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gchar * old_temp_path;
|
|
|
|
static gchar * old_swap_path;
|
|
|
|
static gchar * old_plug_in_path;
|
|
|
|
static gchar * old_module_path;
|
|
|
|
static gchar * old_brush_path;
|
|
|
|
static gchar * old_pattern_path;
|
|
|
|
static gchar * old_palette_path;
|
|
|
|
static gchar * old_gradient_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gdouble old_monitor_xres;
|
|
|
|
static gdouble old_monitor_yres;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_using_xserver_resolution;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_num_processors;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gchar * old_image_title_format;
|
|
|
|
static gboolean old_global_paint_options;
|
2000-05-21 02:39:02 +08:00
|
|
|
static guint old_max_new_image_size;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_thumbnail_mode;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_show_indicators;
|
|
|
|
static gboolean old_trust_dirty_flag;
|
|
|
|
static gboolean old_use_help;
|
|
|
|
static gboolean old_nav_window_per_display;
|
|
|
|
static gboolean old_info_window_follows_mouse;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint old_help_browser;
|
2000-06-06 08:28:28 +08:00
|
|
|
static gint old_cursor_mode;
|
2000-04-19 22:02:05 +08:00
|
|
|
static gint old_default_threshold;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean old_disable_tearoff_menus;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* variables which can't be changed on the fly */
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean edit_stingy_memory_use;
|
2000-05-01 02:17:55 +08:00
|
|
|
static gint edit_min_colors;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean edit_install_cmap;
|
|
|
|
static gboolean edit_cycled_marching_ants;
|
2000-01-26 07:05:47 +08:00
|
|
|
static gint edit_last_opened_size;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gboolean edit_show_indicators;
|
|
|
|
static gboolean edit_nav_window_per_display;
|
|
|
|
static gboolean edit_info_window_follows_mouse;
|
2001-01-07 22:25:47 +08:00
|
|
|
static gboolean edit_disable_tearoff_menus;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gchar * edit_temp_path = NULL;
|
|
|
|
static gchar * edit_swap_path = NULL;
|
2001-07-07 20:17:23 +08:00
|
|
|
static gchar * edit_plug_in_path = NULL;
|
|
|
|
static gchar * edit_module_path = NULL;
|
2001-01-02 10:33:43 +08:00
|
|
|
static gchar * edit_brush_path = NULL;
|
|
|
|
static gchar * edit_pattern_path = NULL;
|
|
|
|
static gchar * edit_palette_path = NULL;
|
|
|
|
static gchar * edit_gradient_path = NULL;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* variables which will be changed _after_ closing the dialog */
|
2000-05-21 02:39:02 +08:00
|
|
|
static guint edit_tile_cache_size;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2001-01-02 10:33:43 +08:00
|
|
|
static GtkWidget * prefs_dlg = NULL;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
/* Some information regarding preferences, compiled by Raph Levien 11/3/97.
|
1999-03-28 02:16:30 +08:00
|
|
|
updated by Michael Natterer 27/3/99
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
The following preference items cannot be set on the fly (at least
|
|
|
|
according to the existing pref code - it may be that changing them
|
|
|
|
so they're set on the fly is not hard).
|
|
|
|
|
|
|
|
stingy-memory-use
|
2000-05-01 02:17:55 +08:00
|
|
|
min-colors
|
1998-06-09 05:53:45 +08:00
|
|
|
install-cmap
|
|
|
|
cycled-marching-ants
|
1998-07-12 13:18:17 +08:00
|
|
|
last-opened-size
|
2000-01-26 07:05:47 +08:00
|
|
|
show-indicators
|
|
|
|
nav-window-per-display
|
|
|
|
info_window_follows_mouse
|
1999-04-05 20:48:48 +08:00
|
|
|
temp-path
|
|
|
|
swap-path
|
|
|
|
brush-path
|
|
|
|
pattern-path
|
|
|
|
palette-path
|
|
|
|
gradient-path
|
2000-01-26 07:05:47 +08:00
|
|
|
plug-in-path
|
|
|
|
module-path
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
All of these now have variables of the form edit_temp_path, which
|
|
|
|
are copied from the actual variables (e.g. temp_path) the first time
|
|
|
|
the dialog box is started.
|
|
|
|
|
|
|
|
Variables of the form old_temp_path represent the values at the
|
|
|
|
time the dialog is opened - a cancel copies them back from old to
|
|
|
|
the real variables or the edit variables, depending on whether they
|
|
|
|
can be set on the fly.
|
|
|
|
|
|
|
|
Here are the remaining issues as I see them:
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
Still no settings for default-gradient, default-palette,
|
2000-04-19 22:02:05 +08:00
|
|
|
gamma-correction.
|
1999-04-03 03:46:59 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
No widget for confirm-on-close although a lot of stuff is there.
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
The semantics of "save" are a little funny - it only saves the
|
|
|
|
settings that are different from the way they were when the dialog
|
|
|
|
was opened. So you can set something, close the window, open it
|
|
|
|
up again, click "save" and have nothing happen. To change this
|
|
|
|
to more intuitive semantics, we should have a whole set of init_
|
|
|
|
variables that are set the first time the dialog is opened (along
|
|
|
|
with the edit_ variables that are currently set). Then, the save
|
|
|
|
callback checks against the init_ variable rather than the old_.
|
1999-03-28 02:16:30 +08:00
|
|
|
*/
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* Copy the string from source to destination, freeing the string stored
|
|
|
|
* in the destination if there is one there already.
|
|
|
|
*/
|
1998-06-09 05:53:45 +08:00
|
|
|
static void
|
2001-07-25 08:42:47 +08:00
|
|
|
prefs_strset (gchar **dst,
|
|
|
|
const gchar *src)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
1999-11-27 21:44:54 +08:00
|
|
|
if (*dst)
|
1998-06-09 05:53:45 +08:00
|
|
|
g_free (*dst);
|
1999-11-27 21:44:54 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
*dst = g_strdup (src);
|
|
|
|
}
|
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* Duplicate the string, but treat NULL as the empty string. */
|
1999-11-27 21:44:54 +08:00
|
|
|
static gchar *
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strdup (gchar *src)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
return g_strdup (src == NULL ? "" : src);
|
|
|
|
}
|
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* Compare two strings, but treat NULL as the empty string. */
|
1998-06-09 05:53:45 +08:00
|
|
|
static int
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strcmp (gchar *src1,
|
2001-01-02 10:33:43 +08:00
|
|
|
gchar *src2)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
return strcmp (src1 == NULL ? "" : src1,
|
1999-03-28 02:16:30 +08:00
|
|
|
src2 == NULL ? "" : src2);
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
static PrefsState
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_check_settings (void)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2000-01-26 07:05:47 +08:00
|
|
|
/* First, check for invalid values... */
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->levels_of_undo < 0)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_message (_("Error: Levels of undo must be zero or greater."));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->levels_of_undo = old_levels_of_undo;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.marching_speed < 50)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_message (_("Error: Marching speed must be 50 or greater."));
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.marching_speed = old_marching_speed;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_width < 1)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_message (_("Error: Default width must be one or greater."));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_width = old_default_width;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_height < 1)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_message (_("Error: Default height must be one or greater."));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_height = old_default_height;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1998-12-06 05:48:37 +08:00
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_units < GIMP_UNIT_INCH ||
|
|
|
|
the_gimp->config->default_units >= gimp_unit_get_number_of_units ())
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Default unit must be within unit range."));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_units = old_default_units;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1999-03-03 20:35:12 +08:00
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_xresolution < GIMP_MIN_RESOLUTION ||
|
|
|
|
the_gimp->config->default_yresolution < GIMP_MIN_RESOLUTION)
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
1999-11-23 06:38:02 +08:00
|
|
|
g_message (_("Error: Default resolution must not be zero."));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_xresolution = old_default_xresolution;
|
|
|
|
the_gimp->config->default_yresolution = old_default_yresolution;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1999-03-03 20:35:12 +08:00
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_resolution_units < GIMP_UNIT_INCH ||
|
|
|
|
the_gimp->config->default_resolution_units >= gimp_unit_get_number_of_units ())
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Default resolution unit must be within unit range."));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_resolution_units = old_default_resolution_units;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1999-03-03 20:35:12 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.monitor_xres < GIMP_MIN_RESOLUTION ||
|
|
|
|
gimprc.monitor_yres < GIMP_MIN_RESOLUTION)
|
1998-12-06 05:48:37 +08:00
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Monitor resolution must not be zero."));
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.monitor_xres = old_monitor_xres;
|
|
|
|
gimprc.monitor_yres = old_monitor_yres;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1998-12-06 05:48:37 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.image_title_format == NULL)
|
1999-02-11 06:48:13 +08:00
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Image title format must not be NULL."));
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.image_title_format = old_image_title_format;
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_CORRUPT;
|
1999-02-11 06:48:13 +08:00
|
|
|
}
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2001-05-26 00:24:44 +08:00
|
|
|
if (base_config->num_processors < 1 || base_config->num_processors > 30)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
g_message (_("Error: Number of processors must be between 1 and 30."));
|
2001-05-26 00:24:44 +08:00
|
|
|
base_config->num_processors = old_num_processors;
|
2000-01-26 07:05:47 +08:00
|
|
|
return PREFS_CORRUPT;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ...then check if we need a restart notification */
|
|
|
|
if (edit_stingy_memory_use != old_stingy_memory_use ||
|
2000-05-01 02:17:55 +08:00
|
|
|
edit_min_colors != old_min_colors ||
|
2000-01-26 07:05:47 +08:00
|
|
|
edit_install_cmap != old_install_cmap ||
|
|
|
|
edit_cycled_marching_ants != old_cycled_marching_ants ||
|
|
|
|
edit_last_opened_size != old_last_opened_size ||
|
|
|
|
edit_show_indicators != old_show_indicators ||
|
|
|
|
edit_nav_window_per_display != old_nav_window_per_display ||
|
|
|
|
edit_info_window_follows_mouse != old_info_window_follows_mouse ||
|
2001-01-02 10:33:43 +08:00
|
|
|
edit_disable_tearoff_menus != old_disable_tearoff_menus ||
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strcmp (old_temp_path, edit_temp_path) ||
|
|
|
|
prefs_strcmp (old_swap_path, edit_swap_path) ||
|
2001-07-07 20:17:23 +08:00
|
|
|
prefs_strcmp (old_plug_in_path, edit_plug_in_path) ||
|
|
|
|
prefs_strcmp (old_module_path, edit_module_path) ||
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strcmp (old_brush_path, edit_brush_path) ||
|
|
|
|
prefs_strcmp (old_pattern_path, edit_pattern_path) ||
|
|
|
|
prefs_strcmp (old_palette_path, edit_palette_path) ||
|
2001-07-07 20:17:23 +08:00
|
|
|
prefs_strcmp (old_gradient_path, edit_gradient_path))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
return PREFS_RESTART;
|
|
|
|
}
|
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
return PREFS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_restart_notification_save_callback (GtkWidget *widget,
|
2000-01-08 04:40:55 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_save_callback (widget, prefs_dlg);
|
2000-01-26 07:05:47 +08:00
|
|
|
gtk_widget_destroy (GTK_WIDGET (data));
|
2000-01-08 04:40:55 +08:00
|
|
|
}
|
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* The user pressed OK and not Save, but has changed some settings that
|
|
|
|
* only take effect after he restarts the GIMP. Allow him to save the
|
|
|
|
* settings.
|
|
|
|
*/
|
2000-01-08 04:40:55 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_restart_notification (void)
|
2000-01-08 04:40:55 +08:00
|
|
|
{
|
|
|
|
GtkWidget *dlg;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *label;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
dlg = gimp_dialog_new (_("Save Preferences ?"), "gimp_message",
|
2000-01-26 07:05:47 +08:00
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/preferences/preferences.html",
|
2000-01-08 04:40:55 +08:00
|
|
|
GTK_WIN_POS_MOUSE,
|
|
|
|
FALSE, FALSE, FALSE,
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2001-07-31 01:17:36 +08:00
|
|
|
GTK_STOCK_SAVE,
|
|
|
|
prefs_restart_notification_save_callback,
|
2000-01-08 04:40:55 +08:00
|
|
|
NULL, NULL, NULL, TRUE, FALSE,
|
2001-07-31 01:17:36 +08:00
|
|
|
GTK_STOCK_CLOSE, gtk_widget_destroy,
|
2000-01-26 07:05:47 +08:00
|
|
|
NULL, 1, NULL, FALSE, TRUE,
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
NULL);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (dlg), "destroy",
|
|
|
|
G_CALLBACK (gtk_main_quit),
|
|
|
|
NULL);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox, TRUE, FALSE, 4);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
label = gtk_label_new (_("At least one of the changes you made will only\n"
|
|
|
|
"take effect after you restart the GIMP.\n\n"
|
|
|
|
"You may choose 'Save' now to make your changes\n"
|
|
|
|
"permanent, so you can restart GIMP or hit 'Close'\n"
|
|
|
|
"and the critical parts of your changes will not\n"
|
|
|
|
"be applied."));
|
|
|
|
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 4);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
gtk_widget_show (dlg);
|
|
|
|
|
|
|
|
gtk_main ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_ok_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
GtkWidget *dlg)
|
2000-01-08 04:40:55 +08:00
|
|
|
{
|
|
|
|
PrefsState state;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
state = prefs_check_settings ();
|
2000-01-08 04:40:55 +08:00
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case PREFS_CORRUPT:
|
|
|
|
return;
|
|
|
|
break;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
case PREFS_RESTART:
|
|
|
|
gtk_widget_set_sensitive (prefs_dlg, FALSE);
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_restart_notification ();
|
2000-01-26 07:05:47 +08:00
|
|
|
break;
|
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
case PREFS_OK:
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.show_tool_tips)
|
2000-01-26 07:05:47 +08:00
|
|
|
gimp_help_enable_tooltips ();
|
|
|
|
else
|
|
|
|
gimp_help_disable_tooltips ();
|
|
|
|
|
|
|
|
if (edit_tile_cache_size != old_tile_cache_size)
|
|
|
|
{
|
2001-05-15 19:25:25 +08:00
|
|
|
base_config->tile_cache_size = edit_tile_cache_size;
|
2000-01-26 07:05:47 +08:00
|
|
|
tile_cache_set_size (edit_tile_cache_size);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (prefs_dlg)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (prefs_dlg);
|
|
|
|
prefs_dlg = NULL;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_save_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
GtkWidget *dlg)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2000-01-26 07:05:47 +08:00
|
|
|
GList *update = NULL; /* options that should be updated in .gimprc */
|
|
|
|
GList *remove = NULL; /* options that should be commented out */
|
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
PrefsState state;
|
1999-04-05 20:48:48 +08:00
|
|
|
|
2001-01-02 10:33:43 +08:00
|
|
|
gboolean save_stingy_memory_use;
|
|
|
|
gint save_min_colors;
|
|
|
|
gboolean save_install_cmap;
|
|
|
|
gboolean save_cycled_marching_ants;
|
|
|
|
gint save_last_opened_size;
|
|
|
|
gboolean save_show_indicators;
|
|
|
|
gboolean save_nav_window_per_display;
|
|
|
|
gboolean save_info_window_follows_mouse;
|
|
|
|
gchar *save_temp_path;
|
|
|
|
gchar *save_swap_path;
|
|
|
|
gchar *save_plug_in_path;
|
|
|
|
gchar *save_module_path;
|
|
|
|
gchar *save_brush_path;
|
|
|
|
gchar *save_pattern_path;
|
|
|
|
gchar *save_palette_path;
|
|
|
|
gchar *save_gradient_path;
|
1999-04-05 20:48:48 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
state = prefs_check_settings ();
|
2000-01-08 04:40:55 +08:00
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case PREFS_CORRUPT:
|
|
|
|
return;
|
|
|
|
break;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
case PREFS_RESTART:
|
|
|
|
gtk_widget_set_sensitive (prefs_dlg, FALSE);
|
2000-01-26 07:05:47 +08:00
|
|
|
g_message (_("You will need to restart GIMP for these "
|
|
|
|
"changes to take effect."));
|
2000-01-08 04:40:55 +08:00
|
|
|
/* don't break */
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
case PREFS_OK:
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.show_tool_tips)
|
2000-01-26 07:05:47 +08:00
|
|
|
gimp_help_enable_tooltips ();
|
|
|
|
else
|
|
|
|
gimp_help_disable_tooltips ();
|
|
|
|
|
|
|
|
if (edit_tile_cache_size != old_tile_cache_size)
|
|
|
|
tile_cache_set_size (edit_tile_cache_size);
|
|
|
|
break;
|
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
gtk_widget_destroy (prefs_dlg);
|
|
|
|
prefs_dlg = NULL;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* Save variables so that we can restore them later */
|
2001-05-15 19:25:25 +08:00
|
|
|
save_stingy_memory_use = base_config->stingy_memory_use;
|
2001-06-04 04:40:50 +08:00
|
|
|
save_min_colors = gimprc.min_colors;
|
|
|
|
save_install_cmap = gimprc.install_cmap;
|
|
|
|
save_cycled_marching_ants = gimprc.cycled_marching_ants;
|
|
|
|
save_last_opened_size = gimprc.last_opened_size;
|
|
|
|
save_show_indicators = gimprc.show_indicators;
|
|
|
|
save_nav_window_per_display = gimprc.nav_window_per_display;
|
|
|
|
save_info_window_follows_mouse = gimprc.info_window_follows_mouse;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
save_temp_path = base_config->temp_path;
|
|
|
|
save_swap_path = base_config->swap_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
save_plug_in_path = the_gimp->config->plug_in_path;
|
|
|
|
save_module_path = the_gimp->config->module_path;
|
|
|
|
save_brush_path = the_gimp->config->brush_path;
|
|
|
|
save_pattern_path = the_gimp->config->pattern_path;
|
|
|
|
save_palette_path = the_gimp->config->palette_path;
|
|
|
|
save_gradient_path = the_gimp->config->gradient_path;
|
2001-07-07 20:17:23 +08:00
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->levels_of_undo != old_levels_of_undo)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "undo-levels");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.marching_speed != old_marching_speed)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "marching-ants-speed");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.allow_resize_windows != old_allow_resize_windows)
|
1998-06-24 06:50:16 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "allow-resize-windows");
|
|
|
|
remove = g_list_append (remove, "dont-allow-resize-windows");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.auto_save != old_auto_save)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "auto-save");
|
|
|
|
remove = g_list_append (remove, "dont-auto-save");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.no_cursor_updating != old_no_cursor_updating)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "cursor-updating");
|
|
|
|
remove = g_list_append (remove, "no-cursor-updating");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.show_tool_tips != old_show_tool_tips)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "show-tool-tips");
|
|
|
|
remove = g_list_append (remove, "dont-show-tool-tips");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.show_rulers != old_show_rulers)
|
1998-08-05 20:38:11 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "show-rulers");
|
|
|
|
remove = g_list_append (remove, "dont-show-rulers");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.show_statusbar != old_show_statusbar)
|
1998-08-05 20:38:11 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "show-statusbar");
|
|
|
|
remove = g_list_append (remove, "dont-show-statusbar");
|
|
|
|
}
|
2001-05-15 19:25:25 +08:00
|
|
|
if (base_config->interpolation_type != old_interpolation_type)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "interpolation-type");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.confirm_on_close != old_confirm_on_close)
|
1998-06-24 06:50:16 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "confirm-on-close");
|
|
|
|
remove = g_list_append (remove, "dont-confirm-on-close");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.save_session_info != old_save_session_info)
|
1998-06-24 06:50:16 +08:00
|
|
|
{
|
1998-07-12 06:23:23 +08:00
|
|
|
update = g_list_append (update, "save-session-info");
|
|
|
|
remove = g_list_append (remove, "dont-save-session-info");
|
1998-06-24 06:50:16 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.save_device_status!= old_save_device_status)
|
1998-08-13 23:25:41 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "save-device-status");
|
|
|
|
remove = g_list_append (remove, "dont-save-device-status");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.always_restore_session != old_always_restore_session)
|
1999-06-14 10:23:53 +08:00
|
|
|
{
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "always-restore-session");
|
1999-06-14 10:23:53 +08:00
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_width != old_default_width ||
|
|
|
|
the_gimp->config->default_height != old_default_height)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-image-size");
|
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_units != old_default_units)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-units");
|
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (ABS (the_gimp->config->default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-xresolution");
|
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (ABS (the_gimp->config->default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-yresolution");
|
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_resolution_units != old_default_resolution_units)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-resolution-units");
|
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->default_type != old_default_type)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-image-type");
|
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (prefs_strcmp (the_gimp->config->default_comment, old_default_comment))
|
2000-03-12 08:17:30 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-comment");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.default_dot_for_dot != old_default_dot_for_dot)
|
2000-01-10 01:31:00 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-dot-for-dot");
|
|
|
|
remove = g_list_append (remove, "dont-default-dot-for-dot");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.preview_size != old_preview_size)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "preview-size");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.nav_preview_size != old_nav_preview_size)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "nav-preview-size");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.perfectmouse != old_perfectmouse)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "perfect-mouse");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.transparency_type != old_transparency_type)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "transparency-type");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.transparency_size != old_transparency_size)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "transparency-size");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.using_xserver_resolution != old_using_xserver_resolution ||
|
|
|
|
ABS(gimprc.monitor_xres - old_monitor_xres) > GIMP_MIN_RESOLUTION)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "monitor-xresolution");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.using_xserver_resolution != old_using_xserver_resolution ||
|
|
|
|
ABS(gimprc.monitor_yres - old_monitor_yres) > GIMP_MIN_RESOLUTION)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "monitor-yresolution");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.using_xserver_resolution)
|
1998-12-06 05:48:37 +08:00
|
|
|
{
|
|
|
|
/* special value of 0 for either x or y res in the gimprc file
|
|
|
|
* means use the xserver's current resolution */
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.monitor_xres = 0.0;
|
|
|
|
gimprc.monitor_yres = 0.0;
|
1998-12-06 05:48:37 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (prefs_strcmp (gimprc.image_title_format, old_image_title_format))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "image-title-format");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.global_paint_options != old_global_paint_options)
|
1999-04-22 22:34:00 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "global-paint-options");
|
|
|
|
remove = g_list_append (remove, "no-global-paint-options");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.max_new_image_size != old_max_new_image_size)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "max-new-image-size");
|
|
|
|
}
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->thumbnail_mode != old_thumbnail_mode)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "thumbnail-mode");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.trust_dirty_flag != old_trust_dirty_flag)
|
1999-09-25 02:28:35 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "trust-dirty-flag");
|
2001-03-04 19:08:09 +08:00
|
|
|
remove = g_list_append (remove, "dont-trust-dirty-flag");
|
1999-09-25 02:28:35 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.use_help != old_use_help)
|
1999-09-28 01:58:10 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "use-help");
|
|
|
|
remove = g_list_append (remove, "dont-use-help");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.help_browser != old_help_browser)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "help-browser");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.cursor_mode != old_cursor_mode)
|
2000-06-06 08:28:28 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "cursor-mode");
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.default_threshold != old_default_threshold)
|
2000-04-19 22:02:05 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "default-threshold");
|
|
|
|
}
|
2001-05-26 00:24:44 +08:00
|
|
|
if (base_config->num_processors != old_num_processors)
|
2000-09-15 00:22:40 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "num-processors");
|
|
|
|
}
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* values which can't be changed on the fly */
|
|
|
|
if (edit_stingy_memory_use != old_stingy_memory_use)
|
|
|
|
{
|
2001-05-15 19:25:25 +08:00
|
|
|
base_config->stingy_memory_use = edit_stingy_memory_use;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "stingy-memory-use");
|
|
|
|
}
|
2000-05-01 02:17:55 +08:00
|
|
|
if (edit_min_colors != old_min_colors)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.min_colors = edit_min_colors;
|
2000-05-01 02:17:55 +08:00
|
|
|
update = g_list_append (update, "min-colors");
|
|
|
|
}
|
2000-01-26 07:05:47 +08:00
|
|
|
if (edit_install_cmap != old_install_cmap)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.install_cmap = edit_install_cmap;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "install-colormap");
|
|
|
|
}
|
|
|
|
if (edit_cycled_marching_ants != old_cycled_marching_ants)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.cycled_marching_ants = edit_cycled_marching_ants;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "colormap-cycling");
|
|
|
|
}
|
|
|
|
if (edit_last_opened_size != old_last_opened_size)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.last_opened_size = edit_last_opened_size;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "last-opened-size");
|
|
|
|
}
|
|
|
|
if (edit_show_indicators != old_show_indicators)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.show_indicators = edit_show_indicators;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "show-indicators");
|
|
|
|
remove = g_list_append (remove, "dont-show-indicators");
|
|
|
|
}
|
1999-11-20 08:46:58 +08:00
|
|
|
if (edit_nav_window_per_display != old_nav_window_per_display)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.nav_window_per_display = edit_nav_window_per_display;
|
1999-11-20 08:46:58 +08:00
|
|
|
update = g_list_append (update, "nav-window-per-display");
|
|
|
|
remove = g_list_append (remove, "nav-window-follows-auto");
|
|
|
|
}
|
1999-11-30 08:11:08 +08:00
|
|
|
if (edit_info_window_follows_mouse != old_info_window_follows_mouse)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.info_window_follows_mouse = edit_info_window_follows_mouse;
|
1999-11-30 08:11:08 +08:00
|
|
|
update = g_list_append (update, "info-window-follows-mouse");
|
|
|
|
remove = g_list_append (remove, "info-window-per-display");
|
|
|
|
}
|
2001-01-02 10:33:43 +08:00
|
|
|
if (edit_disable_tearoff_menus != old_disable_tearoff_menus)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.disable_tearoff_menus = edit_disable_tearoff_menus;
|
2001-01-02 10:33:43 +08:00
|
|
|
update = g_list_append (update, "disable-tearoff-menus");
|
|
|
|
}
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
if (prefs_strcmp (old_temp_path, edit_temp_path))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-05-15 19:25:25 +08:00
|
|
|
base_config->temp_path = edit_temp_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "temp-path");
|
|
|
|
}
|
2000-09-25 09:27:47 +08:00
|
|
|
if (prefs_strcmp (old_swap_path, edit_swap_path))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-05-15 19:25:25 +08:00
|
|
|
base_config->swap_path = edit_swap_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "swap-path");
|
|
|
|
}
|
2001-07-07 20:17:23 +08:00
|
|
|
if (prefs_strcmp (old_plug_in_path, edit_plug_in_path))
|
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->plug_in_path = edit_plug_in_path;
|
2001-07-07 20:17:23 +08:00
|
|
|
update = g_list_append (update, "plug-in-path");
|
|
|
|
}
|
|
|
|
if (prefs_strcmp (old_module_path, edit_module_path))
|
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->module_path = edit_module_path;
|
2001-07-07 20:17:23 +08:00
|
|
|
update = g_list_append (update, "module-path");
|
|
|
|
}
|
2000-09-25 09:27:47 +08:00
|
|
|
if (prefs_strcmp (old_brush_path, edit_brush_path))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->brush_path = edit_brush_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "brush-path");
|
|
|
|
}
|
2000-09-25 09:27:47 +08:00
|
|
|
if (prefs_strcmp (old_pattern_path, edit_pattern_path))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->pattern_path = edit_pattern_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "pattern-path");
|
|
|
|
}
|
2000-09-25 09:27:47 +08:00
|
|
|
if (prefs_strcmp (old_palette_path, edit_palette_path))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->palette_path = edit_palette_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "palette-path");
|
|
|
|
}
|
2000-09-25 09:27:47 +08:00
|
|
|
if (prefs_strcmp (old_gradient_path, edit_gradient_path))
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->gradient_path = edit_gradient_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "gradient-path");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* values which are changed on "OK" or "Save" */
|
|
|
|
if (edit_tile_cache_size != old_tile_cache_size)
|
|
|
|
{
|
2001-05-15 19:25:25 +08:00
|
|
|
base_config->tile_cache_size = edit_tile_cache_size;
|
2000-01-26 07:05:47 +08:00
|
|
|
update = g_list_append (update, "tile-cache-size");
|
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
gimprc_save (&update, &remove);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.using_xserver_resolution)
|
2001-07-07 20:17:23 +08:00
|
|
|
gdisplay_xserver_resolution (&gimprc.monitor_xres,
|
|
|
|
&gimprc.monitor_yres);
|
1998-12-06 05:48:37 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* restore variables which must not change */
|
2001-05-15 19:25:25 +08:00
|
|
|
base_config->stingy_memory_use = save_stingy_memory_use;
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.min_colors = save_min_colors;
|
|
|
|
gimprc.install_cmap = save_install_cmap;
|
|
|
|
gimprc.cycled_marching_ants = save_cycled_marching_ants;
|
|
|
|
gimprc.last_opened_size = save_last_opened_size;
|
|
|
|
gimprc.show_indicators = save_show_indicators;
|
|
|
|
gimprc.nav_window_per_display = save_nav_window_per_display;
|
|
|
|
gimprc.info_window_follows_mouse = save_info_window_follows_mouse;
|
2001-05-15 19:25:25 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
base_config->temp_path = save_temp_path;
|
|
|
|
base_config->swap_path = save_swap_path;
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->plug_in_path = save_plug_in_path;
|
|
|
|
the_gimp->config->module_path = save_module_path;
|
|
|
|
the_gimp->config->brush_path = save_brush_path;
|
|
|
|
the_gimp->config->pattern_path = save_pattern_path;
|
|
|
|
the_gimp->config->palette_path = save_palette_path;
|
|
|
|
the_gimp->config->gradient_path = save_gradient_path;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* no need to restore values which are only changed on "OK" and "Save" */
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
g_list_free (update);
|
|
|
|
g_list_free (remove);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_cancel_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
GtkWidget *dlg)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
gtk_widget_destroy (dlg);
|
|
|
|
prefs_dlg = NULL;
|
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* restore ordinary gimprc variables */
|
2001-07-07 20:17:23 +08:00
|
|
|
base_config->interpolation_type = old_interpolation_type;
|
|
|
|
base_config->num_processors = old_num_processors;
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_type = old_default_type;
|
|
|
|
the_gimp->config->default_width = old_default_width;
|
|
|
|
the_gimp->config->default_height = old_default_height;
|
|
|
|
the_gimp->config->default_units = old_default_units;
|
|
|
|
the_gimp->config->default_xresolution = old_default_xresolution;
|
|
|
|
the_gimp->config->default_yresolution = old_default_yresolution;
|
|
|
|
the_gimp->config->default_resolution_units = old_default_resolution_units;
|
|
|
|
the_gimp->config->levels_of_undo = old_levels_of_undo;
|
|
|
|
the_gimp->config->thumbnail_mode = old_thumbnail_mode;
|
2001-07-07 20:17:23 +08:00
|
|
|
|
|
|
|
gimprc.marching_speed = old_marching_speed;
|
|
|
|
gimprc.allow_resize_windows = old_allow_resize_windows;
|
|
|
|
gimprc.auto_save = old_auto_save;
|
|
|
|
gimprc.no_cursor_updating = old_no_cursor_updating;
|
|
|
|
gimprc.perfectmouse = old_perfectmouse;
|
|
|
|
gimprc.show_tool_tips = old_show_tool_tips;
|
|
|
|
gimprc.show_rulers = old_show_rulers;
|
|
|
|
gimprc.show_statusbar = old_show_statusbar;
|
|
|
|
gimprc.confirm_on_close = old_confirm_on_close;
|
|
|
|
gimprc.save_session_info = old_save_session_info;
|
|
|
|
gimprc.save_device_status = old_save_device_status;
|
|
|
|
gimprc.default_dot_for_dot = old_default_dot_for_dot;
|
|
|
|
gimprc.monitor_xres = old_monitor_xres;
|
|
|
|
gimprc.monitor_yres = old_monitor_yres;
|
|
|
|
gimprc.using_xserver_resolution = old_using_xserver_resolution;
|
|
|
|
gimprc.max_new_image_size = old_max_new_image_size;
|
|
|
|
gimprc.trust_dirty_flag = old_trust_dirty_flag;
|
|
|
|
gimprc.use_help = old_use_help;
|
|
|
|
gimprc.help_browser = old_help_browser;
|
|
|
|
gimprc.cursor_mode = old_cursor_mode;
|
|
|
|
gimprc.default_threshold = old_default_threshold;
|
1998-07-19 01:39:23 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* restore variables which need some magic */
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.preview_size != old_preview_size)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2001-05-12 01:02:30 +08:00
|
|
|
/* lc_dialog_rebuild (old_preview_size); FIXME: update preview size */
|
1998-06-09 05:53:45 +08:00
|
|
|
layer_select_update_preview_size ();
|
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if (gimprc.nav_preview_size != old_nav_preview_size)
|
1999-09-05 06:27:20 +08:00
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.nav_preview_size = old_nav_preview_size;
|
2000-01-26 07:05:47 +08:00
|
|
|
gdisplays_nav_preview_resized ();
|
1999-09-05 06:27:20 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
if ((gimprc.transparency_type != old_transparency_type) ||
|
|
|
|
(gimprc.transparency_size != old_transparency_size))
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.transparency_type = old_transparency_type;
|
|
|
|
gimprc.transparency_size = old_transparency_size;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
render_setup (gimprc.transparency_type, gimprc.transparency_size);
|
2001-06-18 21:10:03 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp_container_foreach (the_gimp->images,
|
2001-02-07 23:01:52 +08:00
|
|
|
(GFunc) gimp_image_invalidate_layer_previews,
|
|
|
|
NULL);
|
2001-06-18 21:10:03 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
gdisplays_expose_full ();
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
prefs_strset (&gimprc.image_title_format, old_image_title_format);
|
2001-07-11 20:39:49 +08:00
|
|
|
prefs_strset (&the_gimp->config->default_comment, old_default_comment);
|
1999-04-22 22:34:00 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
tool_manager_set_global_paint_options (the_gimp, old_global_paint_options);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* restore values which need a restart */
|
|
|
|
edit_stingy_memory_use = old_stingy_memory_use;
|
2000-05-01 02:17:55 +08:00
|
|
|
edit_min_colors = old_min_colors;
|
2000-01-26 07:05:47 +08:00
|
|
|
edit_install_cmap = old_install_cmap;
|
|
|
|
edit_cycled_marching_ants = old_cycled_marching_ants;
|
|
|
|
edit_last_opened_size = old_last_opened_size;
|
|
|
|
edit_show_indicators = old_show_indicators;
|
|
|
|
edit_nav_window_per_display = old_nav_window_per_display;
|
|
|
|
edit_info_window_follows_mouse = old_info_window_follows_mouse;
|
2001-01-02 10:33:43 +08:00
|
|
|
edit_disable_tearoff_menus = old_disable_tearoff_menus;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strset (&edit_temp_path, old_temp_path);
|
|
|
|
prefs_strset (&edit_swap_path, old_swap_path);
|
2001-07-07 20:17:23 +08:00
|
|
|
|
|
|
|
prefs_strset (&edit_plug_in_path, old_plug_in_path);
|
|
|
|
prefs_strset (&edit_module_path, old_module_path);
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strset (&edit_brush_path, old_brush_path);
|
|
|
|
prefs_strset (&edit_pattern_path, old_pattern_path);
|
|
|
|
prefs_strset (&edit_palette_path, old_palette_path);
|
|
|
|
prefs_strset (&edit_gradient_path, old_gradient_path);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* no need to restore values which are only changed on "OK" and "Save" */
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_toggle_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2000-01-26 07:05:47 +08:00
|
|
|
gint *val;
|
|
|
|
|
|
|
|
val = (gint *) data;
|
|
|
|
|
|
|
|
/* toggle buttos */
|
2001-07-07 20:17:23 +08:00
|
|
|
if (data == &gimprc.allow_resize_windows ||
|
|
|
|
data == &gimprc.auto_save ||
|
|
|
|
data == &gimprc.no_cursor_updating ||
|
|
|
|
data == &gimprc.perfectmouse ||
|
|
|
|
data == &gimprc.show_tool_tips ||
|
|
|
|
data == &gimprc.show_rulers ||
|
|
|
|
data == &gimprc.show_statusbar ||
|
|
|
|
data == &gimprc.confirm_on_close ||
|
|
|
|
data == &gimprc.save_session_info ||
|
|
|
|
data == &gimprc.save_device_status ||
|
|
|
|
data == &gimprc.always_restore_session ||
|
|
|
|
data == &gimprc.default_dot_for_dot ||
|
|
|
|
data == &gimprc.use_help ||
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
data == &edit_stingy_memory_use ||
|
|
|
|
data == &edit_install_cmap ||
|
|
|
|
data == &edit_cycled_marching_ants ||
|
|
|
|
data == &edit_show_indicators ||
|
|
|
|
data == &edit_nav_window_per_display ||
|
2001-01-02 10:33:43 +08:00
|
|
|
data == &edit_info_window_follows_mouse ||
|
|
|
|
data == &edit_disable_tearoff_menus)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
|
|
|
*val = GTK_TOGGLE_BUTTON (widget)->active;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* radio buttons */
|
2001-07-07 20:17:23 +08:00
|
|
|
else if (data == &base_config->interpolation_type ||
|
2001-07-11 20:39:49 +08:00
|
|
|
data == &the_gimp->config->default_type ||
|
|
|
|
data == &the_gimp->config->thumbnail_mode ||
|
2001-07-07 20:17:23 +08:00
|
|
|
data == &gimprc.trust_dirty_flag ||
|
|
|
|
data == &gimprc.help_browser ||
|
|
|
|
data == &gimprc.cursor_mode)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-07-27 07:35:00 +08:00
|
|
|
*val = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (widget)));
|
2000-01-26 07:05:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* values which need some magic */
|
2001-07-07 20:17:23 +08:00
|
|
|
else if ((data == &gimprc.transparency_type) ||
|
|
|
|
(data == &gimprc.transparency_size))
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2001-07-27 07:35:00 +08:00
|
|
|
*val = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (widget)));
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
render_setup (gimprc.transparency_type, gimprc.transparency_size);
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp_container_foreach (the_gimp->images,
|
2001-02-07 23:01:52 +08:00
|
|
|
(GFunc) gimp_image_invalidate_layer_previews,
|
|
|
|
NULL);
|
1998-06-09 05:53:45 +08:00
|
|
|
gdisplays_expose_full ();
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
2001-07-07 20:17:23 +08:00
|
|
|
else if (data == &gimprc.global_paint_options)
|
2000-01-26 07:05:47 +08:00
|
|
|
{
|
2001-07-07 20:17:23 +08:00
|
|
|
tool_manager_set_global_paint_options (the_gimp,
|
|
|
|
GTK_TOGGLE_BUTTON (widget)->active);
|
2000-01-26 07:05:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* no matching varible found */
|
1999-06-07 00:31:15 +08:00
|
|
|
else
|
|
|
|
{
|
2000-01-26 07:05:47 +08:00
|
|
|
/* Are you a gimp-hacker who is getting this message? You
|
|
|
|
* probably have to set your preferences value in one of the
|
|
|
|
* branches above...
|
|
|
|
*/
|
2000-09-25 09:27:47 +08:00
|
|
|
g_warning ("Unknown prefs_toggle_callback() invoker - ignored.");
|
1999-06-07 00:31:15 +08:00
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_preview_size_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2001-05-12 01:02:30 +08:00
|
|
|
/* FIXME: update preview size
|
|
|
|
lc_dialog_rebuild ((long) gtk_object_get_user_data (GTK_OBJECT (widget)));
|
|
|
|
*/
|
1998-06-09 05:53:45 +08:00
|
|
|
layer_select_update_preview_size ();
|
|
|
|
}
|
|
|
|
|
1999-09-05 06:27:20 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_nav_preview_size_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1999-09-05 06:27:20 +08:00
|
|
|
{
|
2001-07-27 07:35:00 +08:00
|
|
|
gimprc.nav_preview_size =
|
|
|
|
GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (widget)));
|
|
|
|
|
1999-11-27 21:44:54 +08:00
|
|
|
gdisplays_nav_preview_resized ();
|
1999-09-05 06:27:20 +08:00
|
|
|
}
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_string_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
gchar **val;
|
|
|
|
|
2001-07-27 07:35:00 +08:00
|
|
|
val = (gchar **) data;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strset (val, gtk_entry_get_text (GTK_ENTRY (widget)));
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
2000-03-12 08:17:30 +08:00
|
|
|
static void
|
2001-07-27 07:35:00 +08:00
|
|
|
prefs_text_callback (GtkTextBuffer *buffer,
|
|
|
|
gpointer data)
|
2000-03-12 08:17:30 +08:00
|
|
|
{
|
2001-07-27 07:35:00 +08:00
|
|
|
GtkTextIter start_iter;
|
|
|
|
GtkTextIter end_iter;
|
|
|
|
gchar **val;
|
|
|
|
gchar *text;
|
|
|
|
|
|
|
|
val = (gchar **) data;
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
gtk_text_buffer_get_bounds (buffer, &start_iter, &end_iter);
|
|
|
|
gtk_text_iter_backward_char (&end_iter);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
|
|
|
text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
|
|
|
|
|
2000-03-12 08:17:30 +08:00
|
|
|
if (strlen (text) > MAX_COMMENT_LENGTH)
|
|
|
|
{
|
2000-03-21 02:17:18 +08:00
|
|
|
g_message (_("The default comment is limited to %d characters."),
|
2000-03-12 08:17:30 +08:00
|
|
|
MAX_COMMENT_LENGTH);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, &start_iter,
|
|
|
|
MAX_COMMENT_LENGTH - 1);
|
|
|
|
gtk_text_buffer_get_end_iter (buffer, &end_iter);
|
|
|
|
|
|
|
|
/* this calls us recursivaly, but in the else branch
|
|
|
|
*/
|
|
|
|
gtk_text_buffer_delete (buffer, &start_iter, &end_iter);
|
2000-03-12 08:17:30 +08:00
|
|
|
}
|
|
|
|
else
|
2001-07-27 07:35:00 +08:00
|
|
|
{
|
|
|
|
prefs_strset (val, text);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (text);
|
2000-03-12 08:17:30 +08:00
|
|
|
}
|
|
|
|
|
1999-03-14 07:03:11 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_filename_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1999-03-14 07:03:11 +08:00
|
|
|
{
|
|
|
|
gchar **val;
|
2001-07-27 07:35:00 +08:00
|
|
|
gchar *filename;
|
|
|
|
|
|
|
|
val = (gchar **) data;
|
1999-03-14 07:03:11 +08:00
|
|
|
|
1999-11-07 02:19:41 +08:00
|
|
|
filename = gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget));
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strset (val, filename);
|
1999-11-07 02:19:41 +08:00
|
|
|
g_free (filename);
|
1999-03-14 07:03:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_path_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1999-03-14 07:03:11 +08:00
|
|
|
{
|
|
|
|
gchar **val;
|
2000-01-26 07:05:47 +08:00
|
|
|
gchar *path;
|
1999-03-14 07:03:11 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
val = (gchar **) data;
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
path = gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget));
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strset (val, path);
|
1999-11-07 02:19:41 +08:00
|
|
|
g_free (path);
|
1999-03-14 07:03:11 +08:00
|
|
|
}
|
|
|
|
|
1998-06-23 01:30:40 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_clear_session_info_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1998-06-23 01:30:40 +08:00
|
|
|
{
|
2001-07-27 07:35:00 +08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#warning FIXME: g_list_free (session_info_updates);
|
|
|
|
#endif
|
|
|
|
#if 0
|
1998-07-12 06:23:23 +08:00
|
|
|
g_list_free (session_info_updates);
|
|
|
|
session_info_updates = NULL;
|
2001-07-27 07:35:00 +08:00
|
|
|
#endif
|
1998-06-23 01:30:40 +08:00
|
|
|
}
|
|
|
|
|
1999-02-25 19:25:53 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_default_size_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_width =
|
2000-10-27 06:02:44 +08:00
|
|
|
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_height =
|
2000-10-27 06:02:44 +08:00
|
|
|
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
1999-03-03 20:35:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_default_resolution_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
2001-01-02 10:33:43 +08:00
|
|
|
GtkWidget *size_sizeentry;
|
|
|
|
static gdouble xres = 0.0;
|
|
|
|
static gdouble yres = 0.0;
|
|
|
|
gdouble new_xres;
|
|
|
|
gdouble new_yres;
|
1999-03-03 20:35:12 +08:00
|
|
|
|
|
|
|
new_xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
|
|
|
new_yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
size_sizeentry = gtk_object_get_data (GTK_OBJECT (widget), "size_sizeentry");
|
|
|
|
|
1999-03-03 20:35:12 +08:00
|
|
|
if (gimp_chain_button_get_active (GIMP_CHAIN_BUTTON (data)))
|
|
|
|
{
|
|
|
|
if (new_xres != xres)
|
|
|
|
{
|
|
|
|
yres = new_yres = xres = new_xres;
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, yres);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new_yres != yres)
|
|
|
|
{
|
|
|
|
xres = new_xres = yres = new_yres;
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, xres);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (new_xres != xres)
|
|
|
|
xres = new_xres;
|
|
|
|
if (new_yres != yres)
|
|
|
|
yres = new_yres;
|
|
|
|
}
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry),
|
1999-03-03 20:35:12 +08:00
|
|
|
0, xres, FALSE);
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry),
|
1999-03-03 20:35:12 +08:00
|
|
|
1, yres, FALSE);
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_width =
|
2000-10-27 06:02:44 +08:00
|
|
|
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0));
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_height =
|
2000-10-27 06:02:44 +08:00
|
|
|
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1));
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_xresolution = xres;
|
|
|
|
the_gimp->config->default_yresolution = yres;
|
2000-10-27 06:02:44 +08:00
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_resolution_units =
|
2000-10-27 06:02:44 +08:00
|
|
|
gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
1999-03-03 20:35:12 +08:00
|
|
|
}
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_res_source_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
1999-05-31 22:11:10 +08:00
|
|
|
GtkWidget *monitor_resolution_sizeentry;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
if (GTK_TOGGLE_BUTTON (widget)->active)
|
|
|
|
{
|
2001-07-07 20:17:23 +08:00
|
|
|
gdisplay_xserver_resolution (&gimprc.monitor_xres,
|
|
|
|
&gimprc.monitor_yres);
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.using_xserver_resolution = TRUE;
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-09-25 09:27:47 +08:00
|
|
|
monitor_resolution_sizeentry =
|
|
|
|
gtk_object_get_data (GTK_OBJECT (widget), "monitor_resolution_sizeentry");
|
2001-06-04 04:40:50 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
if (monitor_resolution_sizeentry)
|
|
|
|
{
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.monitor_xres = gimp_size_entry_get_refval
|
1999-05-23 01:56:35 +08:00
|
|
|
(GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 0);
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.monitor_yres = gimp_size_entry_get_refval
|
1999-05-23 01:56:35 +08:00
|
|
|
(GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 1);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.using_xserver_resolution = FALSE;
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-03-03 20:35:12 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_monitor_resolution_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1999-02-25 19:25:53 +08:00
|
|
|
{
|
1999-05-19 01:33:39 +08:00
|
|
|
static gdouble xres = 0.0;
|
|
|
|
static gdouble yres = 0.0;
|
2001-01-02 10:33:43 +08:00
|
|
|
gdouble new_xres;
|
|
|
|
gdouble new_yres;
|
1999-02-25 19:25:53 +08:00
|
|
|
|
|
|
|
new_xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
|
|
|
new_yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
|
|
|
|
1999-03-03 20:35:12 +08:00
|
|
|
if (gimp_chain_button_get_active (GIMP_CHAIN_BUTTON (data)))
|
1999-02-25 19:25:53 +08:00
|
|
|
{
|
|
|
|
if (new_xres != xres)
|
|
|
|
{
|
|
|
|
yres = new_yres = xres = new_xres;
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, yres);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new_yres != yres)
|
|
|
|
{
|
|
|
|
xres = new_xres = yres = new_yres;
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, xres);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (new_xres != xres)
|
|
|
|
xres = new_xres;
|
|
|
|
if (new_yres != yres)
|
|
|
|
yres = new_yres;
|
|
|
|
}
|
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.monitor_xres = xres;
|
|
|
|
gimprc.monitor_yres = yres;
|
1999-02-25 19:25:53 +08:00
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
static void
|
|
|
|
prefs_resolution_calibrate_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
2000-09-25 09:27:47 +08:00
|
|
|
{
|
|
|
|
resolution_calibrate_dialog (GTK_WIDGET (data), NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* create a new notebook page */
|
1999-11-27 21:44:54 +08:00
|
|
|
static GtkWidget *
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_notebook_append_page (GtkNotebook *notebook,
|
2001-01-02 10:33:43 +08:00
|
|
|
gchar *notebook_label,
|
|
|
|
GtkCTree *ctree,
|
|
|
|
gchar *tree_label,
|
|
|
|
gchar *help_data,
|
|
|
|
GtkCTreeNode *parent,
|
|
|
|
GtkCTreeNode **new_node,
|
|
|
|
gint page_index)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
1999-12-18 19:37:11 +08:00
|
|
|
GtkWidget *event_box;
|
1999-03-28 02:16:30 +08:00
|
|
|
GtkWidget *out_vbox;
|
|
|
|
GtkWidget *vbox;
|
1999-04-03 03:46:59 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *label;
|
1999-03-28 02:16:30 +08:00
|
|
|
gchar *titles[1];
|
|
|
|
|
1999-12-18 19:37:11 +08:00
|
|
|
event_box = gtk_event_box_new ();
|
|
|
|
gtk_widget_show (event_box);
|
|
|
|
|
|
|
|
gimp_help_set_help_data (event_box, NULL, help_data);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
out_vbox = gtk_vbox_new (FALSE, 0);
|
1999-12-18 19:37:11 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (event_box), out_vbox);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (out_vbox);
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (out_vbox), frame, FALSE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
label = gtk_label_new (notebook_label);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
|
|
|
gtk_misc_set_padding (GTK_MISC (label), 2, 1);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), label);
|
|
|
|
gtk_widget_show (label);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (out_vbox), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
titles[0] = tree_label;
|
|
|
|
*new_node = gtk_ctree_insert_node (ctree, parent, NULL,
|
|
|
|
titles, 0,
|
|
|
|
NULL, NULL, NULL, NULL,
|
1999-10-14 12:03:46 +08:00
|
|
|
FALSE, TRUE);
|
1999-11-27 21:44:54 +08:00
|
|
|
gtk_ctree_node_set_row_data (ctree, *new_node, (gpointer) page_index);
|
1999-12-18 19:37:11 +08:00
|
|
|
gtk_notebook_append_page (notebook, event_box, NULL);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
return vbox;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* select a notebook page */
|
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_tree_select_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
GtkCTreeNode *node)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
|
|
|
GtkNotebook *notebook;
|
|
|
|
gint page;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
if (! GTK_CLIST (widget)->selection)
|
|
|
|
return;
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
notebook = (GtkNotebook*) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
page = (gint) gtk_ctree_node_get_row_data (GTK_CTREE (widget), node);
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_notebook_set_page (notebook, page);
|
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-11-27 21:44:54 +08:00
|
|
|
/* create a frame with title and a vbox */
|
|
|
|
static GtkWidget *
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_frame_new (gchar *label,
|
2001-01-02 10:33:43 +08:00
|
|
|
GtkBox *vbox)
|
1999-11-27 21:44:54 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
|
1999-11-27 22:08:30 +08:00
|
|
|
frame = gtk_frame_new (label);
|
1999-11-27 21:44:54 +08:00
|
|
|
gtk_box_pack_start (vbox, frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
vbox2 = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
|
|
|
|
return vbox2;
|
|
|
|
}
|
|
|
|
|
1999-12-18 19:37:11 +08:00
|
|
|
static void
|
2000-11-18 08:25:42 +08:00
|
|
|
prefs_help_func (const gchar *help_data)
|
1999-12-18 19:37:11 +08:00
|
|
|
{
|
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *event_box;
|
2001-01-02 10:33:43 +08:00
|
|
|
gint page_num;
|
1999-12-18 19:37:11 +08:00
|
|
|
|
2001-01-02 10:33:43 +08:00
|
|
|
notebook = gtk_object_get_user_data (GTK_OBJECT (prefs_dlg));
|
|
|
|
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
|
1999-12-18 19:37:11 +08:00
|
|
|
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
|
|
|
|
|
|
|
|
help_data = gtk_object_get_data (GTK_OBJECT (event_box), "gimp_help_data");
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
gimp_standard_help_func (help_data);
|
1999-12-18 19:37:11 +08:00
|
|
|
}
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/************************************************************************
|
|
|
|
* create the preferences dialog
|
|
|
|
*/
|
2001-04-19 00:39:34 +08:00
|
|
|
GtkWidget *
|
2001-02-24 10:42:09 +08:00
|
|
|
preferences_dialog_create (void)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
1999-05-31 22:11:10 +08:00
|
|
|
GtkWidget *ctree;
|
|
|
|
gchar *titles[1];
|
|
|
|
GtkCTreeNode *top_insert;
|
|
|
|
GtkCTreeNode *child_insert;
|
|
|
|
gint page_index;
|
|
|
|
|
2001-07-27 07:35:00 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *abox;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *fileselection;
|
|
|
|
GtkWidget *patheditor;
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
GtkWidget *combo;
|
|
|
|
GtkWidget *comboitem;
|
|
|
|
GtkWidget *optionmenu;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkObject *adjustment;
|
|
|
|
GtkWidget *sizeentry;
|
|
|
|
GtkWidget *sizeentry2;
|
|
|
|
GtkWidget *separator;
|
|
|
|
GtkWidget *calibrate_button;
|
2001-07-27 23:18:20 +08:00
|
|
|
GtkWidget *scrolled_window;
|
2001-07-27 07:35:00 +08:00
|
|
|
GtkWidget *text_view;
|
|
|
|
GtkTextBuffer *text_buffer;
|
|
|
|
GSList *group;
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2001-01-02 10:33:43 +08:00
|
|
|
gint i;
|
2000-02-04 12:31:18 +08:00
|
|
|
gchar *pixels_per_unit;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
if (prefs_dlg)
|
2001-04-19 00:39:34 +08:00
|
|
|
return prefs_dlg;
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
if (edit_temp_path == NULL)
|
|
|
|
{
|
2000-01-26 07:05:47 +08:00
|
|
|
/* first time dialog is opened -
|
|
|
|
* copy config vals to edit variables.
|
|
|
|
*/
|
2001-05-15 19:25:25 +08:00
|
|
|
edit_stingy_memory_use = base_config->stingy_memory_use;
|
2001-06-04 04:40:50 +08:00
|
|
|
edit_min_colors = gimprc.min_colors;
|
|
|
|
edit_install_cmap = gimprc.install_cmap;
|
|
|
|
edit_cycled_marching_ants = gimprc.cycled_marching_ants;
|
|
|
|
edit_last_opened_size = gimprc.last_opened_size;
|
|
|
|
edit_show_indicators = gimprc.show_indicators;
|
|
|
|
edit_nav_window_per_display = gimprc.nav_window_per_display;
|
|
|
|
edit_info_window_follows_mouse = gimprc.info_window_follows_mouse;
|
|
|
|
edit_disable_tearoff_menus = gimprc.disable_tearoff_menus;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
edit_temp_path = prefs_strdup (base_config->temp_path);
|
|
|
|
edit_swap_path = prefs_strdup (base_config->swap_path);
|
2001-07-07 20:17:23 +08:00
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
edit_plug_in_path = prefs_strdup (the_gimp->config->plug_in_path);
|
|
|
|
edit_module_path = prefs_strdup (the_gimp->config->module_path);
|
|
|
|
edit_brush_path = prefs_strdup (the_gimp->config->brush_path);
|
|
|
|
edit_pattern_path = prefs_strdup (the_gimp->config->pattern_path);
|
|
|
|
edit_palette_path = prefs_strdup (the_gimp->config->palette_path);
|
|
|
|
edit_gradient_path = prefs_strdup (the_gimp->config->gradient_path);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* assign edit variables for values which get changed on "OK" and "Save"
|
|
|
|
* but not on the fly.
|
|
|
|
*/
|
2001-05-15 19:25:25 +08:00
|
|
|
edit_tile_cache_size = base_config->tile_cache_size;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* remember all old values */
|
2001-05-15 19:25:25 +08:00
|
|
|
old_interpolation_type = base_config->interpolation_type;
|
2001-05-26 00:24:44 +08:00
|
|
|
old_num_processors = base_config->num_processors;
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
old_default_type = the_gimp->config->default_type;
|
|
|
|
old_default_width = the_gimp->config->default_width;
|
|
|
|
old_default_height = the_gimp->config->default_height;
|
|
|
|
old_default_units = the_gimp->config->default_units;
|
|
|
|
old_default_xresolution = the_gimp->config->default_xresolution;
|
|
|
|
old_default_yresolution = the_gimp->config->default_yresolution;
|
|
|
|
old_default_resolution_units = the_gimp->config->default_resolution_units;
|
|
|
|
old_levels_of_undo = the_gimp->config->levels_of_undo;
|
|
|
|
old_thumbnail_mode = the_gimp->config->thumbnail_mode;
|
2001-07-07 20:17:23 +08:00
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
old_perfectmouse = gimprc.perfectmouse;
|
|
|
|
old_transparency_type = gimprc.transparency_type;
|
|
|
|
old_transparency_size = gimprc.transparency_size;
|
|
|
|
old_marching_speed = gimprc.marching_speed;
|
|
|
|
old_allow_resize_windows = gimprc.allow_resize_windows;
|
|
|
|
old_auto_save = gimprc.auto_save;
|
|
|
|
old_preview_size = gimprc.preview_size;
|
|
|
|
old_nav_preview_size = gimprc.nav_preview_size;
|
|
|
|
old_no_cursor_updating = gimprc.no_cursor_updating;
|
|
|
|
old_show_tool_tips = gimprc.show_tool_tips;
|
|
|
|
old_show_rulers = gimprc.show_rulers;
|
|
|
|
old_show_statusbar = gimprc.show_statusbar;
|
|
|
|
old_confirm_on_close = gimprc.confirm_on_close;
|
|
|
|
old_save_session_info = gimprc.save_session_info;
|
|
|
|
old_save_device_status = gimprc.save_device_status;
|
|
|
|
old_always_restore_session = gimprc.always_restore_session;
|
|
|
|
old_default_dot_for_dot = gimprc.default_dot_for_dot;
|
|
|
|
old_monitor_xres = gimprc.monitor_xres;
|
|
|
|
old_monitor_yres = gimprc.monitor_yres;
|
|
|
|
old_using_xserver_resolution = gimprc.using_xserver_resolution;
|
|
|
|
old_global_paint_options = gimprc.global_paint_options;
|
|
|
|
old_max_new_image_size = gimprc.max_new_image_size;
|
|
|
|
old_trust_dirty_flag = gimprc.trust_dirty_flag;
|
|
|
|
old_use_help = gimprc.use_help;
|
|
|
|
old_help_browser = gimprc.help_browser;
|
|
|
|
old_cursor_mode = gimprc.cursor_mode;
|
|
|
|
old_default_threshold = gimprc.default_threshold;
|
|
|
|
|
|
|
|
prefs_strset (&old_image_title_format, gimprc.image_title_format);
|
2001-07-11 20:39:49 +08:00
|
|
|
prefs_strset (&old_default_comment, the_gimp->config->default_comment);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* values which will need a restart */
|
|
|
|
old_stingy_memory_use = edit_stingy_memory_use;
|
2000-05-01 02:17:55 +08:00
|
|
|
old_min_colors = edit_min_colors;
|
2000-01-26 07:05:47 +08:00
|
|
|
old_install_cmap = edit_install_cmap;
|
|
|
|
old_cycled_marching_ants = edit_cycled_marching_ants;
|
|
|
|
old_last_opened_size = edit_last_opened_size;
|
|
|
|
old_show_indicators = edit_show_indicators;
|
|
|
|
old_nav_window_per_display = edit_nav_window_per_display;
|
|
|
|
old_info_window_follows_mouse = edit_info_window_follows_mouse;
|
2001-01-02 10:33:43 +08:00
|
|
|
old_disable_tearoff_menus = edit_disable_tearoff_menus;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_strset (&old_temp_path, edit_temp_path);
|
|
|
|
prefs_strset (&old_swap_path, edit_swap_path);
|
|
|
|
prefs_strset (&old_plug_in_path, edit_plug_in_path);
|
|
|
|
prefs_strset (&old_module_path, edit_module_path);
|
|
|
|
prefs_strset (&old_brush_path, edit_brush_path);
|
|
|
|
prefs_strset (&old_pattern_path, edit_pattern_path);
|
|
|
|
prefs_strset (&old_palette_path, edit_palette_path);
|
|
|
|
prefs_strset (&old_gradient_path, edit_gradient_path);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
/* values which will be changed on "OK" and "Save" */
|
|
|
|
old_tile_cache_size = edit_tile_cache_size;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
/* Create the dialog */
|
|
|
|
prefs_dlg =
|
1999-04-05 20:48:48 +08:00
|
|
|
gimp_dialog_new (_("Preferences"), "gimp_preferences",
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_help_func,
|
1999-10-04 16:40:33 +08:00
|
|
|
"dialogs/preferences/preferences.html",
|
1999-09-28 01:58:10 +08:00
|
|
|
GTK_WIN_POS_NONE,
|
1999-10-11 09:47:58 +08:00
|
|
|
FALSE, TRUE, FALSE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2001-07-31 01:17:36 +08:00
|
|
|
GTK_STOCK_OK, prefs_ok_callback,
|
|
|
|
NULL, NULL, NULL, TRUE, FALSE,
|
|
|
|
GTK_STOCK_SAVE, prefs_save_callback,
|
2000-01-07 00:40:17 +08:00
|
|
|
NULL, NULL, NULL, FALSE, FALSE,
|
2001-07-31 01:17:36 +08:00
|
|
|
GTK_STOCK_CANCEL, prefs_cancel_callback,
|
|
|
|
NULL, NULL, NULL, FALSE, TRUE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* The main hbox */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (prefs_dlg)->vbox), hbox);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
/* The categories tree */
|
|
|
|
titles[0] = _("Categories");
|
|
|
|
ctree = gtk_ctree_new_with_titles (1, 0, titles);
|
|
|
|
gtk_ctree_set_indent (GTK_CTREE (ctree), 15);
|
1999-06-17 23:01:01 +08:00
|
|
|
gtk_clist_column_titles_passive (GTK_CLIST (ctree));
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), ctree, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
/* The main preferences notebook */
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
notebook = gtk_notebook_new ();
|
|
|
|
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
|
|
|
|
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), notebook);
|
|
|
|
|
1999-12-18 19:37:11 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (prefs_dlg), notebook);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (ctree), notebook);
|
1999-12-18 19:37:11 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (ctree), "tree_select_row",
|
|
|
|
G_CALLBACK (prefs_tree_select_callback),
|
|
|
|
NULL);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
page_index = 0;
|
|
|
|
|
|
|
|
/* New File page */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2000-02-01 05:40:17 +08:00
|
|
|
_("New File"),
|
1999-03-28 02:16:30 +08:00
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("New File"),
|
1999-12-18 19:37:11 +08:00
|
|
|
"dialogs/preferences/new_file.html",
|
2001-06-04 04:40:50 +08:00
|
|
|
NULL,
|
1999-03-28 02:16:30 +08:00
|
|
|
&top_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
/* select this page in the tree */
|
|
|
|
gtk_ctree_select (GTK_CTREE (ctree), top_insert);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Default Image Size and Unit"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
sizeentry =
|
2001-07-11 20:39:49 +08:00
|
|
|
gimp_size_entry_new (2, the_gimp->config->default_units, "%p",
|
2001-07-07 20:17:23 +08:00
|
|
|
FALSE, FALSE, TRUE, 75,
|
1999-05-31 22:11:10 +08:00
|
|
|
GIMP_SIZE_ENTRY_UPDATE_SIZE);
|
|
|
|
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
|
|
|
_("Width"), 0, 1, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
|
|
|
_("Height"), 0, 2, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
|
|
|
_("Pixels"), 1, 4, 0.0);
|
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0,
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_xresolution, FALSE);
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 1,
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_yresolution, FALSE);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_set_refval_boundaries
|
1999-05-31 22:11:10 +08:00
|
|
|
(GIMP_SIZE_ENTRY (sizeentry), 0, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE);
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_set_refval_boundaries
|
1999-05-31 22:11:10 +08:00
|
|
|
(GIMP_SIZE_ENTRY (sizeentry), 1, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE);
|
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0,
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_width);
|
2001-06-04 04:40:50 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1,
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_height);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (sizeentry), "unit_changed",
|
|
|
|
G_CALLBACK (prefs_default_size_callback),
|
|
|
|
NULL);
|
|
|
|
g_signal_connect (G_OBJECT (sizeentry), "value_changed",
|
|
|
|
G_CALLBACK (prefs_default_size_callback),
|
|
|
|
NULL);
|
|
|
|
g_signal_connect (G_OBJECT (sizeentry), "refval_changed",
|
|
|
|
G_CALLBACK (prefs_default_size_callback),
|
|
|
|
NULL);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), sizeentry, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (sizeentry);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Default Image Resolution and Resolution Unit"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2000-02-04 12:31:18 +08:00
|
|
|
pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL);
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
sizeentry2 = gimp_size_entry_new (2, the_gimp->config->default_resolution_units,
|
2001-07-07 20:17:23 +08:00
|
|
|
pixels_per_unit,
|
|
|
|
FALSE, FALSE, TRUE, 75,
|
|
|
|
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM);
|
2001-07-11 20:39:49 +08:00
|
|
|
if (ABS (the_gimp->config->default_xresolution -
|
|
|
|
the_gimp->config->default_yresolution) < GIMP_MIN_RESOLUTION)
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE);
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (sizeentry2), button, 1, 3, 3, 4);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
|
|
|
|
_("Horizontal"), 0, 1, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
|
|
|
|
_("Vertical"), 0, 2, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
|
|
|
|
_("dpi"), 1, 4, 0.0);
|
|
|
|
|
|
|
|
gtk_object_set_data (GTK_OBJECT (sizeentry2), "size_sizeentry", sizeentry);
|
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_set_refval_boundaries
|
1999-05-31 22:11:10 +08:00
|
|
|
(GIMP_SIZE_ENTRY (sizeentry2), 0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION);
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_set_refval_boundaries
|
1999-05-31 22:11:10 +08:00
|
|
|
(GIMP_SIZE_ENTRY (sizeentry2), 1, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), 0,
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_xresolution);
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), 1,
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->default_yresolution);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (sizeentry2), "unit_changed",
|
|
|
|
G_CALLBACK (prefs_default_resolution_callback),
|
|
|
|
button);
|
|
|
|
g_signal_connect (G_OBJECT (sizeentry2), "value_changed",
|
|
|
|
G_CALLBACK (prefs_default_resolution_callback),
|
|
|
|
button);
|
|
|
|
g_signal_connect (G_OBJECT (sizeentry2), "refval_changed",
|
|
|
|
G_CALLBACK (prefs_default_resolution_callback),
|
|
|
|
button);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), sizeentry2, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (sizeentry2);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2000-01-16 02:13:13 +08:00
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
2001-07-11 20:39:49 +08:00
|
|
|
&the_gimp->config->default_type,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (the_gimp->config->default_type),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("RGB"), GINT_TO_POINTER (RGB), NULL,
|
|
|
|
_("Grayscale"), GINT_TO_POINTER (GRAY), NULL,
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Default Image Type:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
optionmenu, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-03-15 07:06:21 +08:00
|
|
|
/* The maximum size of a new image */
|
2001-06-04 04:40:50 +08:00
|
|
|
adjustment = gtk_adjustment_new (gimprc.max_new_image_size,
|
2000-05-21 02:39:02 +08:00
|
|
|
0, (4069.0 * 1024 * 1024 - 1),
|
|
|
|
1.0, 1.0, 0.0);
|
2000-03-15 07:06:21 +08:00
|
|
|
hbox = gimp_mem_size_entry_new (GTK_ADJUSTMENT (adjustment));
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Maximum Image Size:"), 1.0, 0.5,
|
|
|
|
hbox, 1, TRUE);
|
2000-01-16 02:13:13 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_uint_adjustment_update),
|
|
|
|
&gimprc.max_new_image_size);
|
|
|
|
|
2000-03-12 08:17:30 +08:00
|
|
|
/* Default Comment page */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Default Comment"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Default Comment"),
|
|
|
|
"dialogs/preferences/new_file.html#default_comment",
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
2000-03-12 08:17:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Comment Used for New Images"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
2001-07-27 23:18:20 +08:00
|
|
|
|
|
|
|
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
|
|
|
GTK_POLICY_AUTOMATIC,
|
|
|
|
GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), scrolled_window);
|
|
|
|
gtk_widget_show (scrolled_window);
|
2000-03-12 08:17:30 +08:00
|
|
|
|
2001-07-27 07:35:00 +08:00
|
|
|
text_buffer = gtk_text_buffer_new (NULL);
|
|
|
|
gtk_text_buffer_set_text (text_buffer, the_gimp->config->default_comment, -1);
|
|
|
|
|
|
|
|
text_view = gtk_text_view_new_with_buffer (text_buffer);
|
2001-07-27 23:18:20 +08:00
|
|
|
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
2001-07-27 07:35:00 +08:00
|
|
|
gtk_widget_show (text_view);
|
|
|
|
|
|
|
|
g_object_unref (G_OBJECT (text_buffer));
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (text_buffer), "changed",
|
2001-07-25 08:42:47 +08:00
|
|
|
G_CALLBACK (prefs_text_callback),
|
|
|
|
&the_gimp->config->default_comment);
|
2000-01-16 02:13:13 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* Display page */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Display"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Display"),
|
|
|
|
"dialogs/preferences/display.html",
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Transparency"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
1999-11-27 21:44:54 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
optionmenu = gimp_option_menu_new2
|
|
|
|
(FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.transparency_type,
|
|
|
|
GINT_TO_POINTER (gimprc.transparency_type),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("Light Checks"), GINT_TO_POINTER (LIGHT_CHECKS), NULL,
|
|
|
|
_("Mid-Tone Checks"), GINT_TO_POINTER (GRAY_CHECKS), NULL,
|
|
|
|
_("Dark Checks"), GINT_TO_POINTER (DARK_CHECKS), NULL,
|
|
|
|
_("White Only"), GINT_TO_POINTER (WHITE_ONLY), NULL,
|
|
|
|
_("Gray Only"), GINT_TO_POINTER (GRAY_ONLY), NULL,
|
|
|
|
_("Black Only"), GINT_TO_POINTER (BLACK_ONLY), NULL,
|
|
|
|
|
|
|
|
NULL);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Transparency Type:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
optionmenu, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
2001-07-07 20:17:23 +08:00
|
|
|
&gimprc.transparency_size,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (gimprc.transparency_size),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("Small"), GINT_TO_POINTER (SMALL_CHECKS), NULL,
|
|
|
|
_("Medium"), GINT_TO_POINTER (MEDIUM_CHECKS), NULL,
|
|
|
|
_("Large"), GINT_TO_POINTER (LARGE_CHECKS), NULL,
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Check Size:"), 1.0, 0.5,
|
|
|
|
optionmenu, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("8-Bit Displays"), GTK_BOX (vbox));
|
1999-11-27 21:44:54 +08:00
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
if (g_visual->depth != 8)
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (vbox2->parent), FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-05-01 02:17:55 +08:00
|
|
|
table = gtk_table_new (1, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
spinbutton =
|
|
|
|
gimp_spin_button_new (&adjustment, edit_min_colors,
|
|
|
|
27.0,
|
|
|
|
gtk_check_version (1, 2, 8) ? 216.0 : 256.0,
|
|
|
|
1.0, 8.0, 0.0, 1.0, 0.0);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Minimum Number of Colors:"), 1.0, 0.5,
|
|
|
|
spinbutton, 1, TRUE);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&edit_min_colors);
|
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
button = gtk_check_button_new_with_label(_("Install Colormap"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2000-01-26 07:05:47 +08:00
|
|
|
edit_install_cmap);
|
2000-01-15 20:52:31 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&edit_install_cmap);
|
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
button = gtk_check_button_new_with_label(_("Colormap Cycling"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2000-01-26 07:05:47 +08:00
|
|
|
edit_cycled_marching_ants);
|
2000-01-15 20:52:31 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&edit_cycled_marching_ants);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
/* Interface */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Interface"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Interface"),
|
|
|
|
"dialogs/preferences/interface.html",
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("General"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-09-05 06:27:20 +08:00
|
|
|
table = gtk_table_new (4, 2, FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
1999-11-20 08:46:58 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
/* Don't show the Auto-save button until we really
|
|
|
|
have auto-saving in the gimp.
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Auto save"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
auto_save);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
auto_save);
|
1999-03-28 02:16:30 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_preview_size_callback),
|
2001-07-07 20:17:23 +08:00
|
|
|
&gimprc.preview_size,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (gimprc.preview_size),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("None"), GINT_TO_POINTER (0), NULL,
|
|
|
|
_("Tiny"), GINT_TO_POINTER (24), NULL,
|
|
|
|
_("Small"), GINT_TO_POINTER (32), NULL,
|
|
|
|
_("Medium"), GINT_TO_POINTER (48), NULL,
|
|
|
|
_("Large"), GINT_TO_POINTER (64), NULL,
|
|
|
|
_("Huge"), GINT_TO_POINTER (128), NULL,
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Preview Size:"), 1.0, 0.5,
|
|
|
|
optionmenu, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-09-05 06:27:20 +08:00
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_nav_preview_size_callback),
|
2001-07-07 20:17:23 +08:00
|
|
|
&gimprc.nav_preview_size,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (gimprc.nav_preview_size),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("Small"), GINT_TO_POINTER (48), NULL,
|
|
|
|
_("Medium"), GINT_TO_POINTER (80), NULL,
|
|
|
|
_("Large"), GINT_TO_POINTER (112), NULL,
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Nav Preview Size:"), 1.0, 0.5,
|
|
|
|
optionmenu, 1, TRUE);
|
1999-09-05 06:27:20 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
spinbutton = gimp_spin_button_new (&adjustment, edit_last_opened_size,
|
|
|
|
0.0, 16.0, 1.0, 5.0, 0.0, 1.0, 0.0);
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Recent Documents List Size:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
spinbutton, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&edit_last_opened_size);
|
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
/* Indicators */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Toolbox"), GTK_BOX (vbox));
|
2000-01-15 20:52:31 +08:00
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label
|
|
|
|
(_("Display Brush, Pattern and Gradient Indicators"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2000-01-26 07:05:47 +08:00
|
|
|
edit_show_indicators);
|
2000-01-15 20:52:31 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&edit_show_indicators);
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Dialog Behaviour"), GTK_BOX (vbox));
|
1999-11-20 22:27:07 +08:00
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label (_("Navigation Window per Display"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
edit_nav_window_per_display);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&edit_nav_window_per_display);
|
|
|
|
|
1999-11-30 08:11:08 +08:00
|
|
|
button = gtk_check_button_new_with_label (_("Info Window Follows Mouse"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
edit_info_window_follows_mouse);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&edit_info_window_follows_mouse);
|
|
|
|
|
2001-01-02 10:33:43 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Menus"), GTK_BOX (vbox));
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label (_("Disable Tearoff Menus"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
edit_disable_tearoff_menus);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&edit_disable_tearoff_menus);
|
|
|
|
|
1999-11-20 22:27:07 +08:00
|
|
|
/* Interface / Help System */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Help System"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Help System"),
|
|
|
|
"dialogs/preferences/interface.html#help_system",
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
1999-11-20 22:27:07 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("General"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
button = gtk_check_button_new_with_label (_("Show Tool Tips"));
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.show_tool_tips);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.show_tool_tips);
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
button =
|
|
|
|
gtk_check_button_new_with_label (_("Context Sensitive Help with \"F1\""));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.use_help);
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.use_help);
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Help Browser"), GTK_BOX (vbox));
|
1999-12-20 01:15:11 +08:00
|
|
|
|
|
|
|
table = gtk_table_new (1, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
optionmenu = gimp_option_menu_new2
|
|
|
|
(FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.help_browser,
|
|
|
|
GINT_TO_POINTER (gimprc.help_browser),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("Internal"), GINT_TO_POINTER (HELP_BROWSER_GIMP), NULL,
|
|
|
|
_("Netscape"), GINT_TO_POINTER (HELP_BROWSER_NETSCAPE), NULL,
|
|
|
|
|
|
|
|
NULL);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
1999-12-20 01:15:11 +08:00
|
|
|
_("Help Browser to Use:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
optionmenu, 1, TRUE);
|
1999-12-20 01:15:11 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* Interface / Image Windows */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Image Windows"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Image Windows"),
|
|
|
|
"dialogs/preferences/interface.html#image_windows",
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Appearance"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
button = gtk_check_button_new_with_label (_("Use \"Dot for Dot\" by default"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.default_dot_for_dot);
|
2000-01-15 20:52:31 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.default_dot_for_dot);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
button = gtk_check_button_new_with_label(_("Resize Window on Zoom"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.allow_resize_windows);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
1999-11-27 21:44:54 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.allow_resize_windows);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
button = gtk_check_button_new_with_label(_("Show Rulers"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.show_rulers);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.show_rulers);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
button = gtk_check_button_new_with_label(_("Show Statusbar"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.show_statusbar);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.show_statusbar);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
spinbutton = gimp_spin_button_new (&adjustment, gimprc.marching_speed,
|
|
|
|
50.0, 32000.0, 10.0, 100.0, 1.0, 1.0, 0.0);
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Marching Ants Speed:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
spinbutton, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&gimprc.marching_speed);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* The title format string */
|
|
|
|
combo = gtk_combo_new ();
|
|
|
|
gtk_combo_set_use_arrows (GTK_COMBO (combo), FALSE);
|
|
|
|
gtk_combo_set_value_in_list (GTK_COMBO (combo), FALSE, FALSE);
|
|
|
|
/* Set the currently used string as "Custom" */
|
|
|
|
comboitem = gtk_list_item_new_with_label (_("Custom"));
|
|
|
|
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.image_title_format);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
|
|
|
gtk_widget_show (comboitem);
|
|
|
|
/* set some commonly used format strings */
|
|
|
|
comboitem = gtk_list_item_new_with_label (_("Standard"));
|
|
|
|
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
|
|
|
"%f-%p.%i (%t)");
|
|
|
|
gtk_container_add(GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
|
|
|
gtk_widget_show (comboitem);
|
|
|
|
comboitem = gtk_list_item_new_with_label (_("Show zoom percentage"));
|
|
|
|
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
|
|
|
"%f-%p.%i (%t) %z%%");
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
|
|
|
gtk_widget_show (comboitem);
|
|
|
|
comboitem = gtk_list_item_new_with_label (_("Show zoom ratio"));
|
|
|
|
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
|
|
|
"%f-%p.%i (%t) %d:%s");
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
|
|
|
gtk_widget_show (comboitem);
|
|
|
|
comboitem = gtk_list_item_new_with_label (_("Show reversed zoom ratio"));
|
|
|
|
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
|
|
|
"%f-%p.%i (%t) %s:%d");
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
|
|
|
gtk_widget_show (comboitem);
|
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Image Title Format:"), 1.0, 0.5,
|
|
|
|
combo, 1, FALSE);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
|
|
|
G_CALLBACK (prefs_string_callback),
|
|
|
|
&gimprc.image_title_format);
|
1999-03-28 02:16:30 +08:00
|
|
|
/* End of the title format string */
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
button =
|
2000-01-15 20:52:31 +08:00
|
|
|
gtk_check_button_new_with_label (_("Perfect-but-Slow Pointer Tracking"));
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.perfectmouse);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
1999-11-27 21:44:54 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.perfectmouse);
|
|
|
|
|
2000-01-10 01:31:00 +08:00
|
|
|
button = gtk_check_button_new_with_label (_("Disable Cursor Updating"));
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.no_cursor_updating);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.no_cursor_updating);
|
|
|
|
|
2000-06-06 08:28:28 +08:00
|
|
|
table = gtk_table_new (1, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
2001-07-07 20:17:23 +08:00
|
|
|
&gimprc.cursor_mode,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (gimprc.cursor_mode),
|
2000-06-06 08:28:28 +08:00
|
|
|
|
|
|
|
_("Tool Icon"),
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (CURSOR_MODE_TOOL_ICON), NULL,
|
2000-06-06 08:28:28 +08:00
|
|
|
_("Tool Icon with Crosshair"),
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (CURSOR_MODE_TOOL_CROSSHAIR), NULL,
|
2000-06-06 08:28:28 +08:00
|
|
|
_("Crosshair only"),
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (CURSOR_MODE_CROSSHAIR), NULL,
|
2000-06-06 08:28:28 +08:00
|
|
|
|
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-06-06 08:28:28 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Cursor Mode:"), 1.0, 0.5,
|
|
|
|
optionmenu, 1, TRUE);
|
|
|
|
|
2000-01-16 02:13:13 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* Interface / Tool Options */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Tool Options"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Tool Options"),
|
|
|
|
"dialogs/preferences/interface.html#tool_options",
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
1999-04-22 22:34:00 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Paint Options"), GTK_BOX (vbox));
|
1999-04-22 22:34:00 +08:00
|
|
|
|
|
|
|
button =
|
|
|
|
gtk_check_button_new_with_label(_("Use Global Paint Options"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.global_paint_options);
|
1999-04-22 22:34:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.global_paint_options);
|
|
|
|
|
2001-01-02 10:33:43 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Finding Contiguous Regions"), GTK_BOX (vbox));
|
2000-04-19 22:02:05 +08:00
|
|
|
|
|
|
|
table = gtk_table_new (1, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
/* Default threshold */
|
2001-07-25 08:42:47 +08:00
|
|
|
spinbutton = gimp_spin_button_new (&adjustment, gimprc.default_threshold,
|
|
|
|
0.0, 255.0, 1.0, 5.0, 0.0, 1.0, 0.0);
|
2000-04-19 22:02:05 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Default Threshold:"), 1.0, 0.5,
|
|
|
|
spinbutton, 1, TRUE);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&gimprc.default_threshold);
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
/* Expand the "Interface" branch */
|
|
|
|
gtk_ctree_expand (GTK_CTREE (ctree), top_insert);
|
|
|
|
|
2000-01-16 02:13:13 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* Environment */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Environment"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Environment"),
|
|
|
|
"dialogs/preferences/environment.html",
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Resource Consumption"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Conservative Memory Usage"));
|
2000-01-26 07:05:47 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
edit_stingy_memory_use);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&edit_stingy_memory_use);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
#ifdef ENABLE_MP
|
2000-01-15 20:52:31 +08:00
|
|
|
table = gtk_table_new (3, 2, FALSE);
|
2000-01-16 02:13:13 +08:00
|
|
|
#else
|
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
1999-04-03 03:46:59 +08:00
|
|
|
#endif /* ENABLE_MP */
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
/* Levels of Undo */
|
2001-07-25 08:42:47 +08:00
|
|
|
spinbutton = gimp_spin_button_new (&adjustment,
|
|
|
|
the_gimp->config->levels_of_undo,
|
2001-07-07 20:17:23 +08:00
|
|
|
0.0, 255.0, 1.0, 5.0, 0.0, 1.0, 0.0);
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Levels of Undo:"), 1.0, 0.5,
|
|
|
|
spinbutton, 1, TRUE);
|
2000-01-15 20:52:31 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&the_gimp->config->levels_of_undo);
|
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
/* The tile cache size */
|
2000-03-15 07:06:21 +08:00
|
|
|
adjustment = gtk_adjustment_new (edit_tile_cache_size,
|
2000-05-21 02:39:02 +08:00
|
|
|
0, (4069.0 * 1024 * 1024 - 1),
|
|
|
|
1.0, 1.0, 0.0);
|
2000-03-15 07:06:21 +08:00
|
|
|
hbox = gimp_mem_size_entry_new (GTK_ADJUSTMENT (adjustment));
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Tile Cache Size:"), 1.0, 0.5,
|
|
|
|
hbox, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_uint_adjustment_update),
|
|
|
|
&edit_tile_cache_size);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
#ifdef ENABLE_MP
|
1999-04-03 03:46:59 +08:00
|
|
|
spinbutton =
|
2001-05-26 00:24:44 +08:00
|
|
|
gimp_spin_button_new (&adjustment, base_config->num_processors,
|
2000-01-26 07:05:47 +08:00
|
|
|
1, 30, 1.0, 2.0, 0.0, 1.0, 0.0);
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Number of Processors to Use:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
spinbutton, 1, TRUE);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_int_adjustment_update),
|
|
|
|
&base_config->num_processors);
|
1999-03-28 02:16:30 +08:00
|
|
|
#endif /* ENABLE_MP */
|
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
frame = gtk_frame_new (_("Scaling"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
table = gtk_table_new (1, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-01-15 20:52:31 +08:00
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
2001-05-15 19:25:25 +08:00
|
|
|
&base_config->interpolation_type,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (base_config->interpolation_type),
|
2000-01-15 20:52:31 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
_("Nearest Neighbor (Fast)"),
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (NEAREST_NEIGHBOR_INTERPOLATION), NULL,
|
2000-01-27 09:22:27 +08:00
|
|
|
_("Linear"),
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (LINEAR_INTERPOLATION), NULL,
|
2000-01-27 09:22:27 +08:00
|
|
|
_("Cubic (Slow)"),
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (CUBIC_INTERPOLATION), NULL,
|
2000-01-15 20:52:31 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
2000-01-15 20:52:31 +08:00
|
|
|
_("Interpolation Type:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
optionmenu, 1, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("File Saving"), GTK_BOX (vbox));
|
1999-06-07 00:31:15 +08:00
|
|
|
|
1999-06-17 23:01:01 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
1999-09-24 04:21:15 +08:00
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
1999-06-17 23:01:01 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
1999-06-07 00:31:15 +08:00
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
2001-07-11 20:39:49 +08:00
|
|
|
&the_gimp->config->thumbnail_mode,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (the_gimp->config->thumbnail_mode),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("Always"), GINT_TO_POINTER (TRUE), NULL,
|
|
|
|
_("Never"), GINT_TO_POINTER (FALSE), NULL,
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
1999-06-17 23:01:01 +08:00
|
|
|
_("Try to Write a Thumbnail File:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
optionmenu, 1, TRUE);
|
1999-06-07 00:31:15 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
optionmenu =
|
2001-07-25 08:42:47 +08:00
|
|
|
gimp_option_menu_new2 (FALSE,
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
2001-07-07 20:17:23 +08:00
|
|
|
&gimprc.trust_dirty_flag,
|
2001-07-25 08:42:47 +08:00
|
|
|
GINT_TO_POINTER (gimprc.trust_dirty_flag),
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
_("Only when Modified"), GINT_TO_POINTER (TRUE), NULL,
|
|
|
|
_("Always"), GINT_TO_POINTER (FALSE), NULL,
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-01-27 09:22:27 +08:00
|
|
|
NULL);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
2000-01-26 07:05:47 +08:00
|
|
|
_("\"File > Save\" Saves the Image:"), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
optionmenu, 1, TRUE);
|
1999-09-24 04:21:15 +08:00
|
|
|
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* Session Management */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Session Management"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Session"),
|
|
|
|
"dialogs/preferences/session.html",
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Window Positions"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label (_("Save Window Positions on Exit"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.save_session_info);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.save_session_info);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
1999-12-14 22:10:34 +08:00
|
|
|
button = gtk_button_new_with_label (_("Clear Saved Window Positions Now"));
|
2000-02-14 21:23:12 +08:00
|
|
|
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "clicked",
|
|
|
|
G_CALLBACK (prefs_clear_session_info_callback),
|
|
|
|
NULL);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
button = gtk_check_button_new_with_label (_("Always Try to Restore Session"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.always_restore_session);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.always_restore_session);
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Devices"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label (_("Save Device Status on Exit"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
2001-06-04 04:40:50 +08:00
|
|
|
gimprc.save_device_status);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_toggle_callback),
|
|
|
|
&gimprc.save_device_status);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* Monitor */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Monitor"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Monitor"),
|
|
|
|
"dialogs/preferences/monitor.html",
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Get Monitor Resolution"), GTK_BOX (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
{
|
2000-03-15 07:06:21 +08:00
|
|
|
gdouble xres, yres;
|
|
|
|
gchar *str;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
gdisplay_xserver_resolution (&xres, &yres);
|
|
|
|
|
2000-03-15 07:06:21 +08:00
|
|
|
str = g_strdup_printf (_("(Currently %d x %d dpi)"),
|
|
|
|
ROUND (xres), ROUND (yres));
|
|
|
|
label = gtk_label_new (str);
|
|
|
|
g_free (str);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
sizeentry =
|
2000-02-08 04:35:13 +08:00
|
|
|
gimp_size_entry_new (2, GIMP_UNIT_INCH, pixels_per_unit,
|
|
|
|
FALSE, FALSE, TRUE, 75,
|
1999-04-05 20:48:48 +08:00
|
|
|
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
|
2000-02-04 12:31:18 +08:00
|
|
|
|
|
|
|
g_free (pixels_per_unit);
|
|
|
|
pixels_per_unit = NULL;
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM);
|
2001-06-04 04:40:50 +08:00
|
|
|
if (ABS (gimprc.monitor_xres - gimprc.monitor_yres) < GIMP_MIN_RESOLUTION)
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE);
|
2001-06-04 04:40:50 +08:00
|
|
|
gtk_object_set_data (GTK_OBJECT (sizeentry), "chain_button", button);
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_table_attach_defaults (GTK_TABLE (sizeentry), button, 1, 3, 3, 4);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
1999-03-28 02:16:30 +08:00
|
|
|
_("Horizontal"), 0, 1, 0.0);
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
1999-03-28 02:16:30 +08:00
|
|
|
_("Vertical"), 0, 2, 0.0);
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
1999-05-19 01:33:39 +08:00
|
|
|
_("dpi"), 1, 4, 0.0);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0,
|
|
|
|
GIMP_MIN_RESOLUTION,
|
|
|
|
GIMP_MAX_RESOLUTION);
|
|
|
|
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 1,
|
|
|
|
GIMP_MIN_RESOLUTION,
|
|
|
|
GIMP_MAX_RESOLUTION);
|
|
|
|
|
2001-06-04 04:40:50 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0,
|
|
|
|
gimprc.monitor_xres);
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1,
|
|
|
|
gimprc.monitor_yres);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (sizeentry), "value_changed",
|
|
|
|
G_CALLBACK (prefs_monitor_resolution_callback),
|
|
|
|
button);
|
|
|
|
g_signal_connect (G_OBJECT (sizeentry), "refval_changed",
|
|
|
|
G_CALLBACK (prefs_monitor_resolution_callback),
|
|
|
|
button);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (abox), sizeentry);
|
|
|
|
gtk_widget_show (sizeentry);
|
2001-07-07 20:17:23 +08:00
|
|
|
gtk_widget_set_sensitive (sizeentry, ! gimprc.using_xserver_resolution);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
calibrate_button = gtk_button_new_with_label (_("Calibrate"));
|
|
|
|
gtk_misc_set_padding (GTK_MISC (GTK_BIN (calibrate_button)->child), 4, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), calibrate_button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (calibrate_button);
|
2001-07-07 20:17:23 +08:00
|
|
|
gtk_widget_set_sensitive (calibrate_button, ! gimprc.using_xserver_resolution);
|
2000-09-25 09:27:47 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (calibrate_button), "clicked",
|
|
|
|
G_CALLBACK (prefs_resolution_calibrate_callback),
|
|
|
|
sizeentry);
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
group = NULL;
|
2000-06-07 05:33:19 +08:00
|
|
|
button = gtk_radio_button_new_with_label (group, _("From windowing system"));
|
1999-05-31 22:11:10 +08:00
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_res_source_callback),
|
|
|
|
NULL);
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_object_set_data (GTK_OBJECT (button), "monitor_resolution_sizeentry",
|
|
|
|
sizeentry);
|
2000-09-25 09:27:47 +08:00
|
|
|
gtk_object_set_data (GTK_OBJECT (button), "set_sensitive",
|
|
|
|
label);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (button), "inverse_sensitive",
|
|
|
|
sizeentry);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (sizeentry), "inverse_sensitive",
|
|
|
|
calibrate_button);
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
1999-04-05 20:48:48 +08:00
|
|
|
gtk_widget_show (button);
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
separator = gtk_hseparator_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), separator, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (separator);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
button = gtk_radio_button_new_with_label (group, _("Manually:"));
|
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), abox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (abox);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
if (! gimprc.using_xserver_resolution)
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
/* Directories */
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Directories"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Directories"),
|
|
|
|
"dialogs/preferences/directories.html",
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
2001-06-04 04:40:50 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
1999-11-27 21:44:54 +08:00
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
gchar *label;
|
|
|
|
gchar *fs_label;
|
|
|
|
gchar **mdir;
|
|
|
|
}
|
|
|
|
dirs[] =
|
|
|
|
{
|
1999-03-28 02:16:30 +08:00
|
|
|
{ N_("Temp Dir:"), N_("Select Temp Dir"), &edit_temp_path },
|
|
|
|
{ N_("Swap Dir:"), N_("Select Swap Dir"), &edit_swap_path },
|
|
|
|
};
|
2000-02-08 04:35:13 +08:00
|
|
|
static gint ndirs = sizeof (dirs) / sizeof (dirs[0]);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
table = gtk_table_new (ndirs + 1, 2, FALSE);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0);
|
|
|
|
gtk_widget_show (table);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
for (i = 0; i < ndirs; i++)
|
|
|
|
{
|
|
|
|
fileselection = gimp_file_selection_new (gettext(dirs[i].fs_label),
|
|
|
|
*(dirs[i].mdir),
|
|
|
|
TRUE, TRUE);
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, i,
|
1999-04-05 20:48:48 +08:00
|
|
|
gettext(dirs[i].label), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
fileselection, 1, FALSE);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (fileselection), "filename_changed",
|
|
|
|
G_CALLBACK (prefs_filename_callback),
|
|
|
|
dirs[i].mdir);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
/* Directories / <paths> */
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
1999-11-27 21:44:54 +08:00
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
gchar *tree_label;
|
|
|
|
gchar *label;
|
1999-12-18 19:37:11 +08:00
|
|
|
gchar *help_data;
|
1999-11-27 21:44:54 +08:00
|
|
|
gchar *fs_label;
|
|
|
|
gchar **mpath;
|
|
|
|
}
|
|
|
|
paths[] =
|
|
|
|
{
|
1999-12-18 19:37:11 +08:00
|
|
|
{ N_("Brushes"), N_("Brushes Directories"),
|
|
|
|
"dialogs/preferences/directories.html#brushes",
|
|
|
|
N_("Select Brushes Dir"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&edit_brush_path },
|
1999-12-18 19:37:11 +08:00
|
|
|
{ N_("Patterns"), N_("Patterns Directories"),
|
|
|
|
"dialogs/preferences/directories.html#patterns",
|
|
|
|
N_("Select Patterns Dir"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&edit_pattern_path },
|
1999-12-18 19:37:11 +08:00
|
|
|
{ N_("Palettes"), N_("Palettes Directories"),
|
|
|
|
"dialogs/preferences/directories.html#palettes",
|
|
|
|
N_("Select Palettes Dir"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&edit_palette_path },
|
1999-12-18 19:37:11 +08:00
|
|
|
{ N_("Gradients"), N_("Gradients Directories"),
|
|
|
|
"dialogs/preferences/directories.html#gradients",
|
|
|
|
N_("Select Gradients Dir"),
|
1999-04-05 20:48:48 +08:00
|
|
|
&edit_gradient_path },
|
1999-12-18 19:37:11 +08:00
|
|
|
{ N_("Plug-Ins"), N_("Plug-Ins Directories"),
|
|
|
|
"dialogs/preferences/directories.html#plug_ins",
|
|
|
|
N_("Select Plug-Ins Dir"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&edit_plug_in_path },
|
1999-12-18 19:37:11 +08:00
|
|
|
{ N_("Modules"), N_("Modules Directories"),
|
|
|
|
"dialogs/preferences/directories.html#modules",
|
|
|
|
N_("Select Modules Dir"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&edit_module_path }
|
|
|
|
};
|
2000-02-08 04:35:13 +08:00
|
|
|
static gint npaths = sizeof (paths) / sizeof (paths[0]);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
for (i = 0; i < npaths; i++)
|
|
|
|
{
|
2000-09-25 09:27:47 +08:00
|
|
|
vbox = prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
gettext (paths[i].label),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
gettext (paths[i].tree_label),
|
|
|
|
paths[i].help_data,
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
patheditor = gimp_path_editor_new (gettext(paths[i].fs_label),
|
|
|
|
*(paths[i].mpath));
|
|
|
|
gtk_container_add (GTK_CONTAINER (vbox), patheditor);
|
|
|
|
gtk_widget_show (patheditor);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (patheditor), "path_changed",
|
|
|
|
G_CALLBACK (prefs_path_callback),
|
|
|
|
paths[i].mpath);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-10-14 12:03:46 +08:00
|
|
|
/* Recalculate the width of the Category tree now */
|
1999-11-27 21:44:54 +08:00
|
|
|
gtk_clist_set_column_width
|
|
|
|
(GTK_CLIST (ctree), 0,
|
|
|
|
gtk_clist_optimal_column_width (GTK_CLIST (ctree), 0));
|
|
|
|
|
1999-10-14 12:03:46 +08:00
|
|
|
gtk_widget_show (ctree);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (notebook);
|
1999-11-27 21:44:54 +08:00
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
return prefs_dlg;
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|