1999-03-28 02:16:30 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "colormaps.h"
|
|
|
|
#include "gdisplay_ops.h"
|
|
|
|
#include "gimprc.h"
|
|
|
|
#include "image_render.h"
|
|
|
|
#include "interface.h"
|
|
|
|
#include "layers_dialog.h"
|
|
|
|
#include "layer_select.h"
|
1999-04-22 22:34:00 +08:00
|
|
|
#include "paint_options.h"
|
1998-06-23 01:30:40 +08:00
|
|
|
#include "session.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
#include "config.h"
|
1999-03-03 20:35:12 +08:00
|
|
|
#include "libgimp/gimpchainbutton.h"
|
1999-03-14 07:03:11 +08:00
|
|
|
#include "libgimp/gimpfileselection.h"
|
|
|
|
#include "libgimp/gimppatheditor.h"
|
1999-03-28 02:16:30 +08:00
|
|
|
#include "libgimp/gimpsizeentry.h"
|
1999-04-22 22:34:00 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
/* preferences local functions */
|
|
|
|
static void file_prefs_ok_callback (GtkWidget *, GtkWidget *);
|
|
|
|
static void file_prefs_save_callback (GtkWidget *, GtkWidget *);
|
|
|
|
static void file_prefs_cancel_callback (GtkWidget *, GtkWidget *);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
static void file_prefs_toggle_callback (GtkWidget *, gpointer);
|
|
|
|
static void file_prefs_preview_size_callback (GtkWidget *, gpointer);
|
1999-05-19 01:33:39 +08:00
|
|
|
static void file_prefs_mem_size_callback (GtkWidget *, gpointer);
|
1998-06-15 20:44:51 +08:00
|
|
|
static void file_prefs_mem_size_unit_callback (GtkWidget *, gpointer);
|
1999-04-03 03:46:59 +08:00
|
|
|
static void file_prefs_int_adjustment_callback (GtkAdjustment *, gpointer);
|
1999-03-28 02:16:30 +08:00
|
|
|
static void file_prefs_string_callback (GtkWidget *, gpointer);
|
|
|
|
static void file_prefs_filename_callback (GtkWidget *, gpointer);
|
|
|
|
static void file_prefs_path_callback (GtkWidget *, gpointer);
|
1998-07-12 06:23:23 +08:00
|
|
|
static void file_prefs_clear_session_info_callback (GtkWidget *, gpointer);
|
1999-03-28 02:16:30 +08:00
|
|
|
static void file_prefs_default_size_callback (GtkWidget *, gpointer);
|
|
|
|
static void file_prefs_default_resolution_callback (GtkWidget *, gpointer);
|
|
|
|
static void file_prefs_res_source_callback (GtkWidget *, gpointer);
|
1999-03-03 20:35:12 +08:00
|
|
|
static void file_prefs_monitor_resolution_callback (GtkWidget *, gpointer);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
/* static variables */
|
1998-07-19 01:39:23 +08:00
|
|
|
static int old_perfectmouse;
|
1998-06-09 05:53:45 +08:00
|
|
|
static int old_transparency_type;
|
|
|
|
static int old_transparency_size;
|
|
|
|
static int old_levels_of_undo;
|
|
|
|
static int old_marching_speed;
|
|
|
|
static int old_allow_resize_windows;
|
|
|
|
static int old_auto_save;
|
|
|
|
static int old_preview_size;
|
|
|
|
static int old_no_cursor_updating;
|
|
|
|
static int old_show_tool_tips;
|
1998-08-05 20:38:11 +08:00
|
|
|
static int old_show_rulers;
|
|
|
|
static int old_show_statusbar;
|
1998-06-09 05:53:45 +08:00
|
|
|
static int old_cubic_interpolation;
|
|
|
|
static int old_confirm_on_close;
|
1998-07-12 06:23:23 +08:00
|
|
|
static int old_save_session_info;
|
1998-08-13 23:25:41 +08:00
|
|
|
static int old_save_device_status;
|
1998-07-12 06:23:23 +08:00
|
|
|
static int old_always_restore_session;
|
1998-06-09 05:53:45 +08:00
|
|
|
static int old_default_width;
|
|
|
|
static int old_default_height;
|
1999-03-03 20:35:12 +08:00
|
|
|
static GUnit old_default_units;
|
1999-05-19 01:33:39 +08:00
|
|
|
static double old_default_xresolution;
|
|
|
|
static double old_default_yresolution;
|
1999-03-03 20:35:12 +08:00
|
|
|
static GUnit old_default_resolution_units;
|
1998-06-09 05:53:45 +08:00
|
|
|
static int old_default_type;
|
|
|
|
static int old_stingy_memory_use;
|
|
|
|
static int old_tile_cache_size;
|
|
|
|
static int old_install_cmap;
|
|
|
|
static int old_cycled_marching_ants;
|
1998-07-12 13:18:17 +08:00
|
|
|
static int old_last_opened_size;
|
1998-06-09 05:53:45 +08:00
|
|
|
static char * old_temp_path;
|
|
|
|
static char * old_swap_path;
|
1999-04-05 20:48:48 +08:00
|
|
|
static char * old_plug_in_path;
|
|
|
|
static char * old_module_path;
|
1998-06-09 05:53:45 +08:00
|
|
|
static char * old_brush_path;
|
|
|
|
static char * old_pattern_path;
|
|
|
|
static char * old_palette_path;
|
|
|
|
static char * old_gradient_path;
|
1999-05-19 01:33:39 +08:00
|
|
|
static double old_monitor_xres;
|
|
|
|
static double old_monitor_yres;
|
1998-12-06 05:48:37 +08:00
|
|
|
static int old_using_xserver_resolution;
|
1999-01-23 07:46:44 +08:00
|
|
|
static int old_num_processors;
|
1999-02-11 06:48:13 +08:00
|
|
|
static char * old_image_title_format;
|
1999-04-22 22:34:00 +08:00
|
|
|
static int old_global_paint_options;
|
1999-05-19 01:33:39 +08:00
|
|
|
static int old_max_new_image_size;
|
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 */
|
1998-06-09 05:53:45 +08:00
|
|
|
static int edit_stingy_memory_use;
|
|
|
|
static int edit_tile_cache_size;
|
|
|
|
static int edit_install_cmap;
|
|
|
|
static int edit_cycled_marching_ants;
|
1998-07-12 13:18:17 +08:00
|
|
|
static int edit_last_opened_size;
|
1999-01-23 07:46:44 +08:00
|
|
|
static int edit_num_processors;
|
1999-04-05 20:48:48 +08:00
|
|
|
static char * edit_temp_path = NULL;
|
|
|
|
static char * edit_swap_path = NULL;
|
|
|
|
static char * edit_plug_in_path = NULL;
|
|
|
|
static char * edit_module_path = NULL;
|
|
|
|
static char * edit_brush_path = NULL;
|
|
|
|
static char * edit_pattern_path = NULL;
|
|
|
|
static char * edit_palette_path = NULL;
|
|
|
|
static char * edit_gradient_path = NULL;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
static GtkWidget *prefs_dlg = NULL;
|
|
|
|
|
1998-06-18 03:17:00 +08:00
|
|
|
static int divided_tile_cache_size;
|
1999-05-19 01:33:39 +08:00
|
|
|
static int tile_cache_size_unit;
|
|
|
|
|
|
|
|
static int divided_max_new_image_size;
|
|
|
|
static int max_new_image_size_unit;
|
1999-04-03 03:46:59 +08:00
|
|
|
|
1999-03-03 20:35:12 +08:00
|
|
|
static GtkWidget *default_size_sizeentry = NULL;
|
|
|
|
static GtkWidget *default_resolution_sizeentry = NULL;
|
1999-02-25 19:25:53 +08:00
|
|
|
static GtkWidget *resolution_xserver_label = NULL;
|
1999-03-03 20:35:12 +08:00
|
|
|
static GtkWidget *monitor_resolution_sizeentry = NULL;
|
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
|
|
|
|
tile-cache-size
|
|
|
|
install-cmap
|
|
|
|
cycled-marching-ants
|
1998-07-12 13:18:17 +08:00
|
|
|
last-opened-size
|
1999-04-03 03:46:59 +08:00
|
|
|
num-processors
|
1999-04-05 20:48:48 +08:00
|
|
|
temp-path
|
|
|
|
swap-path
|
|
|
|
plug-in-path
|
|
|
|
module-path
|
|
|
|
brush-path
|
|
|
|
pattern-path
|
|
|
|
palette-path
|
|
|
|
gradient-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,
|
|
|
|
gamma-correction, color-cube.
|
|
|
|
|
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
|
|
|
|
|
|
|
/* Copy the string from source to destination, freeing the string stored
|
|
|
|
in the destination if there is one there already. */
|
|
|
|
static void
|
1999-03-28 02:16:30 +08:00
|
|
|
file_prefs_strset (char **dst,
|
|
|
|
char *src)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
if (*dst != NULL)
|
|
|
|
g_free (*dst);
|
|
|
|
*dst = g_strdup (src);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Duplicate the string, but treat NULL as the empty string. */
|
|
|
|
static char *
|
|
|
|
file_prefs_strdup (char *src)
|
|
|
|
{
|
|
|
|
return g_strdup (src == NULL ? "" : src);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Compare two strings, but treat NULL as the empty string. */
|
|
|
|
static int
|
1999-03-28 02:16:30 +08:00
|
|
|
file_prefs_strcmp (char *src1,
|
|
|
|
char *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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_prefs_ok_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg)
|
|
|
|
{
|
|
|
|
if (levels_of_undo < 0)
|
|
|
|
{
|
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."));
|
1998-06-09 05:53:45 +08:00
|
|
|
levels_of_undo = old_levels_of_undo;
|
|
|
|
return;
|
|
|
|
}
|
1999-01-23 07:46:44 +08:00
|
|
|
if (num_processors < 1 || num_processors > 30)
|
|
|
|
{
|
|
|
|
g_message (_("Error: Number of processors must be between 1 and 30."));
|
|
|
|
num_processors = old_num_processors;
|
|
|
|
return;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
if (marching_speed < 50)
|
|
|
|
{
|
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."));
|
1998-06-09 05:53:45 +08:00
|
|
|
marching_speed = old_marching_speed;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (default_width < 1)
|
|
|
|
{
|
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."));
|
1998-06-09 05:53:45 +08:00
|
|
|
default_width = old_default_width;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (default_height < 1)
|
|
|
|
{
|
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."));
|
1998-06-09 05:53:45 +08:00
|
|
|
default_height = old_default_height;
|
|
|
|
return;
|
1998-12-06 05:48:37 +08:00
|
|
|
}
|
1999-03-03 20:35:12 +08:00
|
|
|
if (default_units < UNIT_INCH ||
|
|
|
|
default_units >= gimp_unit_get_number_of_units ())
|
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Default unit must be within unit range."));
|
1999-03-03 20:35:12 +08:00
|
|
|
default_units = old_default_units;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (default_xresolution < 1e-5 || default_yresolution < 1e-5)
|
|
|
|
{
|
|
|
|
g_message (_("Error: default resolution must not be zero."));
|
|
|
|
default_xresolution = old_default_xresolution;
|
|
|
|
default_yresolution = old_default_yresolution;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (default_resolution_units < UNIT_INCH ||
|
|
|
|
default_resolution_units >= gimp_unit_get_number_of_units ())
|
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Default resolution unit must be within unit range."));
|
1999-03-03 20:35:12 +08:00
|
|
|
default_resolution_units = old_default_resolution_units;
|
|
|
|
return;
|
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
if (monitor_xres < 1e-5 || monitor_yres < 1e-5)
|
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Monitor resolution must not be zero."));
|
1998-12-06 05:48:37 +08:00
|
|
|
monitor_xres = old_monitor_xres;
|
|
|
|
monitor_yres = old_monitor_yres;
|
|
|
|
return;
|
|
|
|
}
|
1999-02-11 06:48:13 +08:00
|
|
|
if (image_title_format == NULL)
|
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
g_message (_("Error: Image title format must not be NULL."));
|
1999-02-11 06:48:13 +08:00
|
|
|
image_title_format = old_image_title_format;
|
|
|
|
return;
|
|
|
|
}
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
gtk_widget_destroy (dlg);
|
|
|
|
prefs_dlg = NULL;
|
1999-03-03 20:35:12 +08:00
|
|
|
default_size_sizeentry = NULL;
|
|
|
|
default_resolution_sizeentry = NULL;
|
1999-02-25 19:25:53 +08:00
|
|
|
resolution_xserver_label = NULL;
|
1999-03-03 20:35:12 +08:00
|
|
|
monitor_resolution_sizeentry = NULL;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
if (show_tool_tips)
|
|
|
|
gtk_tooltips_enable (tool_tips);
|
|
|
|
else
|
|
|
|
gtk_tooltips_disable (tool_tips);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_prefs_save_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg)
|
|
|
|
{
|
|
|
|
GList *update = NULL; /* options that should be updated in .gimprc */
|
|
|
|
GList *remove = NULL; /* options that should be commented out */
|
1999-04-05 20:48:48 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
int save_stingy_memory_use;
|
|
|
|
int save_tile_cache_size;
|
|
|
|
int save_install_cmap;
|
|
|
|
int save_cycled_marching_ants;
|
|
|
|
int save_last_opened_size;
|
1999-04-05 20:48:48 +08:00
|
|
|
int save_num_processors;
|
1998-06-09 05:53:45 +08:00
|
|
|
gchar *save_temp_path;
|
|
|
|
gchar *save_swap_path;
|
1999-04-05 20:48:48 +08:00
|
|
|
gchar *save_plug_in_path;
|
|
|
|
gchar *save_module_path;
|
1998-06-09 05:53:45 +08:00
|
|
|
gchar *save_brush_path;
|
|
|
|
gchar *save_pattern_path;
|
|
|
|
gchar *save_palette_path;
|
|
|
|
gchar *save_gradient_path;
|
1999-04-05 20:48:48 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
int restart_notification = FALSE;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
file_prefs_ok_callback (widget, dlg);
|
|
|
|
|
|
|
|
/* Save variables so that we can restore them later */
|
|
|
|
save_stingy_memory_use = stingy_memory_use;
|
|
|
|
save_tile_cache_size = tile_cache_size;
|
|
|
|
save_install_cmap = install_cmap;
|
|
|
|
save_cycled_marching_ants = cycled_marching_ants;
|
1998-07-12 13:18:17 +08:00
|
|
|
save_last_opened_size = last_opened_size;
|
1999-04-05 20:48:48 +08:00
|
|
|
save_num_processors = num_processors;
|
1998-06-09 05:53:45 +08:00
|
|
|
save_temp_path = temp_path;
|
|
|
|
save_swap_path = swap_path;
|
1999-04-05 20:48:48 +08:00
|
|
|
save_plug_in_path = plug_in_path;
|
|
|
|
save_module_path = module_path;
|
1998-06-09 05:53:45 +08:00
|
|
|
save_brush_path = brush_path;
|
|
|
|
save_pattern_path = pattern_path;
|
|
|
|
save_palette_path = palette_path;
|
|
|
|
save_gradient_path = gradient_path;
|
|
|
|
|
|
|
|
if (levels_of_undo != old_levels_of_undo)
|
|
|
|
update = g_list_append (update, "undo-levels");
|
|
|
|
if (marching_speed != old_marching_speed)
|
|
|
|
update = g_list_append (update, "marching-ants-speed");
|
1998-07-12 13:18:17 +08:00
|
|
|
if (last_opened_size != old_last_opened_size)
|
|
|
|
update = g_list_append (update, "last-opened-size");
|
1998-06-09 05:53:45 +08:00
|
|
|
if (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");
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
if (auto_save != old_auto_save)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "auto-save");
|
|
|
|
remove = g_list_append (remove, "dont-auto-save");
|
|
|
|
}
|
|
|
|
if (no_cursor_updating != old_no_cursor_updating)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "cursor-updating");
|
|
|
|
remove = g_list_append (remove, "no-cursor-updating");
|
|
|
|
}
|
|
|
|
if (show_tool_tips != old_show_tool_tips)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "show-tool-tips");
|
|
|
|
remove = g_list_append (remove, "dont-show-tool-tips");
|
|
|
|
}
|
1998-08-05 20:38:11 +08:00
|
|
|
if (show_rulers != old_show_rulers)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "show-rulers");
|
|
|
|
remove = g_list_append (remove, "dont-show-rulers");
|
|
|
|
}
|
|
|
|
if (show_statusbar != old_show_statusbar)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "show-statusbar");
|
|
|
|
remove = g_list_append (remove, "dont-show-statusbar");
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
if (cubic_interpolation != old_cubic_interpolation)
|
|
|
|
update = g_list_append (update, "cubic-interpolation");
|
|
|
|
if (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");
|
|
|
|
}
|
1998-07-12 06:23:23 +08:00
|
|
|
if (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
|
|
|
}
|
1998-08-13 23:25:41 +08:00
|
|
|
if (save_device_status!= old_save_device_status)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "save-device-status");
|
|
|
|
remove = g_list_append (remove, "dont-save-device-status");
|
|
|
|
}
|
1998-07-12 06:23:23 +08:00
|
|
|
if (always_restore_session != old_always_restore_session)
|
|
|
|
update = g_list_append (update, "always-restore-session");
|
1998-06-09 05:53:45 +08:00
|
|
|
if (default_width != old_default_width ||
|
|
|
|
default_height != old_default_height)
|
|
|
|
update = g_list_append (update, "default-image-size");
|
1999-03-03 20:35:12 +08:00
|
|
|
if (default_units != old_default_units)
|
|
|
|
update = g_list_append (update, "default-units");
|
|
|
|
if (ABS(default_xresolution - old_default_xresolution) > 1e-5)
|
|
|
|
update = g_list_append (update, "default-xresolution");
|
|
|
|
if (ABS(default_yresolution - old_default_yresolution) > 1e-5)
|
|
|
|
update = g_list_append (update, "default-yresolution");
|
|
|
|
if (default_resolution_units != old_default_resolution_units)
|
|
|
|
update = g_list_append (update, "default-resolution-units");
|
1998-06-09 05:53:45 +08:00
|
|
|
if (default_type != old_default_type)
|
|
|
|
update = g_list_append (update, "default-image-type");
|
|
|
|
if (preview_size != old_preview_size)
|
|
|
|
update = g_list_append (update, "preview-size");
|
1998-07-19 01:39:23 +08:00
|
|
|
if (perfectmouse != old_perfectmouse)
|
|
|
|
update = g_list_append (update, "perfect-mouse");
|
1998-06-09 05:53:45 +08:00
|
|
|
if (transparency_type != old_transparency_type)
|
|
|
|
update = g_list_append (update, "transparency-type");
|
|
|
|
if (transparency_size != old_transparency_size)
|
|
|
|
update = g_list_append (update, "transparency-size");
|
1998-12-06 05:48:37 +08:00
|
|
|
if (using_xserver_resolution != old_using_xserver_resolution ||
|
|
|
|
ABS(monitor_xres - old_monitor_xres) > 1e-5)
|
|
|
|
update = g_list_append (update, "monitor-xresolution");
|
|
|
|
if (using_xserver_resolution != old_using_xserver_resolution ||
|
|
|
|
ABS(monitor_yres - old_monitor_yres) > 1e-5)
|
|
|
|
update = g_list_append (update, "monitor-yresolution");
|
1999-01-23 07:46:44 +08:00
|
|
|
if (edit_num_processors != num_processors)
|
|
|
|
update = g_list_append (update, "num-processors");
|
1998-06-09 05:53:45 +08:00
|
|
|
if (edit_stingy_memory_use != stingy_memory_use)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "stingy-memory-use");
|
|
|
|
stingy_memory_use = edit_stingy_memory_use;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
1998-06-18 03:17:00 +08:00
|
|
|
if (edit_tile_cache_size != tile_cache_size)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
update = g_list_append (update, "tile-cache-size");
|
1998-06-18 03:17:00 +08:00
|
|
|
tile_cache_size = edit_tile_cache_size;
|
1998-06-09 05:53:45 +08:00
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
|
|
|
if (edit_install_cmap != old_install_cmap)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "install-colormap");
|
|
|
|
install_cmap = edit_install_cmap;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
|
|
|
if (edit_cycled_marching_ants != cycled_marching_ants)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "colormap-cycling");
|
|
|
|
cycled_marching_ants = edit_cycled_marching_ants;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
1998-07-12 13:18:17 +08:00
|
|
|
if (edit_last_opened_size != last_opened_size)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "last-opened-size");
|
|
|
|
last_opened_size = edit_last_opened_size;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
if (file_prefs_strcmp (temp_path, edit_temp_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "temp-path");
|
|
|
|
temp_path = edit_temp_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
|
|
|
if (file_prefs_strcmp (swap_path, edit_swap_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "swap-path");
|
|
|
|
swap_path = edit_swap_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
1999-04-05 20:48:48 +08:00
|
|
|
if (file_prefs_strcmp (plug_in_path, edit_plug_in_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "plug-in-path");
|
|
|
|
plug_in_path = edit_plug_in_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
|
|
|
if (file_prefs_strcmp (module_path, edit_module_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "module-path");
|
|
|
|
module_path = edit_module_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
if (file_prefs_strcmp (brush_path, edit_brush_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "brush-path");
|
|
|
|
brush_path = edit_brush_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
|
|
|
if (file_prefs_strcmp (pattern_path, edit_pattern_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "pattern-path");
|
|
|
|
pattern_path = edit_pattern_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
|
|
|
if (file_prefs_strcmp (palette_path, edit_palette_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "palette-path");
|
|
|
|
palette_path = edit_palette_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
|
|
|
if (file_prefs_strcmp (gradient_path, edit_gradient_path))
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "gradient-path");
|
|
|
|
gradient_path = edit_gradient_path;
|
|
|
|
restart_notification = TRUE;
|
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
if (using_xserver_resolution)
|
|
|
|
{
|
|
|
|
/* special value of 0 for either x or y res in the gimprc file
|
|
|
|
* means use the xserver's current resolution */
|
|
|
|
monitor_xres = 0.0;
|
|
|
|
monitor_yres = 0.0;
|
|
|
|
}
|
1999-02-11 06:48:13 +08:00
|
|
|
if (file_prefs_strcmp (image_title_format, old_image_title_format))
|
|
|
|
update = g_list_append (update, "image-title-format");
|
1999-04-22 22:34:00 +08:00
|
|
|
if (global_paint_options != old_global_paint_options)
|
|
|
|
{
|
|
|
|
update = g_list_append (update, "global-paint-options");
|
|
|
|
remove = g_list_append (remove, "no-global-paint-options");
|
|
|
|
}
|
1999-05-19 01:33:39 +08:00
|
|
|
if (max_new_image_size != old_max_new_image_size)
|
|
|
|
update = g_list_append (update, "max-new-image-size");
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
save_gimprc (&update, &remove);
|
|
|
|
|
1998-12-06 05:48:37 +08:00
|
|
|
if (using_xserver_resolution)
|
1999-05-19 01:33:39 +08:00
|
|
|
{
|
|
|
|
gfloat xres, yres;
|
|
|
|
|
|
|
|
gdisplay_xserver_resolution (&xres, &yres);
|
|
|
|
monitor_xres = xres;
|
|
|
|
monitor_yres = yres;
|
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
/* Restore variables which must not change */
|
|
|
|
stingy_memory_use = save_stingy_memory_use;
|
|
|
|
tile_cache_size = save_tile_cache_size;
|
|
|
|
install_cmap = save_install_cmap;
|
|
|
|
cycled_marching_ants = save_cycled_marching_ants;
|
1998-07-12 13:18:17 +08:00
|
|
|
last_opened_size = save_last_opened_size;
|
1999-04-05 20:48:48 +08:00
|
|
|
num_processors = save_num_processors;
|
1998-06-09 05:53:45 +08:00
|
|
|
temp_path = save_temp_path;
|
|
|
|
swap_path = save_swap_path;
|
1999-04-05 20:48:48 +08:00
|
|
|
plug_in_path = save_plug_in_path;
|
|
|
|
module_path = save_module_path;
|
1998-06-09 05:53:45 +08:00
|
|
|
brush_path = save_brush_path;
|
|
|
|
pattern_path = save_pattern_path;
|
|
|
|
palette_path = save_palette_path;
|
|
|
|
gradient_path = save_gradient_path;
|
|
|
|
|
|
|
|
if (restart_notification)
|
1999-03-28 02:16:30 +08:00
|
|
|
g_message (_("You will need to restart GIMP for these changes to take "
|
|
|
|
"effect."));
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
g_list_free (update);
|
|
|
|
g_list_free (remove);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_prefs_cancel_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (dlg);
|
|
|
|
prefs_dlg = NULL;
|
1999-03-03 20:35:12 +08:00
|
|
|
default_size_sizeentry = NULL;
|
|
|
|
default_resolution_sizeentry = NULL;
|
1999-02-25 19:25:53 +08:00
|
|
|
resolution_xserver_label = NULL;
|
1999-03-03 20:35:12 +08:00
|
|
|
monitor_resolution_sizeentry = NULL;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
|
|
|
levels_of_undo = old_levels_of_undo;
|
|
|
|
marching_speed = old_marching_speed;
|
|
|
|
allow_resize_windows = old_allow_resize_windows;
|
|
|
|
auto_save = old_auto_save;
|
|
|
|
no_cursor_updating = old_no_cursor_updating;
|
1998-07-19 01:39:23 +08:00
|
|
|
perfectmouse = old_perfectmouse;
|
1998-06-09 05:53:45 +08:00
|
|
|
show_tool_tips = old_show_tool_tips;
|
1998-08-05 20:38:11 +08:00
|
|
|
show_rulers = old_show_rulers;
|
|
|
|
show_statusbar = old_show_statusbar;
|
1998-06-09 05:53:45 +08:00
|
|
|
cubic_interpolation = old_cubic_interpolation;
|
|
|
|
confirm_on_close = old_confirm_on_close;
|
1998-07-12 06:23:23 +08:00
|
|
|
save_session_info = old_save_session_info;
|
1998-08-13 23:25:41 +08:00
|
|
|
save_device_status = old_save_device_status;
|
1998-06-09 05:53:45 +08:00
|
|
|
default_width = old_default_width;
|
|
|
|
default_height = old_default_height;
|
1999-03-03 20:35:12 +08:00
|
|
|
default_units = old_default_units;
|
|
|
|
default_xresolution = old_default_xresolution;
|
|
|
|
default_yresolution = old_default_yresolution;
|
|
|
|
default_resolution_units = old_default_resolution_units;
|
1998-06-09 05:53:45 +08:00
|
|
|
default_type = old_default_type;
|
1998-12-06 05:48:37 +08:00
|
|
|
monitor_xres = old_monitor_xres;
|
|
|
|
monitor_yres = old_monitor_yres;
|
|
|
|
using_xserver_resolution = old_using_xserver_resolution;
|
1999-01-23 07:46:44 +08:00
|
|
|
num_processors = old_num_processors;
|
1999-05-19 01:33:39 +08:00
|
|
|
max_new_image_size = old_max_new_image_size;
|
1998-07-19 01:39:23 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
if (preview_size != old_preview_size)
|
|
|
|
{
|
|
|
|
lc_dialog_rebuild (old_preview_size);
|
|
|
|
layer_select_update_preview_size ();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((transparency_type != old_transparency_type) ||
|
|
|
|
(transparency_size != old_transparency_size))
|
|
|
|
{
|
|
|
|
transparency_type = old_transparency_type;
|
|
|
|
transparency_size = old_transparency_size;
|
|
|
|
|
|
|
|
render_setup (transparency_type, transparency_size);
|
1998-07-08 23:47:38 +08:00
|
|
|
gimage_foreach ((GFunc)layer_invalidate_previews, NULL);
|
1998-06-09 05:53:45 +08:00
|
|
|
gimage_invalidate_previews ();
|
|
|
|
gdisplays_expose_full ();
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
edit_stingy_memory_use = old_stingy_memory_use;
|
|
|
|
edit_tile_cache_size = old_tile_cache_size;
|
|
|
|
edit_install_cmap = old_install_cmap;
|
|
|
|
edit_cycled_marching_ants = old_cycled_marching_ants;
|
1998-07-12 13:18:17 +08:00
|
|
|
edit_last_opened_size = old_last_opened_size;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
file_prefs_strset (&edit_temp_path, old_temp_path);
|
|
|
|
file_prefs_strset (&edit_swap_path, old_swap_path);
|
1999-04-05 20:48:48 +08:00
|
|
|
file_prefs_strset (&edit_plug_in_path, old_plug_in_path);
|
|
|
|
file_prefs_strset (&edit_module_path, old_module_path);
|
1998-06-09 05:53:45 +08:00
|
|
|
file_prefs_strset (&edit_brush_path, old_brush_path);
|
|
|
|
file_prefs_strset (&edit_pattern_path, old_pattern_path);
|
|
|
|
file_prefs_strset (&edit_palette_path, old_palette_path);
|
|
|
|
file_prefs_strset (&edit_gradient_path, old_gradient_path);
|
1999-02-11 06:48:13 +08:00
|
|
|
|
|
|
|
file_prefs_strset (&image_title_format, old_image_title_format);
|
1999-04-22 22:34:00 +08:00
|
|
|
|
|
|
|
paint_options_set_global (old_global_paint_options);
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_prefs_toggle_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
int *val;
|
|
|
|
|
1998-06-23 01:30:40 +08:00
|
|
|
if (data == &allow_resize_windows)
|
1998-06-09 05:53:45 +08:00
|
|
|
allow_resize_windows = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &auto_save)
|
1998-06-09 05:53:45 +08:00
|
|
|
auto_save = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &no_cursor_updating)
|
1998-06-09 05:53:45 +08:00
|
|
|
no_cursor_updating = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-07-19 01:39:23 +08:00
|
|
|
else if (data == &perfectmouse)
|
|
|
|
perfectmouse = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &show_tool_tips)
|
1998-06-09 05:53:45 +08:00
|
|
|
show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-08-05 20:38:11 +08:00
|
|
|
else if (data == &show_rulers)
|
|
|
|
show_rulers = GTK_TOGGLE_BUTTON (widget)->active;
|
|
|
|
else if (data == &show_statusbar)
|
|
|
|
show_statusbar = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &cubic_interpolation)
|
1998-06-09 05:53:45 +08:00
|
|
|
cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &confirm_on_close)
|
1998-06-09 05:53:45 +08:00
|
|
|
confirm_on_close = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-07-12 06:23:23 +08:00
|
|
|
else if (data == &save_session_info)
|
|
|
|
save_session_info = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-08-13 23:25:41 +08:00
|
|
|
else if (data == &save_device_status)
|
|
|
|
save_device_status = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-07-12 06:23:23 +08:00
|
|
|
else if (data == &always_restore_session)
|
|
|
|
always_restore_session = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &edit_stingy_memory_use)
|
1998-06-09 05:53:45 +08:00
|
|
|
edit_stingy_memory_use = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &edit_install_cmap)
|
1998-06-09 05:53:45 +08:00
|
|
|
edit_install_cmap = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &edit_cycled_marching_ants)
|
1998-06-09 05:53:45 +08:00
|
|
|
edit_cycled_marching_ants = GTK_TOGGLE_BUTTON (widget)->active;
|
1998-06-23 01:30:40 +08:00
|
|
|
else if (data == &default_type)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
default_type = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
}
|
1999-03-28 02:16:30 +08:00
|
|
|
else if ((data == &transparency_type) ||
|
|
|
|
(data == &transparency_size))
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
|
|
|
val = data;
|
|
|
|
*val = (long) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
render_setup (transparency_type, transparency_size);
|
1998-07-08 23:47:38 +08:00
|
|
|
gimage_foreach ((GFunc)layer_invalidate_previews, NULL);
|
1998-06-09 05:53:45 +08:00
|
|
|
gimage_invalidate_previews ();
|
|
|
|
gdisplays_expose_full ();
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
1999-04-22 22:34:00 +08:00
|
|
|
else if (data == &global_paint_options)
|
|
|
|
paint_options_set_global (GTK_TOGGLE_BUTTON (widget)->active);
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_prefs_preview_size_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
lc_dialog_rebuild ((long)data);
|
|
|
|
layer_select_update_preview_size ();
|
|
|
|
}
|
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
static void
|
|
|
|
file_prefs_mem_size_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
int *mem_size;
|
|
|
|
int *divided_mem_size;
|
|
|
|
int *mem_size_unit;
|
|
|
|
|
|
|
|
if (! (mem_size = gtk_object_get_data (GTK_OBJECT (widget), "mem_size")))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (! (divided_mem_size = gtk_object_get_data (GTK_OBJECT (widget),
|
|
|
|
"divided_mem_size")))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (! (mem_size_unit = gtk_object_get_data (GTK_OBJECT (widget),
|
|
|
|
"mem_size_unit")))
|
|
|
|
return;
|
|
|
|
|
|
|
|
*divided_mem_size = GTK_ADJUSTMENT (widget)->value;
|
|
|
|
*mem_size = *divided_mem_size * *mem_size_unit;
|
|
|
|
}
|
|
|
|
|
1998-06-15 20:44:51 +08:00
|
|
|
static void
|
|
|
|
file_prefs_mem_size_unit_callback (GtkWidget *widget,
|
1999-03-28 02:16:30 +08:00
|
|
|
gpointer data)
|
1998-06-15 20:44:51 +08:00
|
|
|
{
|
1999-05-19 01:33:39 +08:00
|
|
|
GtkObject *adjustment;
|
|
|
|
int new_unit;
|
|
|
|
int *mem_size;
|
|
|
|
int *divided_mem_size;
|
|
|
|
int *mem_size_unit;
|
1998-06-15 20:44:51 +08:00
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
adjustment = GTK_OBJECT (data);
|
1998-06-15 20:44:51 +08:00
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
if (! (new_unit = (int) gtk_object_get_user_data (GTK_OBJECT (widget))))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (! (mem_size = gtk_object_get_data (GTK_OBJECT (adjustment), "mem_size")))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (! (divided_mem_size = gtk_object_get_data (GTK_OBJECT (adjustment),
|
|
|
|
"divided_mem_size")))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (! (mem_size_unit = gtk_object_get_data (GTK_OBJECT (adjustment),
|
|
|
|
"mem_size_unit")))
|
|
|
|
return;
|
1998-06-15 20:44:51 +08:00
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
if (new_unit != *mem_size_unit)
|
|
|
|
{
|
|
|
|
*divided_mem_size = *mem_size / new_unit;
|
|
|
|
*mem_size_unit = new_unit;
|
|
|
|
|
|
|
|
gtk_signal_handler_block_by_data (GTK_OBJECT (adjustment),
|
|
|
|
divided_mem_size);
|
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (adjustment),
|
|
|
|
(float) *divided_mem_size);
|
|
|
|
gtk_signal_handler_unblock_by_data (GTK_OBJECT (adjustment),
|
|
|
|
divided_mem_size);
|
1998-06-15 20:44:51 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
static void
|
1999-04-03 03:46:59 +08:00
|
|
|
file_prefs_int_adjustment_callback (GtkAdjustment *adj,
|
|
|
|
gpointer data)
|
1998-06-15 20:44:51 +08:00
|
|
|
{
|
|
|
|
int *val;
|
|
|
|
|
|
|
|
val = data;
|
1999-04-03 03:46:59 +08:00
|
|
|
*val = (int) adj->value;
|
1998-06-15 20:44:51 +08:00
|
|
|
}
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
static void
|
|
|
|
file_prefs_string_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gchar **val;
|
|
|
|
|
|
|
|
val = data;
|
|
|
|
file_prefs_strset (val, gtk_entry_get_text (GTK_ENTRY (widget)));
|
|
|
|
}
|
|
|
|
|
1999-03-14 07:03:11 +08:00
|
|
|
static void
|
|
|
|
file_prefs_filename_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gchar **val;
|
|
|
|
|
|
|
|
val = data;
|
|
|
|
file_prefs_strset (val, gimp_file_selection_get_filename (GIMP_FILE_SELECTION (widget)));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_prefs_path_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gchar **val;
|
|
|
|
|
|
|
|
val = data;
|
|
|
|
file_prefs_strset (val, gimp_path_editor_get_path (GIMP_PATH_EDITOR (widget)));
|
|
|
|
}
|
|
|
|
|
1998-06-23 01:30:40 +08:00
|
|
|
static void
|
1998-07-12 06:23:23 +08:00
|
|
|
file_prefs_clear_session_info_callback (GtkWidget *widget,
|
1999-03-28 02:16:30 +08:00
|
|
|
gpointer data)
|
1998-06-23 01:30:40 +08:00
|
|
|
{
|
1998-07-12 06:23:23 +08:00
|
|
|
g_list_free (session_info_updates);
|
|
|
|
session_info_updates = NULL;
|
1998-06-23 01:30:40 +08:00
|
|
|
}
|
|
|
|
|
1999-02-25 19:25:53 +08:00
|
|
|
static void
|
1999-03-03 20:35:12 +08:00
|
|
|
file_prefs_default_size_callback (GtkWidget *widget,
|
1999-03-14 07:03:11 +08:00
|
|
|
gpointer data)
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
|
|
|
default_width = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
|
|
|
default_height = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
|
|
|
default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_prefs_default_resolution_callback (GtkWidget *widget,
|
1999-03-14 07:03:11 +08:00
|
|
|
gpointer data)
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
1999-05-19 01:33:39 +08:00
|
|
|
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);
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (default_size_sizeentry),
|
|
|
|
0, xres, FALSE);
|
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (default_size_sizeentry),
|
|
|
|
1, yres, FALSE);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
default_width =
|
|
|
|
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (default_size_sizeentry), 0);
|
|
|
|
default_height =
|
|
|
|
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (default_size_sizeentry), 1);
|
1999-03-03 20:35:12 +08:00
|
|
|
default_xresolution = xres;
|
|
|
|
default_yresolution = yres;
|
|
|
|
default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget));
|
|
|
|
}
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
static void
|
|
|
|
file_prefs_res_source_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
if (resolution_xserver_label)
|
|
|
|
gtk_widget_set_sensitive (resolution_xserver_label,
|
|
|
|
GTK_TOGGLE_BUTTON (widget)->active);
|
|
|
|
|
|
|
|
if (monitor_resolution_sizeentry)
|
|
|
|
gtk_widget_set_sensitive (monitor_resolution_sizeentry,
|
|
|
|
! GTK_TOGGLE_BUTTON (widget)->active);
|
|
|
|
|
|
|
|
if (GTK_TOGGLE_BUTTON (widget)->active)
|
|
|
|
{
|
1999-05-19 01:33:39 +08:00
|
|
|
gfloat xres, yres;
|
|
|
|
|
|
|
|
gdisplay_xserver_resolution (&xres, &yres);
|
|
|
|
monitor_xres = xres;
|
|
|
|
monitor_yres = yres;
|
1999-03-28 02:16:30 +08:00
|
|
|
using_xserver_resolution = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (monitor_resolution_sizeentry)
|
|
|
|
{
|
|
|
|
monitor_xres =
|
|
|
|
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 0);
|
|
|
|
monitor_yres =
|
|
|
|
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 1);
|
|
|
|
}
|
|
|
|
using_xserver_resolution = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-03-03 20:35:12 +08:00
|
|
|
static void
|
|
|
|
file_prefs_monitor_resolution_callback (GtkWidget *widget,
|
1999-03-14 07:03:11 +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;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
monitor_xres = xres;
|
|
|
|
monitor_yres = yres;
|
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* ********************************************************************
|
|
|
|
* convenience constructors test site ;)
|
|
|
|
*/
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
/* local callbacks of gimp_dialog_new () */
|
1999-03-28 02:16:30 +08:00
|
|
|
static int
|
|
|
|
gimp_dialog_delete_callback (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
1999-03-28 02:16:30 +08:00
|
|
|
GtkSignalFunc cancel_callback;
|
|
|
|
GtkWidget *cancel_widget;
|
|
|
|
|
|
|
|
cancel_callback =
|
|
|
|
(GtkSignalFunc) gtk_object_get_data (GTK_OBJECT (widget),
|
|
|
|
"gimp_dialog_cancel_callback");
|
|
|
|
cancel_widget =
|
|
|
|
(GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget),
|
|
|
|
"gimp_dialog_cancel_widget");
|
|
|
|
|
|
|
|
/* the cancel callback has to destroy the dialog */
|
|
|
|
if (cancel_callback)
|
|
|
|
(* cancel_callback) (cancel_widget, data);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
/*
|
|
|
|
#include "/home/mitschel/wilber3.xpm"
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_dialog_realize_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
static GdkPixmap *wilber_pixmap = NULL;
|
|
|
|
static GdkBitmap *wilber_mask = NULL;
|
|
|
|
GtkStyle *style;
|
|
|
|
|
|
|
|
style = gtk_widget_get_style (widget);
|
|
|
|
|
|
|
|
if (wilber_pixmap == NULL)
|
|
|
|
wilber_pixmap =
|
|
|
|
gdk_pixmap_create_from_xpm_d (widget->window,
|
|
|
|
&wilber_mask,
|
|
|
|
&style->bg[GTK_STATE_NORMAL],
|
|
|
|
wilber3_xpm);
|
|
|
|
|
|
|
|
gdk_window_set_icon (widget->window, NULL,
|
|
|
|
wilber_pixmap, wilber_mask);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* this is an experimental one
|
|
|
|
* I tried to fold the entire dialog creation and the ActionArea stuff
|
|
|
|
* into one function. Might be not general enough.
|
|
|
|
*/
|
|
|
|
GtkWidget*
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_dialog_new (const gchar *title,
|
|
|
|
const gchar *wmclass_name,
|
|
|
|
GtkWindowPosition position,
|
|
|
|
gint allow_shrink,
|
|
|
|
gint allow_grow,
|
|
|
|
gint auto_shrink,
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* specify action area buttons as va_list:
|
|
|
|
* gchar *label,
|
|
|
|
* GtkSignalFunc callback,
|
|
|
|
* gpointer data,
|
|
|
|
* gboolean default_action,
|
|
|
|
* gboolean connect_delete,
|
|
|
|
*/
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *hbbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* action area variables */
|
|
|
|
gchar *label;
|
|
|
|
GtkSignalFunc callback;
|
|
|
|
gpointer data;
|
|
|
|
gboolean default_action;
|
|
|
|
gboolean connect_delete;
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
va_list args;
|
|
|
|
gboolean delete_connected = FALSE;
|
|
|
|
|
|
|
|
g_return_val_if_fail (title != NULL, NULL);
|
|
|
|
g_return_val_if_fail (wmclass_name != NULL, NULL);
|
|
|
|
|
|
|
|
dialog = gtk_dialog_new ();
|
|
|
|
gtk_window_set_wmclass (GTK_WINDOW (dialog), wmclass_name, "Gimp");
|
|
|
|
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_window_set_position (GTK_WINDOW (dialog), position);
|
|
|
|
gtk_window_set_policy (GTK_WINDOW (dialog),
|
|
|
|
allow_grow, allow_shrink, auto_shrink);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* prepare the action_area */
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
|
|
|
|
2);
|
|
|
|
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->action_area), FALSE);
|
|
|
|
|
|
|
|
hbbox = gtk_hbutton_box_new ();
|
|
|
|
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbbox), 4);
|
|
|
|
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->action_area), hbbox,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbbox);
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* the action_area buttons */
|
1999-04-22 22:34:00 +08:00
|
|
|
va_start (args, auto_shrink);
|
|
|
|
label = va_arg (args, gchar*);
|
1999-03-28 02:16:30 +08:00
|
|
|
while (label)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
1999-04-22 22:34:00 +08:00
|
|
|
callback = va_arg (args, GtkSignalFunc);
|
|
|
|
data = va_arg (args, gpointer);
|
|
|
|
default_action = va_arg (args, gboolean);
|
|
|
|
connect_delete = va_arg (args, gboolean);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
button = gtk_button_new_with_label (label);
|
|
|
|
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* pass data as user_data if data != NULL, or the dialog otherwise */
|
1999-03-28 02:16:30 +08:00
|
|
|
if (callback)
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
GTK_SIGNAL_FUNC (callback),
|
|
|
|
data ? data : dialog);
|
|
|
|
|
|
|
|
if (connect_delete && callback && !delete_connected)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_object_set_data (GTK_OBJECT (dialog),
|
|
|
|
"gimp_dialog_cancel_callback",
|
|
|
|
callback);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (dialog),
|
|
|
|
"gimp_dialog_cancel_widget",
|
|
|
|
button);
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* catch the WM delete event */
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "delete_event",
|
|
|
|
(GdkEventFunc) gimp_dialog_delete_callback,
|
|
|
|
data ? data : dialog);
|
|
|
|
|
|
|
|
delete_connected = TRUE;
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
if (default_action)
|
|
|
|
gtk_widget_grab_default (button);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
label = va_arg (args, gchar*);
|
|
|
|
}
|
|
|
|
va_end (args);
|
1998-06-15 20:44:51 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* catch the WM delete event if not already done */
|
1999-03-28 02:16:30 +08:00
|
|
|
if (! delete_connected)
|
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "delete_event",
|
|
|
|
(GdkEventFunc) gimp_dialog_delete_callback,
|
|
|
|
NULL);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* the realize callback sets the WM icon */
|
1999-04-03 03:46:59 +08:00
|
|
|
/*
|
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "realize",
|
|
|
|
(GtkSignalFunc) gimp_dialog_realize_callback,
|
|
|
|
NULL);
|
|
|
|
*/
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
return dialog;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
GtkWidget*
|
|
|
|
gimp_option_menu_new (GtkSignalFunc menu_item_callback,
|
1999-04-22 22:34:00 +08:00
|
|
|
gpointer initial, /* user_data */
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* specify menu items as va_list:
|
|
|
|
* gchar *label,
|
|
|
|
* gpointer data,
|
|
|
|
* gpointer user_data,
|
|
|
|
*/
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
...)
|
|
|
|
{
|
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *menuitem;
|
|
|
|
GtkWidget *optionmenu;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* menu item variables */
|
|
|
|
gchar *label;
|
|
|
|
gpointer data;
|
|
|
|
gpointer user_data;
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
va_list args;
|
|
|
|
gint i;
|
|
|
|
gint initial_index;
|
|
|
|
|
|
|
|
menu = gtk_menu_new ();
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* create the menu items */
|
1999-03-28 02:16:30 +08:00
|
|
|
initial_index = 0;
|
1999-04-22 22:34:00 +08:00
|
|
|
va_start (args, initial);
|
|
|
|
label = va_arg (args, gchar*);
|
1999-03-28 02:16:30 +08:00
|
|
|
for (i = 0; label; i++)
|
|
|
|
{
|
1999-04-22 22:34:00 +08:00
|
|
|
data = va_arg (args, gpointer);
|
|
|
|
user_data = va_arg (args, gpointer);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
menuitem = gtk_menu_item_new_with_label (label);
|
|
|
|
gtk_menu_append (GTK_MENU (menu), menuitem);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
|
|
|
|
menu_item_callback, data);
|
1999-04-22 22:34:00 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (menuitem), user_data);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (menuitem);
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* remember the initial menu item */
|
1999-04-22 22:34:00 +08:00
|
|
|
if (user_data == initial)
|
1999-03-28 02:16:30 +08:00
|
|
|
initial_index = i;
|
|
|
|
|
|
|
|
label = va_arg (args, gchar*);
|
|
|
|
}
|
|
|
|
va_end (args);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
optionmenu = gtk_option_menu_new ();
|
|
|
|
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* select the initial menu item */
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), initial_index);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
return optionmenu;
|
|
|
|
}
|
1998-08-05 20:38:11 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
GtkWidget*
|
|
|
|
gimp_radio_group_new (GtkSignalFunc radio_button_callback,
|
1999-04-22 22:34:00 +08:00
|
|
|
gpointer initial, /* user_data */
|
1998-08-05 20:38:11 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* specify radio buttons as va_list:
|
|
|
|
* gchar *label,
|
|
|
|
* gpointer data,
|
|
|
|
* gpointer user_data,
|
|
|
|
*/
|
1999-01-23 07:46:44 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
...)
|
|
|
|
{
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
GSList *group;
|
1999-01-23 07:46:44 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* radio button variables */
|
|
|
|
gchar *label;
|
|
|
|
gpointer data;
|
|
|
|
gpointer user_data;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
va_list args;
|
1998-06-23 01:30:40 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
|
|
|
group = NULL;
|
1998-06-23 01:30:40 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* create the radio buttons */
|
1999-04-22 22:34:00 +08:00
|
|
|
va_start (args, initial);
|
|
|
|
label = va_arg (args, gchar*);
|
1999-03-28 02:16:30 +08:00
|
|
|
while (label)
|
|
|
|
{
|
1999-04-22 22:34:00 +08:00
|
|
|
data = va_arg (args, gpointer);
|
|
|
|
user_data = va_arg (args, gpointer);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
button = gtk_radio_button_new_with_label (group, label);
|
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
1998-07-12 06:23:23 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
1999-03-28 02:16:30 +08:00
|
|
|
(GtkSignalFunc) radio_button_callback,
|
|
|
|
data);
|
1999-04-22 22:34:00 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (button), user_data);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* press the initially active radio button */
|
1999-04-22 22:34:00 +08:00
|
|
|
if (user_data == initial)
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
1998-08-13 23:25:41 +08:00
|
|
|
|
|
|
|
gtk_widget_show (button);
|
1998-06-23 01:30:40 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
label = va_arg (args, gchar*);
|
|
|
|
}
|
|
|
|
va_end (args);
|
1998-06-23 01:30:40 +08:00
|
|
|
|
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
|
|
|
/* this might be the standard gimp spinbutton */
|
|
|
|
GtkWidget*
|
1999-04-05 20:48:48 +08:00
|
|
|
gimp_spin_button_new (GtkObject **adjustment, /* return value */
|
1999-04-03 03:46:59 +08:00
|
|
|
gfloat value,
|
|
|
|
gfloat lower,
|
|
|
|
gfloat upper,
|
|
|
|
gfloat step_increment,
|
|
|
|
gfloat page_increment,
|
|
|
|
gfloat page_size,
|
|
|
|
gfloat climb_rate,
|
|
|
|
guint digits)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
|
|
|
GtkWidget *spinbutton;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
*adjustment = gtk_adjustment_new (value, lower, upper,
|
|
|
|
step_increment, page_increment, page_size);
|
|
|
|
|
|
|
|
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (*adjustment),
|
|
|
|
climb_rate, digits);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
|
|
|
|
GTK_SHADOW_NONE);
|
|
|
|
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
|
|
|
gtk_widget_set_usize (spinbutton, 75, 0);
|
|
|
|
|
|
|
|
return spinbutton;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
/* add aligned label & widget to a two-column table */
|
1999-04-03 03:46:59 +08:00
|
|
|
void
|
|
|
|
gimp_table_attach_aligned (GtkTable *table,
|
|
|
|
gint row,
|
|
|
|
gchar *text,
|
1999-04-05 20:48:48 +08:00
|
|
|
gfloat xalign,
|
|
|
|
gfloat yalign,
|
1999-04-03 03:46:59 +08:00
|
|
|
GtkWidget *widget,
|
|
|
|
gboolean left_adjust)
|
|
|
|
{
|
|
|
|
GtkWidget *label;
|
|
|
|
|
|
|
|
label = gtk_label_new (text);
|
1999-04-05 20:48:48 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign);
|
1999-05-19 01:33:39 +08:00
|
|
|
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_table_attach (table, GTK_WIDGET (label), 0, 1, row, row + 1,
|
1999-04-05 20:48:48 +08:00
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
if (left_adjust)
|
|
|
|
{
|
1999-04-05 20:48:48 +08:00
|
|
|
GtkWidget *alignment;
|
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
alignment = gtk_alignment_new (0.0, 1.0, 0.0, 0.0);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_table_attach_defaults (table, alignment, 1, 2, row, row + 1);
|
|
|
|
gtk_widget_show (alignment);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), widget);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_table_attach_defaults (table, widget, 1, 2, row, row + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
}
|
|
|
|
|
1999-03-14 07:03:11 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/**********************************************************************
|
|
|
|
* preferences-specific GUI helpers
|
|
|
|
*/
|
1999-03-14 07:03:11 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* create a new notebook page */
|
|
|
|
static GtkWidget*
|
|
|
|
file_prefs_notebook_append_page (GtkNotebook *notebook,
|
|
|
|
gchar *notebook_label,
|
|
|
|
GtkCTree *ctree,
|
|
|
|
gchar *tree_label,
|
|
|
|
GtkCTreeNode *parent,
|
|
|
|
GtkCTreeNode **new_node,
|
|
|
|
gint page_index)
|
|
|
|
{
|
|
|
|
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];
|
|
|
|
|
|
|
|
out_vbox = gtk_vbox_new (FALSE, 0);
|
|
|
|
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-04-03 03:46:59 +08:00
|
|
|
FALSE, FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_ctree_node_set_row_data (ctree,
|
|
|
|
*new_node, (gpointer) page_index);
|
|
|
|
gtk_notebook_append_page (notebook, out_vbox, NULL);
|
|
|
|
|
|
|
|
return vbox;
|
|
|
|
}
|
1998-06-09 05:53:45 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* select a notebook page */
|
|
|
|
static void
|
|
|
|
file_pref_tree_select_callback (GtkWidget *widget,
|
|
|
|
GtkCTreeNode *node)
|
|
|
|
{
|
|
|
|
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-03-28 02:16:30 +08:00
|
|
|
/************************************************************************
|
|
|
|
* create the preferences dialog
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
file_pref_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GtkWidget *ctree;
|
|
|
|
gchar *titles[1];
|
|
|
|
GtkCTreeNode *top_insert;
|
|
|
|
GtkCTreeNode *child_insert;
|
|
|
|
gint page_index;
|
|
|
|
|
|
|
|
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;
|
1999-04-22 22:34:00 +08:00
|
|
|
GtkWidget *label;
|
1999-03-28 02:16:30 +08:00
|
|
|
GSList *group;
|
1999-04-03 03:46:59 +08:00
|
|
|
GtkObject *adjustment;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (prefs_dlg)
|
|
|
|
{
|
|
|
|
gdk_window_raise (GTK_WIDGET (prefs_dlg)->window);
|
|
|
|
return;
|
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
if (edit_temp_path == NULL)
|
|
|
|
{
|
|
|
|
/* first time dialog is opened - copy config vals to edit
|
|
|
|
variables. */
|
1999-04-05 20:48:48 +08:00
|
|
|
edit_stingy_memory_use = stingy_memory_use;
|
|
|
|
edit_tile_cache_size = tile_cache_size;
|
|
|
|
edit_install_cmap = install_cmap;
|
|
|
|
edit_cycled_marching_ants = cycled_marching_ants;
|
|
|
|
edit_last_opened_size = last_opened_size;
|
1999-03-28 02:16:30 +08:00
|
|
|
edit_temp_path = file_prefs_strdup (temp_path);
|
|
|
|
edit_swap_path = file_prefs_strdup (swap_path);
|
|
|
|
edit_brush_path = file_prefs_strdup (brush_path);
|
|
|
|
edit_pattern_path = file_prefs_strdup (pattern_path);
|
|
|
|
edit_palette_path = file_prefs_strdup (palette_path);
|
|
|
|
edit_plug_in_path = file_prefs_strdup (plug_in_path);
|
|
|
|
edit_module_path = file_prefs_strdup (module_path);
|
|
|
|
edit_gradient_path = file_prefs_strdup (gradient_path);
|
|
|
|
}
|
|
|
|
old_perfectmouse = perfectmouse;
|
|
|
|
old_transparency_type = transparency_type;
|
|
|
|
old_transparency_size = transparency_size;
|
|
|
|
old_levels_of_undo = levels_of_undo;
|
|
|
|
old_marching_speed = marching_speed;
|
|
|
|
old_allow_resize_windows = allow_resize_windows;
|
|
|
|
old_auto_save = auto_save;
|
|
|
|
old_preview_size = preview_size;
|
|
|
|
old_no_cursor_updating = no_cursor_updating;
|
|
|
|
old_show_tool_tips = show_tool_tips;
|
|
|
|
old_show_rulers = show_rulers;
|
|
|
|
old_show_statusbar = show_statusbar;
|
|
|
|
old_cubic_interpolation = cubic_interpolation;
|
|
|
|
old_confirm_on_close = confirm_on_close;
|
|
|
|
old_save_session_info = save_session_info;
|
|
|
|
old_save_device_status = save_device_status;
|
|
|
|
old_always_restore_session = always_restore_session;
|
|
|
|
old_default_width = default_width;
|
|
|
|
old_default_height = default_height;
|
|
|
|
old_default_units = default_units;
|
|
|
|
old_default_xresolution = default_xresolution;
|
|
|
|
old_default_yresolution = default_yresolution;
|
|
|
|
old_default_resolution_units = default_resolution_units;
|
|
|
|
old_default_type = default_type;
|
|
|
|
old_stingy_memory_use = edit_stingy_memory_use;
|
|
|
|
old_tile_cache_size = edit_tile_cache_size;
|
|
|
|
old_install_cmap = edit_install_cmap;
|
|
|
|
old_cycled_marching_ants = edit_cycled_marching_ants;
|
|
|
|
old_last_opened_size = edit_last_opened_size;
|
|
|
|
old_monitor_xres = monitor_xres;
|
|
|
|
old_monitor_yres = monitor_yres;
|
|
|
|
old_using_xserver_resolution = using_xserver_resolution;
|
|
|
|
old_num_processors = num_processors;
|
|
|
|
old_image_title_format = file_prefs_strdup (image_title_format);
|
1999-04-22 22:34:00 +08:00
|
|
|
old_global_paint_options = global_paint_options;
|
1999-05-19 01:33:39 +08:00
|
|
|
old_max_new_image_size = max_new_image_size;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
file_prefs_strset (&old_temp_path, edit_temp_path);
|
|
|
|
file_prefs_strset (&old_swap_path, edit_swap_path);
|
1999-04-05 20:48:48 +08:00
|
|
|
file_prefs_strset (&old_plug_in_path, edit_plug_in_path);
|
|
|
|
file_prefs_strset (&old_module_path, edit_module_path);
|
1999-03-28 02:16:30 +08:00
|
|
|
file_prefs_strset (&old_brush_path, edit_brush_path);
|
|
|
|
file_prefs_strset (&old_pattern_path, edit_pattern_path);
|
|
|
|
file_prefs_strset (&old_palette_path, edit_palette_path);
|
|
|
|
file_prefs_strset (&old_gradient_path, edit_gradient_path);
|
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
tile_cache_size_unit = 1;
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
if (edit_tile_cache_size % (tile_cache_size_unit * 1024) != 0)
|
|
|
|
break;
|
|
|
|
tile_cache_size_unit *= 1024;
|
|
|
|
}
|
|
|
|
divided_tile_cache_size = edit_tile_cache_size / tile_cache_size_unit;
|
|
|
|
|
|
|
|
max_new_image_size_unit = 1;
|
1999-03-28 02:16:30 +08:00
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
1999-05-19 01:33:39 +08:00
|
|
|
if (max_new_image_size % (max_new_image_size_unit * 1024) != 0)
|
1999-03-28 02:16:30 +08:00
|
|
|
break;
|
1999-05-19 01:33:39 +08:00
|
|
|
max_new_image_size_unit *= 1024;
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
1999-05-19 01:33:39 +08:00
|
|
|
divided_max_new_image_size = max_new_image_size / max_new_image_size_unit;
|
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",
|
1999-04-03 03:46:59 +08:00
|
|
|
GTK_WIN_POS_NONE, FALSE, FALSE, FALSE,
|
1999-03-28 02:16:30 +08:00
|
|
|
_("OK"), file_prefs_ok_callback, NULL,
|
|
|
|
FALSE, FALSE,
|
|
|
|
_("Save"), file_prefs_save_callback, NULL,
|
|
|
|
FALSE, FALSE,
|
|
|
|
_("Cancel"), file_prefs_cancel_callback, NULL,
|
|
|
|
TRUE, TRUE,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* The main hbox */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
|
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prefs_dlg)->vbox),
|
|
|
|
hbox, TRUE, TRUE, 0);
|
|
|
|
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);
|
|
|
|
gtk_widget_set_usize (ctree, 140, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), ctree, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (ctree);
|
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
|
|
|
gtk_object_set_user_data (GTK_OBJECT (ctree), notebook);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (ctree), "tree_select_row",
|
|
|
|
(GtkSignalFunc) file_pref_tree_select_callback, NULL);
|
|
|
|
|
|
|
|
page_index = 0;
|
|
|
|
|
|
|
|
/* New File page */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("New File Settings"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("New File"),
|
|
|
|
NULL,
|
|
|
|
&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);
|
|
|
|
|
|
|
|
default_size_sizeentry = gimp_size_entry_new (2, default_units, "%p",
|
1999-04-05 20:48:48 +08:00
|
|
|
FALSE, FALSE, TRUE, 75,
|
1999-03-28 02:16:30 +08:00
|
|
|
GIMP_SIZE_ENTRY_UPDATE_SIZE);
|
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (default_size_sizeentry),
|
|
|
|
0, default_xresolution, FALSE);
|
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (default_size_sizeentry),
|
|
|
|
1, default_yresolution, FALSE);
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_set_refval_boundaries
|
|
|
|
(GIMP_SIZE_ENTRY (default_size_sizeentry), 0, 1, 32767);
|
|
|
|
gimp_size_entry_set_refval_boundaries
|
|
|
|
(GIMP_SIZE_ENTRY (default_size_sizeentry), 1, 1, 32767);
|
1999-03-28 02:16:30 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_size_sizeentry), 0,
|
|
|
|
default_width);
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_size_sizeentry), 1,
|
|
|
|
default_height);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_size_sizeentry),
|
|
|
|
_("Width"), 0, 1, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_size_sizeentry),
|
|
|
|
_("Height"), 0, 2, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_size_sizeentry),
|
|
|
|
_("Pixels"), 1, 4, 0.0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (default_size_sizeentry), "unit_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_default_size_callback, NULL);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (default_size_sizeentry), "value_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_default_size_callback, NULL);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (default_size_sizeentry), "refval_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_default_size_callback, NULL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), default_size_sizeentry, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (default_size_sizeentry);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM);
|
1999-03-28 02:16:30 +08:00
|
|
|
default_resolution_sizeentry =
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_new (2, default_resolution_units, "Pixels/%s",
|
1999-04-05 20:48:48 +08:00
|
|
|
FALSE, FALSE, TRUE, 75,
|
1999-03-28 02:16:30 +08:00
|
|
|
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_set_refval_boundaries
|
|
|
|
(GIMP_SIZE_ENTRY (default_resolution_sizeentry), 0, 1, 32767);
|
|
|
|
gimp_size_entry_set_refval_boundaries
|
|
|
|
(GIMP_SIZE_ENTRY (default_resolution_sizeentry), 1, 1, 32767);
|
1999-03-28 02:16:30 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry),
|
|
|
|
0, default_xresolution);
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (default_resolution_sizeentry),
|
|
|
|
1, default_yresolution);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_resolution_sizeentry),
|
|
|
|
_("Horizontal"), 0, 1, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_resolution_sizeentry),
|
|
|
|
_("Vertical"), 0, 2, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (default_resolution_sizeentry),
|
1999-05-19 01:33:39 +08:00
|
|
|
_("dpi"), 1, 4, 0.0);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (default_resolution_sizeentry),
|
|
|
|
"unit_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_default_resolution_callback,
|
1999-04-05 20:48:48 +08:00
|
|
|
button);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (default_resolution_sizeentry),
|
|
|
|
"value_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_default_resolution_callback,
|
1999-04-05 20:48:48 +08:00
|
|
|
button);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (default_resolution_sizeentry),
|
|
|
|
"refval_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_default_resolution_callback,
|
1999-04-05 20:48:48 +08:00
|
|
|
button);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), default_resolution_sizeentry,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (default_resolution_sizeentry);
|
|
|
|
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (default_resolution_sizeentry),
|
1999-04-05 20:48:48 +08:00
|
|
|
button, 1, 3, 3, 4);
|
1999-03-28 02:16:30 +08:00
|
|
|
if (ABS (default_xresolution - default_yresolution) < 1e-5)
|
1999-04-05 20:48:48 +08:00
|
|
|
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE);
|
|
|
|
gtk_widget_show (button);
|
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);
|
|
|
|
|
|
|
|
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 (hbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
optionmenu =
|
|
|
|
gimp_option_menu_new (file_prefs_toggle_callback,
|
|
|
|
(gpointer) default_type,
|
|
|
|
_("RGB"), &default_type, (gpointer) RGB,
|
|
|
|
_("Grayscale"), &default_type, (gpointer) GRAY,
|
|
|
|
NULL);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Default Image Type:"), 1.0, 0.5,
|
|
|
|
optionmenu, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
/* Display page */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Display Settings"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Display"),
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
|
|
|
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-02-25 19:25:53 +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);
|
|
|
|
|
|
|
|
optionmenu =
|
|
|
|
gimp_option_menu_new (file_prefs_toggle_callback,
|
|
|
|
(gpointer) transparency_type,
|
|
|
|
_("Light Checks"),
|
|
|
|
&transparency_type, (gpointer) LIGHT_CHECKS,
|
|
|
|
_("Mid-Tone Checks"),
|
|
|
|
&transparency_type, (gpointer) GRAY_CHECKS,
|
|
|
|
_("Dark Checks"),
|
|
|
|
&transparency_type, (gpointer) DARK_CHECKS,
|
|
|
|
_("White Only"),
|
|
|
|
&transparency_type, (gpointer) WHITE_ONLY,
|
|
|
|
_("Gray Only"),
|
|
|
|
&transparency_type, (gpointer) GRAY_ONLY,
|
|
|
|
_("Black Only"),
|
|
|
|
&transparency_type, (gpointer) BLACK_ONLY,
|
|
|
|
NULL);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Transparency Type:"), 1.0, 0.5,
|
|
|
|
optionmenu, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
optionmenu =
|
|
|
|
gimp_option_menu_new (file_prefs_toggle_callback,
|
|
|
|
(gpointer) transparency_size,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Small"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&transparency_size, (gpointer) SMALL_CHECKS,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Medium"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&transparency_size, (gpointer) MEDIUM_CHECKS,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Large"),
|
1999-03-28 02:16:30 +08:00
|
|
|
&transparency_size, (gpointer) LARGE_CHECKS,
|
|
|
|
NULL);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 1,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Check Size:"), 1.0, 0.5, optionmenu, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Scaling"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Cubic Interpolation"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
cubic_interpolation);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&cubic_interpolation);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
/* Interface */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Interface Settings"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Interface"),
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("General"));
|
|
|
|
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-04-03 03:46:59 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
table = gtk_table_new (3, 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);
|
|
|
|
|
|
|
|
/* 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_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&auto_save);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
*/
|
|
|
|
|
|
|
|
optionmenu =
|
|
|
|
gimp_option_menu_new (file_prefs_preview_size_callback,
|
|
|
|
(gpointer) preview_size,
|
|
|
|
_("None"), (gpointer) 0, (gpointer) 0,
|
|
|
|
_("Small"), (gpointer) 32, (gpointer) 32,
|
|
|
|
_("Medium"), (gpointer) 64, (gpointer) 64,
|
|
|
|
_("Large"), (gpointer) 128, (gpointer) 128,
|
|
|
|
NULL);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Preview Size:"), 1.0, 0.5, optionmenu, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
spinbutton =
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_spin_button_new (&adjustment,
|
|
|
|
levels_of_undo, 0.0, 255.0, 1.0, 5.0, 0.0, 1.0, 0.0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_int_adjustment_callback,
|
1999-03-28 02:16:30 +08:00
|
|
|
&levels_of_undo);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 1,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Levels of Undo:"), 1.0, 0.5, spinbutton, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
spinbutton =
|
1999-05-07 22:21:38 +08:00
|
|
|
gimp_spin_button_new (&adjustment, edit_last_opened_size,
|
|
|
|
0.0, 16.0, 1.0, 5.0, 0.0, 1.0, 0.0);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_int_adjustment_callback,
|
1999-03-28 02:16:30 +08:00
|
|
|
&edit_last_opened_size);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 2,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Recent Documents List Size:"), 1.0, 0.5,
|
|
|
|
spinbutton, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Help System"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Show Tool Tips"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
show_tool_tips);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&show_tool_tips);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
/* Interface / Image Windows */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Image Windows Settings"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Image Windows"),
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Appearance"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Resize Window on Zoom"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
allow_resize_windows);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&allow_resize_windows);
|
|
|
|
gtk_widget_show (button);
|
1999-02-25 19:25:53 +08:00
|
|
|
|
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),
|
|
|
|
show_rulers);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&show_rulers);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Show Statusbar"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
show_statusbar);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&show_statusbar);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
spinbutton =
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_spin_button_new (&adjustment,
|
1999-04-05 20:48:48 +08:00
|
|
|
marching_speed, 50.0, 32000.0, 10.0, 100.0, 1.0,
|
1999-03-28 02:16:30 +08:00
|
|
|
1.0, 0.0);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_int_adjustment_callback,
|
1999-03-28 02:16:30 +08:00
|
|
|
&marching_speed);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Marching Ants Speed:"), 1.0, 0.5,
|
|
|
|
spinbutton, TRUE);
|
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),
|
|
|
|
image_title_format);
|
|
|
|
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);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
|
|
|
GTK_SIGNAL_FUNC (file_prefs_string_callback),
|
|
|
|
&image_title_format);
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 1,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Image Title Format:"), 1.0, 0.5, combo, FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
/* End of the title format string */
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Pointer Movement Feedback"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
1999-04-03 03:46:59 +08:00
|
|
|
button =
|
|
|
|
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),
|
|
|
|
perfectmouse);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&perfectmouse);
|
|
|
|
gtk_widget_show (button);
|
1999-02-25 19:25:53 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
button = gtk_check_button_new_with_label(_("Disable Cursor Updating"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
no_cursor_updating);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&no_cursor_updating);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
/* Interface / Tool Options */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Tool Options Settings"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Tool Options"),
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Paint Options"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
button =
|
|
|
|
gtk_check_button_new_with_label(_("Use Global Paint Options"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
global_paint_options);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&global_paint_options);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
label =
|
|
|
|
gtk_label_new (_("(Switching this off does not yet work consistently.)"));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* Environment */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Environment Settings"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Environment"),
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Resource Consumption"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Conservative Memory Usage"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), stingy_memory_use);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&edit_stingy_memory_use);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
#ifdef ENABLE_MP
|
1999-05-19 01:33:39 +08:00
|
|
|
table = gtk_table_new (3, 2, FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
#else
|
1999-05-19 01:33:39 +08:00
|
|
|
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);
|
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
/* The tile cache size */
|
1999-03-28 02:16:30 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
1999-04-03 03:46:59 +08:00
|
|
|
spinbutton =
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_spin_button_new (&adjustment,
|
1999-04-03 03:46:59 +08:00
|
|
|
divided_tile_cache_size,
|
1999-03-28 02:16:30 +08:00
|
|
|
0.0, (4069.0 * 1024 * 1024), 1.0, 16.0, 0.0,
|
|
|
|
1.0, 0.0);
|
1999-05-19 01:33:39 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_mem_size_callback,
|
1999-03-28 02:16:30 +08:00
|
|
|
÷d_tile_cache_size);
|
1999-04-03 03:46:59 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (spinbutton);
|
1999-05-19 01:33:39 +08:00
|
|
|
|
|
|
|
/* for the mem_size_unit callback */
|
|
|
|
gtk_object_set_data (GTK_OBJECT (adjustment), "mem_size",
|
|
|
|
&edit_tile_cache_size);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (adjustment), "divided_mem_size",
|
|
|
|
÷d_tile_cache_size);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (adjustment), "mem_size_unit",
|
|
|
|
&tile_cache_size_unit);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
optionmenu =
|
|
|
|
gimp_option_menu_new (file_prefs_mem_size_unit_callback,
|
1999-05-19 01:33:39 +08:00
|
|
|
(gpointer) tile_cache_size_unit,
|
|
|
|
_("Bytes"), adjustment, (gpointer) 1,
|
|
|
|
_("KiloBytes"), adjustment, (gpointer) 1024,
|
|
|
|
_("MegaBytes"), adjustment, (gpointer) (1024*1024),
|
1999-03-28 02:16:30 +08:00
|
|
|
NULL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (optionmenu);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Tile Cache Size:"), 1.0, 0.5, hbox, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-05-19 01:33:39 +08:00
|
|
|
/* The maximum size of a new image */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
spinbutton =
|
|
|
|
gimp_spin_button_new (&adjustment,
|
|
|
|
divided_max_new_image_size,
|
|
|
|
0.0, (4069.0 * 1024 * 1024), 1.0, 16.0, 0.0,
|
|
|
|
1.0, 0.0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_mem_size_callback,
|
|
|
|
÷d_max_new_image_size);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
|
|
|
|
/* for the mem_size_unit callback */
|
|
|
|
gtk_object_set_data (GTK_OBJECT (adjustment), "mem_size",
|
|
|
|
&max_new_image_size);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (adjustment), "divided_mem_size",
|
|
|
|
÷d_max_new_image_size);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (adjustment), "mem_size_unit",
|
|
|
|
&max_new_image_size_unit);
|
|
|
|
|
|
|
|
optionmenu =
|
|
|
|
gimp_option_menu_new (file_prefs_mem_size_unit_callback,
|
|
|
|
(gpointer) max_new_image_size_unit,
|
|
|
|
_("Bytes"), adjustment, (gpointer) 1,
|
|
|
|
_("KiloBytes"), adjustment, (gpointer) 1024,
|
|
|
|
_("MegaBytes"), adjustment, (gpointer) (1024*1024),
|
|
|
|
NULL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (optionmenu);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 1,
|
|
|
|
_("Maximum Image Size:"), 1.0, 0.5, hbox, TRUE);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
#ifdef ENABLE_MP
|
1999-04-03 03:46:59 +08:00
|
|
|
spinbutton =
|
|
|
|
gimp_spin_button_new (&adjustment,
|
|
|
|
num_processors, 1, 30, 1.0, 2.0, 0.0, 1.0, 0.0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_int_adjustment_callback,
|
1999-03-28 02:16:30 +08:00
|
|
|
&num_processors);
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 2,
|
1999-04-05 20:48:48 +08:00
|
|
|
_("Number of Processors to Use:"), 1.0, 0.5,
|
1999-04-03 03:46:59 +08:00
|
|
|
spinbutton, TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
#endif /* ENABLE_MP */
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("8-Bit Displays"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
if (g_visual->depth != 8)
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (frame), FALSE);
|
|
|
|
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);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Install Colormap"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
install_cmap);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&edit_install_cmap);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label(_("Colormap Cycling"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
cycled_marching_ants);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&edit_cycled_marching_ants);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
/* Session Management */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Session Management"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Session"),
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Window Positions"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label (_("Save Window Positions on Exit"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
save_session_info);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&save_session_info);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Clear Saved Window Positions"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) file_prefs_clear_session_info_callback,
|
|
|
|
NULL);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label (_("Always Try to Restore Session"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
always_restore_session);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&always_restore_session);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Devices"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
button = gtk_check_button_new_with_label (_("Save Device Status on Exit"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
|
|
|
save_device_status);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) file_prefs_toggle_callback,
|
|
|
|
&save_device_status);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
/* Monitor */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Monitor Information"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Monitor"),
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Get Monitor Resolution"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (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);
|
|
|
|
|
|
|
|
group = NULL;
|
|
|
|
button = gtk_radio_button_new_with_label (group, _("From X Server"));
|
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
GTK_SIGNAL_FUNC (file_prefs_res_source_callback),
|
|
|
|
NULL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
{
|
1999-05-19 01:33:39 +08:00
|
|
|
gfloat xres, yres;
|
|
|
|
gchar buf[80];
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
gdisplay_xserver_resolution (&xres, &yres);
|
|
|
|
|
|
|
|
g_snprintf (buf, sizeof (buf), _("(Currently %d x %d dpi)"),
|
|
|
|
(int) (xres + 0.5), (int) (yres + 0.5));
|
|
|
|
resolution_xserver_label = gtk_label_new (buf);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), resolution_xserver_label,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (resolution_xserver_label);
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
1999-04-05 20:48:48 +08:00
|
|
|
if (! using_xserver_resolution)
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
|
|
|
|
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
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), abox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (abox);
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM);
|
|
|
|
monitor_resolution_sizeentry =
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_new (2, UNIT_INCH, "Pixels/%s", FALSE, FALSE, TRUE, 75,
|
1999-04-05 20:48:48 +08:00
|
|
|
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
|
1999-05-19 01:33:39 +08:00
|
|
|
gimp_size_entry_set_refval_boundaries
|
|
|
|
(GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 0, 1, 32767);
|
|
|
|
gimp_size_entry_set_refval_boundaries
|
|
|
|
(GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 1, 1, 32767);
|
1999-03-28 02:16:30 +08:00
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry),
|
|
|
|
0, monitor_xres);
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry),
|
|
|
|
1, monitor_yres);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry),
|
|
|
|
_("Horizontal"), 0, 1, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry),
|
|
|
|
_("Vertical"), 0, 2, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry),
|
1999-05-19 01:33:39 +08:00
|
|
|
_("dpi"), 1, 4, 0.0);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (monitor_resolution_sizeentry),
|
|
|
|
"value_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_monitor_resolution_callback,
|
1999-04-05 20:48:48 +08:00
|
|
|
button);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (monitor_resolution_sizeentry),
|
|
|
|
"refval_changed",
|
|
|
|
(GtkSignalFunc)file_prefs_monitor_resolution_callback,
|
1999-04-05 20:48:48 +08:00
|
|
|
button);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (abox), monitor_resolution_sizeentry);
|
|
|
|
gtk_widget_show (monitor_resolution_sizeentry);
|
|
|
|
|
|
|
|
if (ABS (monitor_xres - monitor_yres) < 1e-5)
|
1999-04-05 20:48:48 +08:00
|
|
|
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_table_attach_defaults (GTK_TABLE (monitor_resolution_sizeentry),
|
1999-04-05 20:48:48 +08:00
|
|
|
button, 1, 3, 3, 4);
|
|
|
|
gtk_widget_show (button);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
gtk_widget_set_sensitive (monitor_resolution_sizeentry,
|
|
|
|
!using_xserver_resolution);
|
|
|
|
|
|
|
|
/* Directories */
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
_("Directories Settings"),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
_("Directories"),
|
|
|
|
NULL,
|
|
|
|
&top_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
{
|
|
|
|
static const struct {
|
|
|
|
char *label;
|
|
|
|
char *fs_label;
|
|
|
|
char **mdir;
|
|
|
|
} dirs[] = {
|
|
|
|
{ N_("Temp Dir:"), N_("Select Temp Dir"), &edit_temp_path },
|
|
|
|
{ N_("Swap Dir:"), N_("Select Swap Dir"), &edit_swap_path },
|
|
|
|
};
|
|
|
|
static int ndirs = sizeof (dirs) / sizeof (dirs[0]);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
for (i = 0; i < ndirs; i++)
|
|
|
|
{
|
|
|
|
fileselection = gimp_file_selection_new (gettext(dirs[i].fs_label),
|
|
|
|
*(dirs[i].mdir),
|
|
|
|
TRUE, TRUE);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (fileselection), "filename_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_filename_callback,
|
|
|
|
dirs[i].mdir);
|
1999-04-03 03:46:59 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), i,
|
1999-04-05 20:48:48 +08:00
|
|
|
gettext(dirs[i].label), 1.0, 0.5,
|
|
|
|
fileselection, FALSE);
|
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
|
|
|
{
|
|
|
|
static const struct {
|
|
|
|
char *tree_label;
|
|
|
|
char *label;
|
|
|
|
char *fs_label;
|
|
|
|
char **mpath;
|
|
|
|
} paths[] = {
|
|
|
|
{ N_("Brushes"), N_("Brushes Directories"), N_("Select Brushes Dir"),
|
|
|
|
&edit_brush_path },
|
|
|
|
{ N_("Patterns"), N_("Patterns Directories"), N_("Select Patterns Dir"),
|
|
|
|
&edit_pattern_path },
|
|
|
|
{ N_("Palettes"), N_("Palettes Directories"), N_("Select Palettes Dir"),
|
|
|
|
&edit_palette_path },
|
1999-04-05 20:48:48 +08:00
|
|
|
{ N_("Gradients"), N_("Gradients Directories"), N_("Select Gradients Dir"),
|
|
|
|
&edit_gradient_path },
|
1999-03-28 02:16:30 +08:00
|
|
|
{ N_("Plug-Ins"), N_("Plug-Ins Directories"), N_("Select Plug-Ins Dir"),
|
|
|
|
&edit_plug_in_path },
|
|
|
|
{ N_("Modules"), N_("Modules Directories"), N_("Select Modules Dir"),
|
|
|
|
&edit_module_path }
|
|
|
|
};
|
|
|
|
static int npaths = sizeof (paths) / sizeof (paths[0]);
|
|
|
|
|
|
|
|
for (i = 0; i < npaths; i++)
|
|
|
|
{
|
|
|
|
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
|
|
gettext (paths[i].label),
|
|
|
|
GTK_CTREE (ctree),
|
|
|
|
gettext (paths[i].tree_label),
|
|
|
|
top_insert,
|
|
|
|
&child_insert,
|
|
|
|
page_index);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
page_index++;
|
|
|
|
|
|
|
|
patheditor = gimp_path_editor_new (gettext(paths[i].fs_label),
|
|
|
|
*(paths[i].mpath));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (patheditor), "path_changed",
|
|
|
|
(GtkSignalFunc) file_prefs_path_callback,
|
|
|
|
paths[i].mpath);
|
|
|
|
gtk_container_add (GTK_CONTAINER (vbox), patheditor);
|
|
|
|
gtk_widget_show (patheditor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_show (notebook);
|
|
|
|
gtk_widget_show (prefs_dlg);
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|