1999-03-28 02:16:30 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
2000-11-18 08:25:42 +08:00
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
1999-03-28 02:16:30 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-06-06 08:28:28 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2002-01-31 04:19:10 +08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#warning GTK_DISABLE_DEPRECATED
|
|
|
|
#endif
|
|
|
|
#undef GTK_DISABLE_DEPRECATED
|
|
|
|
#include <gtk/gtklistitem.h>
|
|
|
|
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "gui-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
#include "config/gimpconfig.h"
|
|
|
|
#include "config/gimpconfig-params.h"
|
|
|
|
#include "config/gimprc.h"
|
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/tile-cache.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
|
|
|
#include "core/gimpimage.h"
|
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
#include "widgets/gimpdeviceinfo.h"
|
|
|
|
#include "widgets/gimpdevices.h"
|
2002-11-21 03:45:03 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
2001-10-13 20:52:30 +08:00
|
|
|
#include "display/gimpdisplay-foreach.h"
|
2001-11-02 17:31:21 +08:00
|
|
|
#include "display/gimpdisplayshell-render.h"
|
2001-09-26 07:23:09 +08:00
|
|
|
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "tools/tool_manager.h"
|
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
#include "gui.h"
|
2001-05-23 05:12:43 +08:00
|
|
|
#include "resolution-calibrate-dialog.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "session.h"
|
|
|
|
|
1999-04-22 22:34:00 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2002-09-08 00:47:39 +08:00
|
|
|
#define SB_WIDTH 10
|
|
|
|
|
2001-07-27 07:35:00 +08:00
|
|
|
/* gimprc will be parsed with a buffer size of 1024,
|
|
|
|
* so don't set this too large
|
|
|
|
*/
|
2000-03-12 08:17:30 +08:00
|
|
|
#define MAX_COMMENT_LENGTH 512
|
2000-01-08 04:40:55 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
/* preferences local functions */
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
static GtkWidget * prefs_dialog_new (Gimp *gimp,
|
|
|
|
GObject *config);
|
|
|
|
static void prefs_config_notify (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *config_copy);
|
|
|
|
static void prefs_config_copy_notify (GObject *config_copy,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *config);
|
|
|
|
static void prefs_cancel_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg);
|
|
|
|
static void prefs_ok_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg);
|
|
|
|
|
|
|
|
static void prefs_clear_session_info_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_default_resolution_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *size_sizeentry);
|
|
|
|
static void prefs_res_source_callback (GtkWidget *widget,
|
|
|
|
GObject *config);
|
|
|
|
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_input_dialog_able_callback (GtkWidget *widget,
|
|
|
|
GdkDevice *device,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_input_dialog_save_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void prefs_restart_notification (void);
|
|
|
|
|
|
|
|
|
|
|
|
/* public function */
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
static void
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_config_notify (GObject *config,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *config_copy)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
GValue value = { 0, };
|
1999-11-27 21:44:54 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_value_init (&value, param_spec->value_type);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_object_get_property (config, param_spec->name, &value);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_signal_handlers_block_by_func (config_copy,
|
|
|
|
prefs_config_copy_notify,
|
|
|
|
config);
|
|
|
|
|
|
|
|
g_object_set_property (config_copy, param_spec->name, &value);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (config_copy,
|
|
|
|
prefs_config_copy_notify,
|
|
|
|
config);
|
|
|
|
|
|
|
|
g_value_unset (&value);
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
static void
|
|
|
|
prefs_config_copy_notify (GObject *config_copy,
|
|
|
|
GParamSpec *param_spec,
|
|
|
|
GObject *config)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
GValue value = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&value, param_spec->value_type);
|
|
|
|
|
|
|
|
g_object_get_property (config_copy, param_spec->name, &value);
|
|
|
|
|
|
|
|
if (param_spec->flags & GIMP_PARAM_RESTART)
|
1998-12-06 05:48:37 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
g_print ("NOT Applying prefs change of '%s' to global config "
|
|
|
|
"because it needs restart\n",
|
|
|
|
param_spec->name);
|
1998-12-06 05:48:37 +08:00
|
|
|
}
|
2002-11-21 03:45:03 +08:00
|
|
|
else if (param_spec->flags & GIMP_PARAM_CONFIRM)
|
1999-02-11 06:48:13 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
g_print ("NOT Applying prefs change of '%s' to global config "
|
|
|
|
"because it needs confirmation\n",
|
|
|
|
param_spec->name);
|
1999-02-11 06:48:13 +08:00
|
|
|
}
|
2002-11-21 03:45:03 +08:00
|
|
|
else
|
2002-02-12 06:39:08 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
g_print ("Applying prefs change of '%s' to global config\n",
|
|
|
|
param_spec->name);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_signal_handlers_block_by_func (config,
|
|
|
|
prefs_config_notify,
|
|
|
|
config_copy);
|
|
|
|
|
|
|
|
g_object_set_property (config, param_spec->name, &value);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (config,
|
|
|
|
prefs_config_notify,
|
|
|
|
config_copy);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
preferences_dialog_create (Gimp *gimp)
|
|
|
|
{
|
|
|
|
GtkWidget *prefs_dialog;
|
|
|
|
GObject *config;
|
|
|
|
GObject *config_copy;
|
|
|
|
GObject *config_orig;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
config = G_OBJECT (gimp->config);
|
|
|
|
config_copy = gimp_config_duplicate (config);
|
|
|
|
config_orig = gimp_config_duplicate (config);
|
|
|
|
|
|
|
|
g_signal_connect_object (config, "notify",
|
|
|
|
G_CALLBACK (prefs_config_notify),
|
|
|
|
config_copy, 0);
|
|
|
|
g_signal_connect_object (config_copy, "notify",
|
|
|
|
G_CALLBACK (prefs_config_copy_notify),
|
|
|
|
config, 0);
|
|
|
|
|
|
|
|
prefs_dialog = prefs_dialog_new (gimp, config_copy);
|
|
|
|
|
|
|
|
g_object_weak_ref (G_OBJECT (prefs_dialog),
|
|
|
|
(GWeakNotify) g_object_unref,
|
|
|
|
config_copy);
|
|
|
|
g_object_weak_ref (G_OBJECT (prefs_dialog),
|
|
|
|
(GWeakNotify) g_object_unref,
|
|
|
|
config_orig);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (prefs_dialog), "gimp", gimp);
|
|
|
|
g_object_set_data (G_OBJECT (prefs_dialog), "config-copy", config_copy);
|
|
|
|
g_object_set_data (G_OBJECT (prefs_dialog), "config-orig", config_orig);
|
|
|
|
|
|
|
|
return prefs_dialog;
|
2000-01-08 04:40:55 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_restart_notification_save_callback (GtkWidget *widget,
|
2001-12-08 01:39:51 +08:00
|
|
|
gpointer data)
|
2000-01-08 04:40:55 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
#if 0
|
2001-10-29 19:47:11 +08:00
|
|
|
prefs_save_callback (widget, prefs_dialog);
|
2000-01-26 07:05:47 +08:00
|
|
|
gtk_widget_destroy (GTK_WIDGET (data));
|
2002-11-21 03:45:03 +08:00
|
|
|
#endif
|
2000-01-08 04:40:55 +08:00
|
|
|
}
|
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
/* The user pressed OK and not Save, but has changed some settings that
|
|
|
|
* only take effect after he restarts the GIMP. Allow him to save the
|
|
|
|
* settings.
|
|
|
|
*/
|
2000-01-08 04:40:55 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_restart_notification (void)
|
2000-01-08 04:40:55 +08:00
|
|
|
{
|
|
|
|
GtkWidget *dlg;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *label;
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
dlg = gimp_dialog_new (_("Save Preferences ?"), "gimp_message",
|
2000-01-26 07:05:47 +08:00
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/preferences/preferences.html",
|
2000-01-08 04:40:55 +08:00
|
|
|
GTK_WIN_POS_MOUSE,
|
|
|
|
FALSE, FALSE, FALSE,
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2001-11-24 07:04:49 +08:00
|
|
|
GTK_STOCK_CLOSE, gtk_widget_destroy,
|
|
|
|
NULL, 1, NULL, FALSE, TRUE,
|
|
|
|
|
2001-07-31 01:17:36 +08:00
|
|
|
GTK_STOCK_SAVE,
|
|
|
|
prefs_restart_notification_save_callback,
|
2000-01-08 04:40:55 +08:00
|
|
|
NULL, NULL, NULL, TRUE, FALSE,
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
NULL);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (dlg), "destroy",
|
|
|
|
G_CALLBACK (gtk_main_quit),
|
|
|
|
NULL);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2000-01-08 04:40:55 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox, TRUE, FALSE, 4);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
label = gtk_label_new (_("At least one of the changes you made will only\n"
|
|
|
|
"take effect after you restart the GIMP.\n\n"
|
|
|
|
"You may choose 'Save' now to make your changes\n"
|
|
|
|
"permanent, so you can restart GIMP or hit 'Close'\n"
|
|
|
|
"and the critical parts of your changes will not\n"
|
|
|
|
"be applied."));
|
|
|
|
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 4);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
gtk_widget_show (dlg);
|
|
|
|
|
|
|
|
gtk_main ();
|
|
|
|
}
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_cancel_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
GtkWidget *dlg)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
Gimp *gimp;
|
|
|
|
GObject *config_orig;
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
gimp = g_object_get_data (G_OBJECT (dlg), "gimp");
|
|
|
|
config_orig = g_object_get_data (G_OBJECT (dlg), "config-orig");
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_object_ref (config_orig);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
gtk_widget_destroy (dlg); /* destroys config_copy */
|
2001-06-18 21:10:03 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
if (! gimp_config_is_equal_to (G_OBJECT (gimp->config), config_orig))
|
2001-12-04 01:59:48 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
GParamSpec **param_specs;
|
|
|
|
guint n_param_specs;
|
|
|
|
gint i;
|
2001-11-09 03:14:51 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
param_specs =
|
|
|
|
g_object_class_list_properties (G_OBJECT_GET_CLASS (config_orig),
|
|
|
|
&n_param_specs);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
for (i = 0; i < n_param_specs; i++)
|
|
|
|
{
|
|
|
|
GValue global_value = { 0, };
|
|
|
|
GValue orig_value = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&global_value, param_specs[i]->value_type);
|
|
|
|
g_value_init (&orig_value, param_specs[i]->value_type);
|
|
|
|
|
|
|
|
g_object_get_property (G_OBJECT (gimp->config),
|
|
|
|
param_specs[i]->name,
|
|
|
|
&global_value);
|
|
|
|
g_object_get_property (config_orig,
|
|
|
|
param_specs[i]->name,
|
|
|
|
&orig_value);
|
|
|
|
|
|
|
|
if (g_param_values_cmp (param_specs[i], &global_value, &orig_value))
|
|
|
|
{
|
|
|
|
g_object_set_property (G_OBJECT (gimp->config),
|
|
|
|
param_specs[i]->name,
|
|
|
|
&orig_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&global_value);
|
|
|
|
g_value_unset (&orig_value);
|
|
|
|
}
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_free (param_specs);
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_object_unref (config_orig);
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|
|
|
|
|
2000-03-12 08:17:30 +08:00
|
|
|
static void
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_ok_callback (GtkWidget *widget,
|
|
|
|
GtkWidget *dlg)
|
2000-03-12 08:17:30 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
Gimp *gimp;
|
|
|
|
GObject *config_orig;
|
|
|
|
GObject *config_copy;
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
gimp = g_object_get_data (G_OBJECT (dlg), "gimp");
|
|
|
|
config_orig = g_object_get_data (G_OBJECT (dlg), "config-orig");
|
|
|
|
config_copy = g_object_get_data (G_OBJECT (dlg), "config-copy");
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_object_ref (config_orig);
|
|
|
|
g_object_ref (config_copy);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
gtk_widget_destroy (dlg);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
if (! gimp_config_is_equal_to (config_copy, config_orig))
|
2001-07-27 07:35:00 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
if (gimp_config_is_equal_to (G_OBJECT (gimp->config), config_copy))
|
|
|
|
{
|
|
|
|
g_message ("You have not changed any value that needs "
|
|
|
|
"restart or confirmation.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GParamSpec **param_specs;
|
|
|
|
guint n_param_specs;
|
|
|
|
GList *restart_list = NULL;
|
|
|
|
GList *confirm_list = NULL;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
param_specs =
|
|
|
|
g_object_class_list_properties (G_OBJECT_GET_CLASS (config_copy),
|
|
|
|
&n_param_specs);
|
|
|
|
|
|
|
|
for (i = 0; i < n_param_specs; i++)
|
|
|
|
{
|
|
|
|
GValue global_value = { 0, };
|
|
|
|
GValue copy_value = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&global_value, param_specs[i]->value_type);
|
|
|
|
g_value_init (©_value, param_specs[i]->value_type);
|
|
|
|
|
|
|
|
g_object_get_property (G_OBJECT (gimp->config),
|
|
|
|
param_specs[i]->name,
|
|
|
|
&global_value);
|
|
|
|
g_object_get_property (config_copy,
|
|
|
|
param_specs[i]->name,
|
|
|
|
©_value);
|
|
|
|
|
|
|
|
if (g_param_values_cmp (param_specs[i],
|
|
|
|
&global_value, ©_value))
|
|
|
|
{
|
|
|
|
if (param_specs[i]->flags & GIMP_PARAM_RESTART)
|
|
|
|
{
|
|
|
|
restart_list = g_list_prepend (restart_list,
|
|
|
|
param_specs[i]);
|
|
|
|
}
|
|
|
|
else if (param_specs[i]->flags & GIMP_PARAM_CONFIRM)
|
|
|
|
{
|
|
|
|
confirm_list = g_list_prepend (confirm_list,
|
|
|
|
param_specs[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&global_value);
|
|
|
|
g_value_unset (©_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (restart_list && confirm_list)
|
|
|
|
{
|
|
|
|
g_message ("You have changed %d values which need restart\n"
|
|
|
|
"and %d values which need confirmation.",
|
|
|
|
g_list_length (restart_list),
|
|
|
|
g_list_length (confirm_list));
|
|
|
|
}
|
|
|
|
else if (restart_list)
|
|
|
|
{
|
|
|
|
g_message ("You have changed %d values which need restart.",
|
|
|
|
g_list_length (restart_list));
|
|
|
|
}
|
|
|
|
else if (confirm_list)
|
|
|
|
{
|
|
|
|
g_message ("You have changed %d values which need confirmation.",
|
|
|
|
g_list_length (confirm_list));
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (restart_list);
|
|
|
|
g_list_free (confirm_list);
|
|
|
|
|
|
|
|
g_free (param_specs);
|
|
|
|
}
|
2001-07-27 07:35:00 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_object_unref (config_orig);
|
|
|
|
g_object_unref (config_copy);
|
1999-03-14 07:03:11 +08:00
|
|
|
}
|
|
|
|
|
1998-06-23 01:30:40 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_clear_session_info_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
1998-06-23 01:30:40 +08:00
|
|
|
{
|
2001-07-27 07:35:00 +08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#warning FIXME: g_list_free (session_info_updates);
|
|
|
|
#endif
|
|
|
|
#if 0
|
1998-07-12 06:23:23 +08:00
|
|
|
g_list_free (session_info_updates);
|
|
|
|
session_info_updates = NULL;
|
2001-07-27 07:35:00 +08:00
|
|
|
#endif
|
1998-06-23 01:30:40 +08:00
|
|
|
}
|
|
|
|
|
1999-03-03 20:35:12 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_default_resolution_callback (GtkWidget *widget,
|
2002-11-21 03:45:03 +08:00
|
|
|
GtkWidget *size_sizeentry)
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
gdouble xres;
|
|
|
|
gdouble yres;
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
|
|
|
yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
1999-03-03 20:35:12 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 0,
|
|
|
|
xres, FALSE);
|
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 0,
|
|
|
|
yres, FALSE);
|
1999-03-03 20:35:12 +08:00
|
|
|
}
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
static void
|
2000-09-25 09:27:47 +08:00
|
|
|
prefs_res_source_callback (GtkWidget *widget,
|
2002-11-21 03:45:03 +08:00
|
|
|
GObject *config)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
gdouble xres;
|
|
|
|
gdouble yres;
|
|
|
|
gboolean from_gdk;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
gui_get_screen_resolution (&xres, &yres);
|
|
|
|
from_gdk = TRUE;
|
1999-02-25 19:25:53 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
if (! GTK_TOGGLE_BUTTON (widget)->active)
|
1999-02-25 19:25:53 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
GimpSizeEntry *sizeentry;
|
1999-02-25 19:25:53 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
sizeentry = g_object_get_data (G_OBJECT (widget),
|
|
|
|
"monitor_resolution_sizeentry");
|
|
|
|
|
|
|
|
if (sizeentry)
|
1999-02-25 19:25:53 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
xres = gimp_size_entry_get_refval (sizeentry, 0);
|
|
|
|
yres = gimp_size_entry_get_refval (sizeentry, 1);
|
1999-02-25 19:25:53 +08:00
|
|
|
}
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
from_gdk = FALSE;
|
1999-02-25 19:25:53 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_object_set (config,
|
|
|
|
"monitor-xresolution", xres,
|
|
|
|
"monitor-yresolution", yres,
|
|
|
|
"monitor-resolution-from-windowing-system", TRUE,
|
|
|
|
NULL);
|
1999-02-25 19:25:53 +08:00
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
static void
|
|
|
|
prefs_resolution_calibrate_callback (GtkWidget *widget,
|
2001-01-02 10:33:43 +08:00
|
|
|
gpointer data)
|
2000-09-25 09:27:47 +08:00
|
|
|
{
|
2002-03-01 02:34:41 +08:00
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *image;
|
|
|
|
|
|
|
|
dialog = gtk_widget_get_toplevel (GTK_WIDGET (data));
|
|
|
|
|
|
|
|
notebook = g_object_get_data (G_OBJECT (dialog), "notebook");
|
|
|
|
|
|
|
|
image = g_object_get_data (G_OBJECT (notebook), "image");
|
|
|
|
|
|
|
|
resolution_calibrate_dialog (GTK_WIDGET (data),
|
|
|
|
gtk_image_get_pixbuf (GTK_IMAGE (image)),
|
|
|
|
NULL, NULL, NULL);
|
2000-09-25 09:27:47 +08:00
|
|
|
}
|
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
static void
|
|
|
|
prefs_input_dialog_able_callback (GtkWidget *widget,
|
|
|
|
GdkDevice *device,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gimp_device_info_changed_by_device (device);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_input_dialog_save_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gimp_devices_save (GIMP (data));
|
|
|
|
}
|
|
|
|
|
1999-11-27 21:44:54 +08:00
|
|
|
static GtkWidget *
|
2002-02-28 21:47:03 +08:00
|
|
|
prefs_notebook_append_page (Gimp *gimp,
|
|
|
|
GtkNotebook *notebook,
|
2002-11-21 03:45:03 +08:00
|
|
|
const gchar *notebook_label,
|
2002-02-28 21:47:03 +08:00
|
|
|
const gchar *notebook_icon,
|
2001-09-27 13:50:59 +08:00
|
|
|
GtkTreeStore *tree,
|
2002-11-21 03:45:03 +08:00
|
|
|
const gchar *tree_label,
|
|
|
|
const gchar *help_data,
|
2001-09-27 13:50:59 +08:00
|
|
|
GtkTreeIter *parent,
|
|
|
|
GtkTreeIter *iter,
|
2001-01-02 10:33:43 +08:00
|
|
|
gint page_index)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
2001-09-27 13:50:59 +08:00
|
|
|
GtkWidget *event_box;
|
|
|
|
GtkWidget *vbox;
|
2002-03-01 02:34:41 +08:00
|
|
|
GdkPixbuf *pixbuf = NULL;
|
|
|
|
GdkPixbuf *small_pixbuf = NULL;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-12-18 19:37:11 +08:00
|
|
|
event_box = gtk_event_box_new ();
|
2001-12-08 01:39:51 +08:00
|
|
|
gtk_notebook_append_page (notebook, event_box, NULL);
|
1999-12-18 19:37:11 +08:00
|
|
|
gtk_widget_show (event_box);
|
|
|
|
|
|
|
|
gimp_help_set_help_data (event_box, NULL, help_data);
|
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (event_box), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
if (notebook_icon)
|
|
|
|
{
|
|
|
|
gchar *filename;
|
|
|
|
|
|
|
|
filename = g_build_filename (gui_themes_get_theme_dir (gimp),
|
|
|
|
"images",
|
|
|
|
"preferences",
|
|
|
|
notebook_icon,
|
|
|
|
NULL);
|
|
|
|
|
2002-05-11 07:30:09 +08:00
|
|
|
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR))
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
|
|
|
else
|
|
|
|
pixbuf = NULL;
|
2002-02-28 21:47:03 +08:00
|
|
|
|
|
|
|
g_free (filename);
|
|
|
|
|
|
|
|
if (pixbuf)
|
|
|
|
{
|
2002-03-01 02:34:41 +08:00
|
|
|
small_pixbuf = gdk_pixbuf_scale_simple (pixbuf,
|
|
|
|
18, 18,
|
|
|
|
GDK_INTERP_BILINEAR);
|
2002-02-28 21:47:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-09-27 13:50:59 +08:00
|
|
|
gtk_tree_store_append (tree, iter, parent);
|
2002-03-01 02:34:41 +08:00
|
|
|
gtk_tree_store_set (tree, iter,
|
|
|
|
0, small_pixbuf,
|
|
|
|
1, tree_label,
|
|
|
|
2, page_index,
|
2002-03-12 04:23:26 +08:00
|
|
|
3, notebook_label,
|
2002-03-01 02:34:41 +08:00
|
|
|
4, pixbuf,
|
|
|
|
-1);
|
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
if (pixbuf)
|
|
|
|
g_object_unref (pixbuf);
|
2001-09-27 13:50:59 +08:00
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
if (small_pixbuf)
|
|
|
|
g_object_unref (small_pixbuf);
|
|
|
|
|
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
|
|
|
static void
|
2001-09-27 13:50:59 +08:00
|
|
|
prefs_tree_select_callback (GtkTreeSelection *sel,
|
|
|
|
GtkNotebook *notebook)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
2002-03-01 02:34:41 +08:00
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *image;
|
2001-09-27 13:50:59 +08:00
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GValue val = { 0, };
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2001-09-27 13:50:59 +08:00
|
|
|
if (! gtk_tree_selection_get_selected (sel, &model, &iter))
|
1999-03-28 02:16:30 +08:00
|
|
|
return;
|
1998-12-06 05:48:37 +08:00
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
label = g_object_get_data (G_OBJECT (notebook), "label");
|
|
|
|
image = g_object_get_data (G_OBJECT (notebook), "image");
|
|
|
|
|
|
|
|
gtk_tree_model_get_value (model, &iter, 3, &val);
|
|
|
|
|
2002-03-12 04:23:26 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (label),
|
|
|
|
g_value_get_string (&val));
|
2002-03-01 02:34:41 +08:00
|
|
|
|
|
|
|
g_value_unset (&val);
|
|
|
|
|
|
|
|
gtk_tree_model_get_value (model, &iter, 4, &val);
|
|
|
|
|
|
|
|
gtk_image_set_from_pixbuf (GTK_IMAGE (image),
|
|
|
|
g_value_get_object (&val));
|
|
|
|
|
|
|
|
g_value_unset (&val);
|
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
gtk_tree_model_get_value (model, &iter, 2, &val);
|
1998-12-06 05:48:37 +08:00
|
|
|
|
2001-09-27 13:50:59 +08:00
|
|
|
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook),
|
|
|
|
g_value_get_int (&val));
|
2001-11-12 02:35:25 +08:00
|
|
|
|
|
|
|
g_value_unset (&val);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-11-27 21:44:54 +08:00
|
|
|
static GtkWidget *
|
2002-02-28 21:47:03 +08:00
|
|
|
prefs_frame_new (gchar *label,
|
|
|
|
GtkContainer *parent)
|
1999-11-27 21:44:54 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
|
1999-11-27 22:08:30 +08:00
|
|
|
frame = gtk_frame_new (label);
|
2002-02-28 21:47:03 +08:00
|
|
|
|
|
|
|
if (GTK_IS_BOX (parent))
|
|
|
|
gtk_box_pack_start (GTK_BOX (parent), frame, FALSE, FALSE, 0);
|
|
|
|
else
|
|
|
|
gtk_container_add (parent, frame);
|
|
|
|
|
1999-11-27 21:44:54 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
vbox2 = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
|
|
|
|
return vbox2;
|
|
|
|
}
|
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
static GtkWidget *
|
|
|
|
prefs_table_new (gint rows,
|
|
|
|
GtkContainer *parent,
|
|
|
|
gboolean left_align)
|
|
|
|
{
|
|
|
|
GtkWidget *table;
|
|
|
|
|
|
|
|
if (left_align)
|
|
|
|
{
|
|
|
|
GtkWidget *hbox;
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
|
|
|
|
if (GTK_IS_BOX (parent))
|
|
|
|
gtk_box_pack_start (GTK_BOX (parent), hbox, FALSE, FALSE, 0);
|
|
|
|
else
|
|
|
|
gtk_container_add (parent, hbox);
|
|
|
|
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
parent = GTK_CONTAINER (hbox);
|
|
|
|
}
|
|
|
|
|
|
|
|
table = gtk_table_new (rows, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
|
|
|
|
|
|
|
if (rows > 1)
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
|
|
|
|
if (GTK_IS_BOX (parent))
|
|
|
|
gtk_box_pack_start (GTK_BOX (parent), table, FALSE, FALSE, 0);
|
|
|
|
else
|
|
|
|
gtk_container_add (parent, table);
|
|
|
|
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
return table;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
2002-02-28 21:47:03 +08:00
|
|
|
GtkBox *vbox)
|
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
button = gimp_prop_check_button_new (config, property_name, label);
|
2002-02-28 21:47:03 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
if (button)
|
|
|
|
{
|
|
|
|
gtk_box_pack_start (vbox, button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
}
|
2002-02-28 21:47:03 +08:00
|
|
|
|
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
static GtkWidget *
|
|
|
|
prefs_enum_option_menu_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row)
|
|
|
|
{
|
|
|
|
GtkWidget *menu;
|
|
|
|
|
|
|
|
menu = gimp_prop_enum_option_menu_new (config, property_name,
|
|
|
|
minimum, maximum);
|
|
|
|
|
|
|
|
if (menu)
|
|
|
|
gimp_table_attach_aligned (table, 0, table_row,
|
|
|
|
label, 1.0, 0.5,
|
|
|
|
menu, 1, TRUE);
|
|
|
|
|
|
|
|
return menu;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
prefs_enum_option_menu_add_with_values (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row,
|
|
|
|
gint n_values,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
GtkWidget *menu;
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start (args, n_values);
|
|
|
|
|
|
|
|
menu = gimp_prop_enum_option_menu_new_valist (config, property_name,
|
|
|
|
n_values, args);
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
if (menu)
|
|
|
|
gimp_table_attach_aligned (table, 0, table_row,
|
|
|
|
label, 1.0, 0.5,
|
|
|
|
menu, 1, TRUE);
|
|
|
|
|
|
|
|
return menu;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
prefs_boolean_option_menu_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *true_text,
|
|
|
|
const gchar *false_text,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row)
|
|
|
|
{
|
|
|
|
GtkWidget *menu;
|
|
|
|
|
|
|
|
menu = gimp_prop_boolean_option_menu_new (config, property_name,
|
|
|
|
true_text, false_text);
|
|
|
|
|
|
|
|
if (menu)
|
|
|
|
gimp_table_attach_aligned (table, 0, table_row,
|
|
|
|
label, 1.0, 0.5,
|
|
|
|
menu, 1, TRUE);
|
|
|
|
|
|
|
|
return menu;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
prefs_spin_button_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gdouble step_increment,
|
|
|
|
gdouble page_increment,
|
|
|
|
gint digits,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row)
|
|
|
|
{
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
|
|
|
|
spinbutton = gimp_prop_spin_button_new (config, property_name,
|
|
|
|
step_increment, page_increment,
|
|
|
|
digits);
|
|
|
|
|
|
|
|
if (spinbutton)
|
|
|
|
gimp_table_attach_aligned (table, 0, table_row,
|
|
|
|
label, 1.0, 0.5,
|
|
|
|
spinbutton, 1, TRUE);
|
|
|
|
|
|
|
|
return spinbutton;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
prefs_memsize_entry_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row)
|
|
|
|
{
|
|
|
|
GtkWidget *entry;
|
|
|
|
|
|
|
|
entry = gimp_prop_memsize_entry_new (config, property_name);
|
|
|
|
|
|
|
|
if (entry)
|
|
|
|
gimp_table_attach_aligned (table, 0, table_row,
|
|
|
|
label, 1.0, 0.5,
|
|
|
|
entry, 1, TRUE);
|
|
|
|
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
|
1999-12-18 19:37:11 +08:00
|
|
|
static void
|
2000-11-18 08:25:42 +08:00
|
|
|
prefs_help_func (const gchar *help_data)
|
1999-12-18 19:37:11 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
#if 0
|
1999-12-18 19:37:11 +08:00
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *event_box;
|
2001-01-02 10:33:43 +08:00
|
|
|
gint page_num;
|
1999-12-18 19:37:11 +08:00
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
|
2001-01-02 10:33:43 +08:00
|
|
|
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
|
1999-12-18 19:37:11 +08:00
|
|
|
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
|
|
|
|
|
2001-08-01 08:35:59 +08:00
|
|
|
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
gimp_standard_help_func (help_data);
|
2002-11-21 03:45:03 +08:00
|
|
|
#endif
|
1999-12-18 19:37:11 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
static GtkWidget *
|
|
|
|
prefs_dialog_new (Gimp *gimp,
|
|
|
|
GObject *config)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
GtkWidget *dialog;
|
2002-03-19 05:25:17 +08:00
|
|
|
GtkWidget *tv;
|
|
|
|
GtkTreeStore *tree;
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkCellRenderer *cell;
|
|
|
|
GtkTreeSelection *sel;
|
|
|
|
GtkTreeIter top_iter;
|
|
|
|
GtkTreeIter child_iter;
|
|
|
|
gint page_index;
|
|
|
|
|
2002-09-17 21:10:56 +08:00
|
|
|
GtkWidget *ebox;
|
2002-03-19 05:25:17 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *abox;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *fileselection;
|
|
|
|
GtkWidget *patheditor;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *image;
|
|
|
|
GtkWidget *sizeentry;
|
|
|
|
GtkWidget *sizeentry2;
|
|
|
|
GtkWidget *separator;
|
|
|
|
GtkWidget *calibrate_button;
|
|
|
|
GtkWidget *scrolled_window;
|
|
|
|
GtkWidget *text_view;
|
|
|
|
GtkTextBuffer *text_buffer;
|
|
|
|
PangoAttrList *attrs;
|
|
|
|
PangoAttribute *attr;
|
|
|
|
GSList *group;
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
gint i;
|
|
|
|
gchar *pixels_per_unit;
|
|
|
|
|
|
|
|
GimpCoreConfig *core_config;
|
|
|
|
GimpDisplayConfig *display_config;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
2002-11-21 03:45:03 +08:00
|
|
|
g_return_val_if_fail (G_IS_OBJECT (config), NULL);
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
core_config = GIMP_CORE_CONFIG (config);
|
|
|
|
display_config = GIMP_DISPLAY_CONFIG (config);
|
1998-12-06 05:48:37 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
dialog = gimp_dialog_new (_("Preferences"), "preferences",
|
|
|
|
prefs_help_func,
|
|
|
|
"dialogs/preferences/preferences.html",
|
|
|
|
GTK_WIN_POS_NONE,
|
|
|
|
FALSE, TRUE, FALSE,
|
|
|
|
|
|
|
|
GTK_STOCK_CANCEL, prefs_cancel_callback,
|
|
|
|
NULL, NULL, NULL, FALSE, TRUE,
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
GTK_STOCK_OK, prefs_ok_callback,
|
|
|
|
NULL, NULL, NULL, TRUE, FALSE,
|
|
|
|
|
|
|
|
NULL);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
/* The main hbox */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
|
2002-11-21 03:45:03 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
/* The categories tree */
|
2001-09-28 20:55:25 +08:00
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
tree = gtk_tree_store_new (5,
|
|
|
|
GDK_TYPE_PIXBUF, G_TYPE_STRING,
|
|
|
|
G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF);
|
2001-09-27 13:50:59 +08:00
|
|
|
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tree));
|
|
|
|
g_object_unref (G_OBJECT (tree));
|
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
|
|
|
|
|
2002-03-19 05:25:17 +08:00
|
|
|
column = gtk_tree_view_column_new ();
|
2002-02-28 21:47:03 +08:00
|
|
|
|
2002-03-19 05:25:17 +08:00
|
|
|
cell = gtk_cell_renderer_pixbuf_new ();
|
|
|
|
gtk_tree_view_column_pack_start (column, cell, FALSE);
|
|
|
|
gtk_tree_view_column_set_attributes (column, cell, "pixbuf", 0, NULL);
|
|
|
|
|
|
|
|
cell = gtk_cell_renderer_text_new ();
|
|
|
|
gtk_tree_view_column_pack_start (column, cell, TRUE);
|
|
|
|
gtk_tree_view_column_set_attributes (column, cell, "text", 1, NULL);
|
|
|
|
|
|
|
|
gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
|
2001-09-27 13:50:59 +08:00
|
|
|
|
2001-09-28 20:55:25 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), tv);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
2002-09-17 21:10:56 +08:00
|
|
|
ebox = gtk_event_box_new ();
|
|
|
|
gtk_widget_set_state (ebox, GTK_STATE_PRELIGHT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), ebox, FALSE, TRUE, 0);
|
|
|
|
gtk_widget_show (ebox);
|
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
2002-09-17 21:10:56 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (ebox), frame);
|
2002-03-01 02:34:41 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
label = gtk_label_new (NULL);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
2002-03-12 04:23:26 +08:00
|
|
|
attrs = pango_attr_list_new ();
|
2002-09-17 21:10:56 +08:00
|
|
|
|
2002-03-12 04:23:26 +08:00
|
|
|
attr = pango_attr_scale_new (PANGO_SCALE_X_LARGE);
|
|
|
|
attr->start_index = 0;
|
|
|
|
attr->end_index = -1;
|
|
|
|
pango_attr_list_insert (attrs, attr);
|
2002-09-17 21:10:56 +08:00
|
|
|
|
|
|
|
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
|
|
|
|
attr->start_index = 0;
|
|
|
|
attr->end_index = -1;
|
|
|
|
pango_attr_list_insert (attrs, attr);
|
|
|
|
|
2002-03-12 04:23:26 +08:00
|
|
|
gtk_label_set_attributes (GTK_LABEL (label), attrs);
|
|
|
|
pango_attr_list_unref (attrs);
|
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
image = gtk_image_new ();
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), image, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (image);
|
|
|
|
|
|
|
|
/* The main preferences notebook */
|
1999-03-28 02:16:30 +08:00
|
|
|
notebook = gtk_notebook_new ();
|
|
|
|
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
|
|
|
|
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
|
2002-03-01 02:34:41 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
g_object_set_data (G_OBJECT (dialog), "notebook", notebook);
|
1999-12-18 19:37:11 +08:00
|
|
|
|
2002-03-01 02:34:41 +08:00
|
|
|
g_object_set_data (G_OBJECT (notebook), "label", label);
|
|
|
|
g_object_set_data (G_OBJECT (notebook), "image", image);
|
|
|
|
|
2001-09-27 13:50:59 +08:00
|
|
|
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
|
|
|
|
g_signal_connect (G_OBJECT (sel), "changed",
|
2001-07-25 08:42:47 +08:00
|
|
|
G_CALLBACK (prefs_tree_select_callback),
|
2001-09-27 13:50:59 +08:00
|
|
|
notebook);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
page_index = 0;
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
/***************/
|
|
|
|
/* New Image */
|
|
|
|
/***************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
|
|
|
_("New Image"),
|
|
|
|
"new-image.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2002-02-28 21:47:03 +08:00
|
|
|
_("New Image"),
|
2001-09-27 13:50:59 +08:00
|
|
|
"dialogs/preferences/new_file.html",
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
/* select this page in the tree */
|
2001-09-27 13:50:59 +08:00
|
|
|
gtk_tree_selection_select_iter (sel, &top_iter);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
sizeentry = gimp_prop_coordinates_new (config,
|
|
|
|
"default-image-width",
|
|
|
|
"default-image-height",
|
|
|
|
"default-unit",
|
|
|
|
"%p", GIMP_SIZE_ENTRY_UPDATE_SIZE,
|
|
|
|
core_config->default_xresolution,
|
|
|
|
core_config->default_yresolution,
|
|
|
|
FALSE);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
|
|
|
_("Width"), 0, 1, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
|
|
|
_("Height"), 0, 2, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
|
|
|
_("Pixels"), 1, 4, 0.0);
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), sizeentry, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (sizeentry);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Default Image Resolution and Resolution Unit"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2000-02-04 12:31:18 +08:00
|
|
|
pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL);
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
sizeentry2 = gimp_prop_coordinates_new (config,
|
|
|
|
"default-xresolution",
|
|
|
|
"default-yresolution",
|
|
|
|
"default-resolution_unit",
|
|
|
|
pixels_per_unit,
|
|
|
|
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION,
|
|
|
|
0.0, 0.0,
|
|
|
|
TRUE);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
|
|
|
|
_("Horizontal"), 0, 1, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
|
|
|
|
_("Vertical"), 0, 2, 0.0);
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
|
|
|
|
_("dpi"), 1, 4, 0.0);
|
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (sizeentry2), "value_changed",
|
2002-11-21 03:45:03 +08:00
|
|
|
G_CALLBACK (prefs_default_resolution_callback),
|
|
|
|
sizeentry);
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (sizeentry2), "refval_changed",
|
2002-11-21 03:45:03 +08:00
|
|
|
G_CALLBACK (prefs_default_resolution_callback),
|
|
|
|
sizeentry);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), sizeentry2, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (sizeentry2);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox), TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_enum_option_menu_add (config, "default-image-type",
|
|
|
|
GIMP_RGB, GIMP_GRAY,
|
|
|
|
_("Default Image Type:"),
|
|
|
|
GTK_TABLE (table), 0);
|
|
|
|
prefs_memsize_entry_add (config, "max-new-image-size",
|
|
|
|
_("Maximum Image Size:"),
|
|
|
|
GTK_TABLE (table), 1);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
/*********************************/
|
|
|
|
/* New Image / Default Comment */
|
|
|
|
/*********************************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Default Comment"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"default-comment.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Default Comment"),
|
|
|
|
"dialogs/preferences/new_file.html#default_comment",
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
2000-03-12 08:17:30 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Comment Used for New Images"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
2001-07-27 23:18:20 +08:00
|
|
|
|
|
|
|
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
|
|
|
GTK_POLICY_AUTOMATIC,
|
|
|
|
GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), scrolled_window);
|
|
|
|
gtk_widget_show (scrolled_window);
|
2000-03-12 08:17:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
text_buffer = gimp_prop_text_buffer_new (config, "default-comment",
|
|
|
|
MAX_COMMENT_LENGTH);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
|
|
|
text_view = gtk_text_view_new_with_buffer (text_buffer);
|
2001-07-27 23:18:20 +08:00
|
|
|
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
2001-07-27 07:35:00 +08:00
|
|
|
gtk_widget_show (text_view);
|
|
|
|
|
|
|
|
g_object_unref (G_OBJECT (text_buffer));
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
/***************/
|
|
|
|
/* Interface */
|
|
|
|
/***************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Interface"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"interface.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Interface"),
|
|
|
|
"dialogs/preferences/interface.html",
|
|
|
|
NULL,
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
table = prefs_table_new (4, GTK_CONTAINER (vbox2), FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_enum_option_menu_add (config, "preview-size", 0, 0,
|
|
|
|
_("Preview Size:"),
|
|
|
|
GTK_TABLE (table), 0);
|
|
|
|
prefs_enum_option_menu_add_with_values (config, "navigation-preview-size",
|
|
|
|
_("Nav Preview Size:"),
|
|
|
|
GTK_TABLE (table), 1,
|
|
|
|
3,
|
|
|
|
GIMP_PREVIEW_SIZE_MEDIUM,
|
|
|
|
GIMP_PREVIEW_SIZE_EXTRA_LARGE,
|
|
|
|
GIMP_PREVIEW_SIZE_HUGE);
|
|
|
|
prefs_spin_button_add (config, "last-opened-size", 1.0, 5.0, 0,
|
|
|
|
_("Recent Documents List Size:"),
|
|
|
|
GTK_TABLE (table), 3);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
/* Dialog Bahaviour */
|
2002-03-12 02:49:24 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Dialog Behavior"), GTK_CONTAINER (vbox));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "info-window-per-display",
|
|
|
|
_("Info Window Per Display"),
|
|
|
|
GTK_BOX (vbox2));
|
1999-11-20 22:27:07 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
/* Menus */
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Menus"), GTK_CONTAINER (vbox));
|
1999-11-20 22:27:07 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "tearoff-menus",
|
|
|
|
_("Disable Tearoff Menus"),
|
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
/* Window Positions */
|
|
|
|
vbox2 = prefs_frame_new (_("Window Positions"), GTK_CONTAINER (vbox));
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "save-session-info",
|
|
|
|
_("Save Window Positions on Exit"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "restore-session",
|
|
|
|
_("Restore Saved Window Positions on Start-up"),
|
|
|
|
GTK_BOX (vbox2));
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Clear Saved Window Positions Now"));
|
|
|
|
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (button), "clicked",
|
|
|
|
G_CALLBACK (prefs_clear_session_info_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************/
|
|
|
|
/* Interface / Help System */
|
|
|
|
/*****************************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Help System"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"help-system.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Help System"),
|
|
|
|
"dialogs/preferences/interface.html#help_system",
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox));
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "show-tool-tips",
|
|
|
|
_("Show Tool Tips"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "use-help",
|
|
|
|
_("Context Sensitive Help with \"F1\""),
|
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox));
|
1999-12-20 01:15:11 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
1999-12-20 01:15:11 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_enum_option_menu_add (config, "help-browser", 0, 0,
|
|
|
|
_("Help Browser to Use:"),
|
|
|
|
GTK_TABLE (table), 0);
|
1999-12-20 01:15:11 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
/******************************/
|
|
|
|
/* Interface / Tool Options */
|
|
|
|
/******************************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
|
|
|
_("Tool Options"),
|
|
|
|
"tool-options.png",
|
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Tool Options"),
|
|
|
|
"dialogs/preferences/interface.html#tool_options",
|
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
|
|
|
page_index++);
|
|
|
|
|
|
|
|
vbox2 = prefs_frame_new (_("Finding Contiguous Regions"), GTK_CONTAINER (vbox));
|
|
|
|
|
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
|
|
|
|
|
|
|
/* Default threshold */
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_spin_button_add (config, "default-threshold", 1.0, 5.0, 0,
|
|
|
|
_("Default Threshold:"),
|
|
|
|
GTK_TABLE (table), 0);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Scaling"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (frame), TRUE);
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_enum_option_menu_add (config, "interpolation-type", 0, 0,
|
|
|
|
_("Default Interpolation:"),
|
|
|
|
GTK_TABLE (table), 0);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*******************************/
|
|
|
|
/* Interface / Input Devices */
|
|
|
|
/*******************************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
|
|
|
_("Input Devices"),
|
|
|
|
"input-devices.png",
|
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Input Devices"),
|
|
|
|
"dialogs/preferences/input-devices.html",
|
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
|
|
|
page_index++);
|
|
|
|
|
|
|
|
vbox2 = prefs_frame_new (_("Input Device Settings"), GTK_CONTAINER (vbox));
|
|
|
|
|
|
|
|
{
|
|
|
|
GtkWidget *input_dialog;
|
|
|
|
GtkWidget *input_vbox;
|
|
|
|
GList *input_children;
|
|
|
|
|
|
|
|
input_dialog = gtk_input_dialog_new ();
|
|
|
|
|
|
|
|
input_children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (input_dialog)->vbox));
|
|
|
|
|
|
|
|
input_vbox = GTK_WIDGET (input_children->data);
|
|
|
|
|
|
|
|
g_list_free (input_children);
|
|
|
|
|
|
|
|
g_object_ref (G_OBJECT (input_vbox));
|
|
|
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (GTK_DIALOG (input_dialog)->vbox),
|
|
|
|
input_vbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), input_vbox, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
g_object_unref (G_OBJECT (input_vbox));
|
|
|
|
|
|
|
|
g_object_weak_ref (G_OBJECT (input_vbox),
|
|
|
|
(GWeakNotify) gtk_widget_destroy,
|
|
|
|
input_dialog);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (input_dialog), "enable_device",
|
|
|
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
2002-11-21 03:45:03 +08:00
|
|
|
NULL);
|
2002-03-01 00:55:38 +08:00
|
|
|
g_signal_connect (G_OBJECT (input_dialog), "disable_device",
|
|
|
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
2002-11-21 03:45:03 +08:00
|
|
|
NULL);
|
2002-03-01 00:55:38 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "save-device-status",
|
|
|
|
_("Save Input Device Settings on Exit"),
|
|
|
|
GTK_BOX (vbox));
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Save Input Device Settings Now"));
|
|
|
|
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (button), "clicked",
|
|
|
|
G_CALLBACK (prefs_input_dialog_save_callback),
|
|
|
|
gimp);
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************/
|
|
|
|
/* Interface / Image Windows */
|
|
|
|
/*******************************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Image Windows"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"image-windows.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Image Windows"),
|
|
|
|
"dialogs/preferences/interface.html#image_windows",
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Appearance"), GTK_CONTAINER (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "default-dot-for-dot",
|
|
|
|
_("Use \"Dot for Dot\" by default"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "resize-windows-on-zoom",
|
|
|
|
_("Resize Window on Zoom"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "resize-windows-on-resize",
|
|
|
|
_("Resize Window on Image Size Change"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "show-rulers",
|
|
|
|
_("Show Rulers"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "show-statusbar",
|
|
|
|
_("Show Statusbar"),
|
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
table = prefs_table_new (3, GTK_CONTAINER (vbox2), FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_spin_button_add (config, "marching-ants-speed", 10.0, 100.0, 0,
|
|
|
|
_("Marching Ants Speed:"),
|
|
|
|
GTK_TABLE (table), 0);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
#if 0
|
2002-02-12 06:39:08 +08:00
|
|
|
/* The title and status format strings */
|
2001-12-08 01:39:51 +08:00
|
|
|
{
|
|
|
|
GtkWidget *combo;
|
|
|
|
GtkWidget *comboitem;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
const gchar *format_strings[] =
|
|
|
|
{
|
|
|
|
NULL,
|
|
|
|
"%f-%p.%i (%t)",
|
|
|
|
"%f-%p.%i (%t) %z%%",
|
|
|
|
"%f-%p.%i (%t) %d:%s",
|
2002-02-07 19:33:01 +08:00
|
|
|
"%f-%p.%i (%t) %s:%d",
|
|
|
|
"%f-%p.%i (%t) %m"
|
2001-12-08 01:39:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const gchar *combo_strings[] =
|
|
|
|
{
|
|
|
|
N_("Custom"),
|
|
|
|
N_("Standard"),
|
|
|
|
N_("Show zoom percentage"),
|
|
|
|
N_("Show zoom ratio"),
|
2002-02-07 19:33:01 +08:00
|
|
|
N_("Show reversed zoom ratio"),
|
|
|
|
N_("Show memory usage")
|
2001-12-08 01:39:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
g_assert (G_N_ELEMENTS (format_strings) == G_N_ELEMENTS (combo_strings));
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
format_strings[0] = display_config->image_title_format;
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2001-12-08 01:39:51 +08:00
|
|
|
combo = gtk_combo_new ();
|
|
|
|
gtk_combo_set_use_arrows (GTK_COMBO (combo), FALSE);
|
|
|
|
gtk_combo_set_value_in_list (GTK_COMBO (combo), FALSE, FALSE);
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (combo_strings); i++)
|
|
|
|
{
|
|
|
|
comboitem = gtk_list_item_new_with_label (gettext (combo_strings[i]));
|
|
|
|
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
|
|
|
format_strings[i]);
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
|
|
|
gtk_widget_show (comboitem);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Image Title Format:"), 1.0, 0.5,
|
|
|
|
combo, 1, FALSE);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
|
|
|
G_CALLBACK (prefs_string_callback),
|
2002-11-21 03:45:03 +08:00
|
|
|
&display_config->image_title_format);
|
2002-02-12 06:39:08 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
format_strings[0] = display_config->image_status_format;
|
2002-02-12 06:39:08 +08:00
|
|
|
|
|
|
|
combo = gtk_combo_new ();
|
|
|
|
gtk_combo_set_use_arrows (GTK_COMBO (combo), FALSE);
|
|
|
|
gtk_combo_set_value_in_list (GTK_COMBO (combo), FALSE, FALSE);
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (combo_strings); i++)
|
|
|
|
{
|
|
|
|
comboitem = gtk_list_item_new_with_label (gettext (combo_strings[i]));
|
|
|
|
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem),
|
|
|
|
format_strings[i]);
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem);
|
|
|
|
gtk_widget_show (comboitem);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
|
|
|
_("Image Status Format:"), 1.0, 0.5,
|
|
|
|
combo, 1, FALSE);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "changed",
|
|
|
|
G_CALLBACK (prefs_string_callback),
|
2002-11-21 03:45:03 +08:00
|
|
|
&display_config->image_status_format);
|
2001-12-08 01:39:51 +08:00
|
|
|
}
|
2002-11-21 03:45:03 +08:00
|
|
|
#endif
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"), GTK_CONTAINER (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "perfect-mouse",
|
|
|
|
_("Perfect-but-Slow Pointer Tracking"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "cursor-updating",
|
|
|
|
_("Enable Cursor Updating"),
|
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
2000-06-06 08:28:28 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_enum_option_menu_add (config, "cursor-mode", 0, 0,
|
|
|
|
_("Cursor Mode:"),
|
|
|
|
GTK_TABLE (table), 0);
|
2000-06-06 08:28:28 +08:00
|
|
|
|
2000-01-16 02:13:13 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
/*************************/
|
|
|
|
/* Interface / Display */
|
|
|
|
/*************************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2002-03-01 00:55:38 +08:00
|
|
|
_("Display"),
|
|
|
|
"display.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2002-03-01 00:55:38 +08:00
|
|
|
_("Display"),
|
|
|
|
"dialogs/preferences/display.html",
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
1999-04-22 22:34:00 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
frame = gtk_frame_new (_("Transparency"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
1999-04-22 22:34:00 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (frame), TRUE);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_enum_option_menu_add (config, "transparency-type", 0, 0,
|
|
|
|
_("Transparency Type:"),
|
|
|
|
GTK_TABLE (table), 0);
|
|
|
|
prefs_enum_option_menu_add (config, "transparency-size", 0, 0,
|
|
|
|
_("Check Size:"),
|
|
|
|
GTK_TABLE (table), 1);
|
1999-09-24 04:21:15 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
vbox2 = prefs_frame_new (_("8-Bit Displays"), GTK_CONTAINER (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
if (gdk_rgb_get_visual ()->depth != 8)
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (vbox2->parent), FALSE);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_spin_button_add (config, "min-colors", 1.0, 8.0, 0,
|
|
|
|
_("Minimum Number of Colors:"),
|
|
|
|
GTK_TABLE (table), 0);
|
|
|
|
prefs_check_button_add (config, "install-colormap",
|
|
|
|
_("Install Colormap"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (config, "colormap-cycling",
|
|
|
|
_("Colormap Cycling"),
|
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
/*************************/
|
|
|
|
/* Interface / Monitor */
|
|
|
|
/*************************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Monitor"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"monitor.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2001-01-02 10:33:43 +08:00
|
|
|
_("Monitor"),
|
|
|
|
"dialogs/preferences/monitor.html",
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
2002-03-01 00:55:38 +08:00
|
|
|
&child_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Get Monitor Resolution"), GTK_CONTAINER (vbox));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
{
|
2000-03-15 07:06:21 +08:00
|
|
|
gdouble xres, yres;
|
|
|
|
gchar *str;
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
gui_get_screen_resolution (&xres, &yres);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2000-03-15 07:06:21 +08:00
|
|
|
str = g_strdup_printf (_("(Currently %d x %d dpi)"),
|
|
|
|
ROUND (xres), ROUND (yres));
|
|
|
|
label = gtk_label_new (str);
|
|
|
|
g_free (str);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
sizeentry = gimp_prop_coordinates_new (config,
|
|
|
|
"monitor-xresolution",
|
|
|
|
"monitor-yresolution",
|
|
|
|
"default-resolution_unit",
|
|
|
|
pixels_per_unit,
|
|
|
|
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION,
|
|
|
|
0.0, 0.0,
|
|
|
|
TRUE);
|
|
|
|
|
2000-02-04 12:31:18 +08:00
|
|
|
g_free (pixels_per_unit);
|
|
|
|
pixels_per_unit = NULL;
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
1999-03-28 02:16:30 +08:00
|
|
|
_("Horizontal"), 0, 1, 0.0);
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
1999-03-28 02:16:30 +08:00
|
|
|
_("Vertical"), 0, 2, 0.0);
|
1999-05-31 22:11:10 +08:00
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
|
1999-05-19 01:33:39 +08:00
|
|
|
_("dpi"), 1, 4, 0.0);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (abox), sizeentry);
|
|
|
|
gtk_widget_show (sizeentry);
|
2002-11-21 03:45:03 +08:00
|
|
|
gtk_widget_set_sensitive (sizeentry, ! display_config->monitor_res_from_gdk);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
2001-06-04 04:40:50 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
calibrate_button = gtk_button_new_with_label (_("Calibrate"));
|
|
|
|
gtk_misc_set_padding (GTK_MISC (GTK_BIN (calibrate_button)->child), 4, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), calibrate_button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (calibrate_button);
|
2002-11-21 03:45:03 +08:00
|
|
|
gtk_widget_set_sensitive (calibrate_button,
|
|
|
|
! display_config->monitor_res_from_gdk);
|
2000-09-25 09:27:47 +08:00
|
|
|
|
2001-07-25 08:42:47 +08:00
|
|
|
g_signal_connect (G_OBJECT (calibrate_button), "clicked",
|
|
|
|
G_CALLBACK (prefs_resolution_calibrate_callback),
|
|
|
|
sizeentry);
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
group = NULL;
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
button = gtk_radio_button_new_with_label (group, _("From Windowing System"));
|
2001-12-08 01:39:51 +08:00
|
|
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
|
2002-11-21 03:45:03 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-08-01 08:35:59 +08:00
|
|
|
g_object_set_data (G_OBJECT (button), "monitor_resolution_sizeentry",
|
|
|
|
sizeentry);
|
|
|
|
g_object_set_data (G_OBJECT (button), "set_sensitive",
|
|
|
|
label);
|
|
|
|
g_object_set_data (G_OBJECT (button), "inverse_sensitive",
|
|
|
|
sizeentry);
|
|
|
|
g_object_set_data (G_OBJECT (sizeentry), "inverse_sensitive",
|
|
|
|
calibrate_button);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (button), "toggled",
|
|
|
|
G_CALLBACK (prefs_res_source_callback),
|
|
|
|
config);
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
separator = gtk_hseparator_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), separator, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (separator);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
button = gtk_radio_button_new_with_label (group, _("Manually"));
|
2001-12-08 01:39:51 +08:00
|
|
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), abox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (abox);
|
2001-12-08 01:39:51 +08:00
|
|
|
|
2000-09-25 09:27:47 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
2001-12-08 01:39:51 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
if (! display_config->monitor_res_from_gdk)
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
/*****************/
|
|
|
|
/* Environment */
|
|
|
|
/*****************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
|
|
|
_("Environment"),
|
|
|
|
"environment.png",
|
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Environment"),
|
|
|
|
"dialogs/preferences/environment.html",
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
|
|
|
|
|
|
|
vbox2 = prefs_frame_new (_("Resource Consumption"), GTK_CONTAINER (vbox));
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_check_button_add (config, "stingy-memory-use",
|
|
|
|
_("Conservative Memory Usage"),
|
|
|
|
GTK_BOX (vbox2));
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
#ifdef ENABLE_MP
|
|
|
|
table = prefs_table_new (3, GTK_CONTAINER (vbox2), FALSE);
|
|
|
|
#else
|
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
|
|
|
|
#endif /* ENABLE_MP */
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_spin_button_add (config, "undo-levels", 1.0, 5.0, 0,
|
|
|
|
_("Levels of Undo:"),
|
|
|
|
GTK_TABLE (table), 0);
|
|
|
|
prefs_memsize_entry_add (config, "tile-cache-size",
|
|
|
|
_("Tile Cache Size:"),
|
|
|
|
GTK_TABLE (table), 1);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
#ifdef ENABLE_MP
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_spin_button_add (config, "num-processors", 1.0, 4.0, 0,
|
|
|
|
_("Number of Processors to Use:"),
|
|
|
|
GTK_TABLE (table), 2);
|
2002-03-01 00:55:38 +08:00
|
|
|
#endif /* ENABLE_MP */
|
|
|
|
|
|
|
|
vbox2 = prefs_frame_new (_("File Saving"), GTK_CONTAINER (vbox));
|
|
|
|
|
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox2), TRUE);
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_boolean_option_menu_add (config, "trust-dirty-flag",
|
|
|
|
_("Only when Modified"),
|
|
|
|
_("Always"),
|
|
|
|
_("\"File -> Save\" Saves the Image:"),
|
|
|
|
GTK_TABLE (table), 0);
|
|
|
|
prefs_enum_option_menu_add (config, "thumbnail-size", 0, 0,
|
|
|
|
_("Size of Thumbnails Files:"),
|
|
|
|
GTK_TABLE (table), 1);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*************/
|
|
|
|
/* Folders */
|
|
|
|
/*************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2002-02-12 06:30:45 +08:00
|
|
|
_("Folders"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"folders.png",
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2002-02-12 06:30:45 +08:00
|
|
|
_("Folders"),
|
|
|
|
"dialogs/preferences/folders.html",
|
2001-01-02 10:33:43 +08:00
|
|
|
NULL,
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
2001-12-08 01:39:51 +08:00
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
1999-11-27 21:44:54 +08:00
|
|
|
static const struct
|
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
const gchar *label;
|
|
|
|
const gchar *fs_label;
|
|
|
|
const gchar *property_name;
|
1999-11-27 21:44:54 +08:00
|
|
|
}
|
|
|
|
dirs[] =
|
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
{ N_("Temp Dir:"), N_("Select Temp Dir"), "temp-path" },
|
|
|
|
{ N_("Swap Dir:"), N_("Select Swap Dir"), "swap-path" },
|
1999-03-28 02:16:30 +08:00
|
|
|
};
|
2001-12-08 01:39:51 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
table = prefs_table_new (G_N_ELEMENTS (dirs) + 1,
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
2001-12-08 01:39:51 +08:00
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (dirs); i++)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
fileselection = gimp_prop_file_entry_new (config, dirs[i].property_name,
|
|
|
|
gettext (dirs[i].fs_label),
|
|
|
|
TRUE, TRUE);
|
2000-01-31 11:13:02 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, i,
|
2001-12-08 01:39:51 +08:00
|
|
|
gettext (dirs[i].label), 1.0, 0.5,
|
2000-01-31 11:13:02 +08:00
|
|
|
fileselection, 1, FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-12 06:30:45 +08:00
|
|
|
/* Folders / <paths> */
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
1999-11-27 21:44:54 +08:00
|
|
|
static const struct
|
|
|
|
{
|
2002-11-21 03:45:03 +08:00
|
|
|
const gchar *tree_label;
|
|
|
|
const gchar *label;
|
|
|
|
const gchar *icon;
|
|
|
|
const gchar *help_data;
|
|
|
|
const gchar *fs_label;
|
|
|
|
const gchar *property_name;
|
1999-11-27 21:44:54 +08:00
|
|
|
}
|
|
|
|
paths[] =
|
|
|
|
{
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Brushes"), N_("Brush Folders"), "folders-brushes.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#brushes",
|
|
|
|
N_("Select Brush Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"brush-path" },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Patterns"), N_("Pattern Folders"), "folders-patterns.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#patterns",
|
|
|
|
N_("Select Pattern Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"pattern-path" },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Palettes"), N_("Palette Folders"), "folders-palettes.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#palettes",
|
|
|
|
N_("Select Palette Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"palette-path" },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Gradients"), N_("Gradient Folders"), "folders-gradients.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#gradients",
|
|
|
|
N_("Select Gradient Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"gradient-path" },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Plug-Ins"), N_("Plug-In Folders"), "folders-plug-ins.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#plug_ins",
|
|
|
|
N_("Select Plug-In Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"plug-in-path" },
|
2002-03-06 19:48:16 +08:00
|
|
|
{ N_("Tool Plug-Ins"), N_("Tool Plug-In Folders"), "folders-tool-plug-ins.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#tool_plug_ins",
|
|
|
|
N_("Select Tool Plug-In Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"tool-plug-in-path" },
|
2002-03-06 19:48:16 +08:00
|
|
|
{ N_("Modules"), N_("Module Folders"), "folders-modules.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#modules",
|
|
|
|
N_("Select Module Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"module-path" },
|
2002-11-12 11:34:11 +08:00
|
|
|
{ N_("Environment"), N_("Environment Folders"), "folders-environ.png",
|
|
|
|
"dialogs/preferences/folders.html#environ",
|
|
|
|
N_("Select Environment Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"environ-path" },
|
2002-03-06 19:48:16 +08:00
|
|
|
{ N_("Themes"), N_("Theme Folders"), "folders-themes.png",
|
2002-02-12 06:30:45 +08:00
|
|
|
"dialogs/preferences/folders.html#themes",
|
|
|
|
N_("Select Theme Folders"),
|
2002-11-21 03:45:03 +08:00
|
|
|
"theme-path" }
|
1999-03-28 02:16:30 +08:00
|
|
|
};
|
2001-12-08 01:39:51 +08:00
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (paths); i++)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2001-01-02 10:33:43 +08:00
|
|
|
gettext (paths[i].label),
|
2002-03-01 21:34:09 +08:00
|
|
|
paths[i].icon,
|
2001-09-27 13:50:59 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2001-01-02 10:33:43 +08:00
|
|
|
gettext (paths[i].tree_label),
|
|
|
|
paths[i].help_data,
|
2001-09-27 13:50:59 +08:00
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
2002-02-28 21:47:03 +08:00
|
|
|
page_index++);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
patheditor = gimp_prop_path_editor_new (config, paths[i].property_name,
|
|
|
|
gettext (paths[i].fs_label));
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (vbox), patheditor);
|
|
|
|
gtk_widget_show (patheditor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-09-27 13:50:59 +08:00
|
|
|
gtk_widget_show (tv);
|
1999-03-28 02:16:30 +08:00
|
|
|
gtk_widget_show (notebook);
|
1999-11-27 21:44:54 +08:00
|
|
|
|
2001-09-27 13:50:59 +08:00
|
|
|
gtk_tree_view_expand_all (GTK_TREE_VIEW (tv));
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
return dialog;
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|