1999-03-28 02:16:30 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
2000-11-18 08:25:42 +08:00
|
|
|
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
1999-03-28 02:16:30 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-06-06 08:28:28 +08:00
|
|
|
|
2000-01-26 07:05:47 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2005-01-26 03:11:26 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
#include "config/gimprc.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2004-06-17 22:07:05 +08:00
|
|
|
#include "core/gimplist.h"
|
2003-10-14 23:20:59 +08:00
|
|
|
#include "core/gimptemplate.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2004-07-21 02:50:20 +08:00
|
|
|
#include "widgets/gimpactionview.h"
|
2002-12-04 06:16:56 +08:00
|
|
|
#include "widgets/gimpcolorpanel.h"
|
2004-05-12 00:01:00 +08:00
|
|
|
#include "widgets/gimpcontainercombobox.h"
|
|
|
|
#include "widgets/gimpcontainerview.h"
|
2005-05-09 17:35:41 +08:00
|
|
|
#include "widgets/gimpcontrollerlist.h"
|
2002-03-01 00:55:38 +08:00
|
|
|
#include "widgets/gimpdeviceinfo.h"
|
|
|
|
#include "widgets/gimpdevices.h"
|
2002-11-24 06:22:21 +08:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2003-10-10 22:11:47 +08:00
|
|
|
#include "widgets/gimpgrideditor.h"
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2002-11-21 03:45:03 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
2004-07-21 02:50:20 +08:00
|
|
|
#include "widgets/gimpuimanager.h"
|
2003-10-14 23:20:59 +08:00
|
|
|
#include "widgets/gimptemplateeditor.h"
|
2003-05-29 19:34:30 +08:00
|
|
|
#include "widgets/gimpwidgets-utils.h"
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-05-06 15:41:53 +08:00
|
|
|
#include "menus/menus.h"
|
|
|
|
|
2005-04-12 05:17:59 +08:00
|
|
|
#include "tools/gimp-tools.h"
|
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "gui/session.h"
|
|
|
|
#include "gui/themes.h"
|
|
|
|
|
2001-05-23 05:12:43 +08:00
|
|
|
#include "resolution-calibrate-dialog.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2000-12-29 23:22:01 +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,
|
2003-10-11 22:30:18 +08:00
|
|
|
GimpConfig *config);
|
2002-11-21 03:45:03 +08:00
|
|
|
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);
|
2003-11-06 23:27:05 +08:00
|
|
|
static void prefs_response (GtkWidget *widget,
|
|
|
|
gint response_id,
|
2002-11-23 06:10:40 +08:00
|
|
|
GtkWidget *dialog);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2005-08-01 04:07:14 +08:00
|
|
|
static void prefs_notebook_page_callback (GtkNotebook *notebook,
|
|
|
|
GtkNotebookPage *page,
|
|
|
|
guint page_num,
|
|
|
|
GtkTreeSelection *sel);
|
2003-10-14 23:20:59 +08:00
|
|
|
static void prefs_resolution_source_callback (GtkWidget *widget,
|
2002-11-21 03:45:03 +08:00
|
|
|
GObject *config);
|
|
|
|
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
|
2005-04-17 03:27:28 +08:00
|
|
|
GtkWidget *entry);
|
2004-03-09 18:51:25 +08:00
|
|
|
static void prefs_input_devices_dialog (GtkWidget *widget,
|
2004-07-21 02:50:20 +08:00
|
|
|
Gimp *gimp);
|
2002-11-21 03:45:03 +08:00
|
|
|
static void prefs_input_dialog_able_callback (GtkWidget *widget,
|
|
|
|
GdkDevice *device,
|
|
|
|
gpointer data);
|
2004-07-21 02:50:20 +08:00
|
|
|
static void prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
2004-07-22 00:11:31 +08:00
|
|
|
static void prefs_menus_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
|
|
|
static void prefs_menus_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
|
|
|
static void prefs_session_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
|
|
|
static void prefs_session_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
|
|
|
static void prefs_devices_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
|
|
|
static void prefs_devices_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
2005-04-12 05:17:59 +08:00
|
|
|
static void prefs_tool_options_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
|
|
|
static void prefs_tool_options_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
|
2002-11-26 22:54:28 +08:00
|
|
|
/* private variables */
|
|
|
|
|
|
|
|
static GtkWidget *prefs_dialog = NULL;
|
|
|
|
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
/* public function */
|
|
|
|
|
2002-11-25 21:48:24 +08:00
|
|
|
GtkWidget *
|
|
|
|
preferences_dialog_create (Gimp *gimp)
|
|
|
|
{
|
2003-10-11 22:30:18 +08:00
|
|
|
GimpConfig *config;
|
|
|
|
GimpConfig *config_copy;
|
|
|
|
GimpConfig *config_orig;
|
2002-11-25 21:48:24 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2002-11-26 22:54:28 +08:00
|
|
|
if (prefs_dialog)
|
|
|
|
return prefs_dialog;
|
|
|
|
|
2003-10-14 23:20:59 +08:00
|
|
|
/* turn off autosaving while the prefs dialog is open */
|
2002-11-30 21:08:44 +08:00
|
|
|
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), FALSE);
|
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
config = GIMP_CONFIG (gimp->edit_config);
|
2002-11-25 21:48:24 +08:00
|
|
|
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);
|
|
|
|
|
2002-11-26 22:54:28 +08:00
|
|
|
g_object_add_weak_pointer (G_OBJECT (prefs_dialog),
|
2004-04-23 01:38:14 +08:00
|
|
|
(gpointer) &prefs_dialog);
|
2002-11-26 22:54:28 +08:00
|
|
|
|
2002-12-14 22:13:54 +08:00
|
|
|
g_object_set_data (G_OBJECT (prefs_dialog), "gimp", gimp);
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2002-12-14 22:13:54 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (prefs_dialog), "config-copy", config_copy,
|
|
|
|
(GDestroyNotify) g_object_unref);
|
|
|
|
g_object_set_data_full (G_OBJECT (prefs_dialog), "config-orig", config_orig,
|
|
|
|
(GDestroyNotify) g_object_unref);
|
2002-11-25 21:48:24 +08:00
|
|
|
|
|
|
|
return prefs_dialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
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 23:46:19 +08:00
|
|
|
GValue global_value = { 0, };
|
2002-11-26 22:54:28 +08:00
|
|
|
GValue copy_value = { 0, };
|
1999-11-27 21:44:54 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_value_init (&global_value, param_spec->value_type);
|
|
|
|
g_value_init (©_value, param_spec->value_type);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_object_get_property (config, param_spec->name, &global_value);
|
|
|
|
g_object_get_property (config_copy, param_spec->name, ©_value);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
if (g_param_values_cmp (param_spec, &global_value, ©_value))
|
|
|
|
{
|
|
|
|
g_signal_handlers_block_by_func (config_copy,
|
|
|
|
prefs_config_copy_notify,
|
|
|
|
config);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_object_set_property (config_copy, param_spec->name, &global_value);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_signal_handlers_unblock_by_func (config_copy,
|
|
|
|
prefs_config_copy_notify,
|
|
|
|
config);
|
|
|
|
}
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_value_unset (&global_value);
|
|
|
|
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 23:46:19 +08:00
|
|
|
GValue copy_value = { 0, };
|
|
|
|
GValue global_value = { 0, };
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_value_init (©_value, param_spec->value_type);
|
|
|
|
g_value_init (&global_value, param_spec->value_type);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_object_get_property (config_copy, param_spec->name, ©_value);
|
|
|
|
g_object_get_property (config, param_spec->name, &global_value);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
if (g_param_values_cmp (param_spec, ©_value, &global_value))
|
2002-02-12 06:39:08 +08:00
|
|
|
{
|
2005-02-05 22:52:58 +08:00
|
|
|
if (param_spec->flags & GIMP_CONFIG_PARAM_CONFIRM)
|
2002-11-21 23:46:19 +08:00
|
|
|
{
|
2003-01-27 21:41:27 +08:00
|
|
|
#ifdef GIMP_CONFIG_DEBUG
|
2002-12-11 00:38:16 +08:00
|
|
|
g_print ("NOT Applying prefs change of '%s' to edit_config "
|
2002-11-21 23:46:19 +08:00
|
|
|
"because it needs confirmation\n",
|
|
|
|
param_spec->name);
|
2003-01-27 21:41:27 +08:00
|
|
|
#endif
|
2002-11-21 23:46:19 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-27 21:41:27 +08:00
|
|
|
#ifdef GIMP_CONFIG_DEBUG
|
2002-12-11 00:38:16 +08:00
|
|
|
g_print ("Applying prefs change of '%s' to edit_config\n",
|
2002-11-21 23:46:19 +08:00
|
|
|
param_spec->name);
|
2003-01-27 21:41:27 +08:00
|
|
|
#endif
|
2002-11-21 23:46:19 +08:00
|
|
|
g_signal_handlers_block_by_func (config,
|
|
|
|
prefs_config_notify,
|
|
|
|
config_copy);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_object_set_property (config, param_spec->name, ©_value);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_signal_handlers_unblock_by_func (config,
|
|
|
|
prefs_config_notify,
|
|
|
|
config_copy);
|
|
|
|
}
|
2000-01-26 07:05:47 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
g_value_unset (©_value);
|
|
|
|
g_value_unset (&global_value);
|
2002-11-21 03:45:03 +08:00
|
|
|
}
|
|
|
|
|
1998-06-09 05:53:45 +08:00
|
|
|
static void
|
2003-11-06 23:27:05 +08:00
|
|
|
prefs_response (GtkWidget *widget,
|
|
|
|
gint response_id,
|
|
|
|
GtkWidget *dialog)
|
1998-06-09 05:53:45 +08:00
|
|
|
{
|
2003-11-06 23:27:05 +08:00
|
|
|
Gimp *gimp = g_object_get_data (G_OBJECT (dialog), "gimp");
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
if (response_id == GTK_RESPONSE_OK)
|
|
|
|
{
|
2005-04-07 18:33:58 +08:00
|
|
|
GObject *config_copy;
|
|
|
|
GList *restart_diff;
|
|
|
|
GList *confirm_diff;
|
|
|
|
GList *list;
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
config_copy = g_object_get_data (G_OBJECT (dialog), "config-copy");
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
/* destroy config_orig */
|
|
|
|
g_object_set_data (G_OBJECT (dialog), "config-orig", NULL);
|
2001-06-18 21:10:03 +08:00
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (dialog), FALSE);
|
2001-11-09 03:14:51 +08:00
|
|
|
|
2005-04-07 18:33:58 +08:00
|
|
|
confirm_diff = gimp_config_diff (G_OBJECT (gimp->edit_config),
|
2003-11-06 23:27:05 +08:00
|
|
|
config_copy,
|
2005-02-05 22:52:58 +08:00
|
|
|
GIMP_CONFIG_PARAM_CONFIRM);
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_object_freeze_notify (G_OBJECT (gimp->edit_config));
|
2002-11-21 23:46:19 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
for (list = confirm_diff; list; list = g_list_next (list))
|
|
|
|
{
|
2005-04-07 18:33:58 +08:00
|
|
|
GParamSpec *param_spec = list->data;
|
|
|
|
GValue value = { 0, };
|
2002-11-21 23:46:19 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_value_init (&value, param_spec->value_type);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2005-04-07 18:33:58 +08:00
|
|
|
g_object_get_property (config_copy,
|
2003-11-06 23:27:05 +08:00
|
|
|
param_spec->name, &value);
|
|
|
|
g_object_set_property (G_OBJECT (gimp->edit_config),
|
|
|
|
param_spec->name, &value);
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
2002-11-30 21:08:44 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_object_thaw_notify (G_OBJECT (gimp->edit_config));
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_list_free (confirm_diff);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
gimp_rc_save (GIMP_RC (gimp->edit_config));
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
/* spit out a solely informational warning about changed values
|
|
|
|
* which need restart
|
|
|
|
*/
|
2005-04-07 18:33:58 +08:00
|
|
|
restart_diff = gimp_config_diff (G_OBJECT (gimp->edit_config),
|
|
|
|
G_OBJECT (gimp->config),
|
2005-02-05 22:52:58 +08:00
|
|
|
GIMP_CONFIG_PARAM_RESTART);
|
2001-07-27 07:35:00 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
if (restart_diff)
|
|
|
|
{
|
|
|
|
GString *string;
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-14 23:33:40 +08:00
|
|
|
string = g_string_new (_("You will have to restart GIMP for "
|
2003-11-06 23:27:05 +08:00
|
|
|
"the following changes to take effect:"));
|
|
|
|
g_string_append (string, "\n\n");
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
for (list = restart_diff; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GParamSpec *param_spec = list->data;
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_string_append_printf (string, "%s\n", param_spec->name);
|
|
|
|
}
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_message (string->str);
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_string_free (string, TRUE);
|
|
|
|
}
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_list_free (restart_diff);
|
2002-11-25 21:48:24 +08:00
|
|
|
}
|
2003-11-06 23:27:05 +08:00
|
|
|
else /* cancel */
|
|
|
|
{
|
2005-04-07 18:33:58 +08:00
|
|
|
GObject *config_orig;
|
|
|
|
GList *diff;
|
|
|
|
GList *list;
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
config_orig = g_object_get_data (G_OBJECT (dialog), "config-orig");
|
2002-11-30 21:08:44 +08:00
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
/* destroy config_copy */
|
|
|
|
g_object_set_data (G_OBJECT (dialog), "config-copy", NULL);
|
2002-11-30 21:08:44 +08:00
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (dialog), FALSE);
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2005-04-07 18:33:58 +08:00
|
|
|
diff = gimp_config_diff (G_OBJECT (gimp->edit_config),
|
|
|
|
config_orig,
|
2005-02-05 22:52:58 +08:00
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE);
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_object_freeze_notify (G_OBJECT (gimp->edit_config));
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
for (list = diff; list; list = g_list_next (list))
|
2002-11-21 03:45:03 +08:00
|
|
|
{
|
2005-04-07 18:33:58 +08:00
|
|
|
GParamSpec *param_spec = list->data;
|
|
|
|
GValue value = { 0, };
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_value_init (&value, param_spec->value_type);
|
|
|
|
|
2005-04-07 18:33:58 +08:00
|
|
|
g_object_get_property (config_orig,
|
|
|
|
param_spec->name, &value);
|
2003-11-06 23:27:05 +08:00
|
|
|
g_object_set_property (G_OBJECT (gimp->edit_config),
|
2005-04-07 18:33:58 +08:00
|
|
|
param_spec->name, &value);
|
2003-11-06 23:27:05 +08:00
|
|
|
|
|
|
|
g_value_unset (&value);
|
2002-11-21 03:45:03 +08:00
|
|
|
}
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_object_thaw_notify (G_OBJECT (gimp->edit_config));
|
2002-11-25 21:48:24 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_list_free (diff);
|
|
|
|
}
|
2003-11-12 20:56:31 +08:00
|
|
|
|
2004-05-03 04:30:41 +08:00
|
|
|
/* enable autosaving again */
|
|
|
|
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), TRUE);
|
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
gtk_widget_destroy (dialog);
|
1999-03-14 07:03:11 +08:00
|
|
|
}
|
|
|
|
|
1999-03-03 20:35:12 +08:00
|
|
|
static void
|
2004-05-12 00:01:00 +08:00
|
|
|
prefs_template_select_callback (GimpContainerView *view,
|
2003-10-14 23:20:59 +08:00
|
|
|
GimpTemplate *template,
|
|
|
|
gpointer insert_data,
|
|
|
|
GimpTemplate *edit_template)
|
1999-03-03 20:35:12 +08:00
|
|
|
{
|
2003-10-14 23:20:59 +08:00
|
|
|
if (template)
|
2005-04-07 18:33:58 +08:00
|
|
|
gimp_config_sync (G_OBJECT (template), G_OBJECT (edit_template), 0);
|
1999-03-03 20:35:12 +08:00
|
|
|
}
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
static void
|
2003-10-14 23:20:59 +08:00
|
|
|
prefs_resolution_source_callback (GtkWidget *widget,
|
|
|
|
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-12-14 22:13:54 +08:00
|
|
|
from_gdk = GTK_TOGGLE_BUTTON (widget)->active;
|
1999-02-25 19:25:53 +08:00
|
|
|
|
2002-12-14 22:13:54 +08:00
|
|
|
if (from_gdk)
|
|
|
|
{
|
2003-05-29 19:34:30 +08:00
|
|
|
gimp_get_screen_resolution (NULL, &xres, &yres);
|
2002-12-14 22:13:54 +08:00
|
|
|
}
|
|
|
|
else
|
1999-02-25 19:25:53 +08:00
|
|
|
{
|
2005-04-17 03:27:28 +08:00
|
|
|
GimpSizeEntry *entry = g_object_get_data (G_OBJECT (widget),
|
|
|
|
"monitor_resolution_sizeentry");
|
|
|
|
if (entry)
|
2005-08-01 04:07:14 +08:00
|
|
|
{
|
|
|
|
xres = gimp_size_entry_get_refval (entry, 0);
|
|
|
|
yres = gimp_size_entry_get_refval (entry, 1);
|
|
|
|
}
|
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,
|
2002-11-21 23:46:19 +08:00
|
|
|
"monitor-resolution-from-windowing-system", from_gdk,
|
2002-11-21 03:45:03 +08:00
|
|
|
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,
|
2005-08-01 04:07:14 +08:00
|
|
|
GtkWidget *entry)
|
2000-09-25 09:27:47 +08:00
|
|
|
{
|
2002-03-01 02:34:41 +08:00
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *image;
|
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
dialog = gtk_widget_get_toplevel (entry);
|
2002-03-01 02:34:41 +08:00
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
notebook = g_object_get_data (G_OBJECT (dialog), "notebook");
|
|
|
|
image = g_object_get_data (G_OBJECT (notebook), "image");
|
2002-03-01 02:34:41 +08:00
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
resolution_calibrate_dialog (entry, gtk_image_get_pixbuf (GTK_IMAGE (image)));
|
2000-09-25 09:27:47 +08:00
|
|
|
}
|
|
|
|
|
2003-04-14 22:15:20 +08:00
|
|
|
static void
|
2004-03-09 18:51:25 +08:00
|
|
|
prefs_input_devices_dialog (GtkWidget *widget,
|
2004-07-21 02:50:20 +08:00
|
|
|
Gimp *gimp)
|
2003-04-14 22:15:20 +08:00
|
|
|
{
|
|
|
|
static GtkWidget *input_dialog = NULL;
|
|
|
|
|
|
|
|
if (input_dialog)
|
|
|
|
{
|
|
|
|
gtk_window_present (GTK_WINDOW (input_dialog));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-06-15 18:10:25 +08:00
|
|
|
input_dialog = g_object_new (GTK_TYPE_INPUT_DIALOG,
|
|
|
|
"title", _("Configure Input Devices"),
|
|
|
|
NULL);
|
2003-04-14 22:15:20 +08:00
|
|
|
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (input_dialog),
|
2004-04-23 01:38:14 +08:00
|
|
|
(gpointer) &input_dialog);
|
2003-04-14 22:15:20 +08:00
|
|
|
|
|
|
|
gtk_window_set_transient_for (GTK_WINDOW (input_dialog),
|
|
|
|
GTK_WINDOW (prefs_dialog));
|
|
|
|
gtk_window_set_destroy_with_parent (GTK_WINDOW (input_dialog), TRUE);
|
2003-07-18 06:30:13 +08:00
|
|
|
|
2004-03-09 18:51:25 +08:00
|
|
|
g_signal_connect_swapped (GTK_INPUT_DIALOG (input_dialog)->save_button,
|
|
|
|
"clicked",
|
|
|
|
G_CALLBACK (gimp_devices_save),
|
|
|
|
gimp);
|
2003-04-14 22:15:20 +08:00
|
|
|
|
|
|
|
g_signal_connect_swapped (GTK_INPUT_DIALOG (input_dialog)->close_button,
|
|
|
|
"clicked",
|
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
|
|
|
input_dialog);
|
|
|
|
|
|
|
|
g_signal_connect (input_dialog, "enable_device",
|
|
|
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
|
|
|
NULL);
|
|
|
|
g_signal_connect (input_dialog, "disable_device",
|
|
|
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_widget_show (input_dialog);
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2004-07-21 19:28:31 +08:00
|
|
|
static void
|
|
|
|
prefs_keyboard_shortcuts_destroy (GtkWidget *widget,
|
|
|
|
GtkWidget *prefs)
|
|
|
|
{
|
|
|
|
g_object_set_data (G_OBJECT (prefs), "gimp-keyboard-shortcuts-dialog", NULL);
|
|
|
|
}
|
|
|
|
|
2004-07-21 02:50:20 +08:00
|
|
|
static void
|
|
|
|
prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
2004-12-16 18:57:03 +08:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
2004-07-21 02:50:20 +08:00
|
|
|
GtkWidget *scrolled_window;
|
|
|
|
GtkWidget *view;
|
2004-12-16 18:57:03 +08:00
|
|
|
GtkWidget *image;
|
|
|
|
GtkWidget *label;
|
2004-07-21 02:50:20 +08:00
|
|
|
|
2004-07-21 19:28:31 +08:00
|
|
|
dialog = g_object_get_data (G_OBJECT (gtk_widget_get_toplevel (widget)),
|
|
|
|
"gimp-keyboard-shortcuts-dialog");
|
|
|
|
|
|
|
|
if (dialog)
|
|
|
|
{
|
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-07-21 02:50:20 +08:00
|
|
|
dialog = gimp_dialog_new (_("Configure Keyboard Shortcuts"),
|
|
|
|
"gimp-keyboard-shortcuts-dialog",
|
|
|
|
gtk_widget_get_toplevel (widget),
|
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
gimp_standard_help_func,
|
|
|
|
GIMP_HELP_PREFS_INTERFACE,
|
|
|
|
|
2004-07-21 08:39:46 +08:00
|
|
|
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
|
2004-07-21 02:50:20 +08:00
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
2004-07-21 19:28:31 +08:00
|
|
|
g_object_set_data (G_OBJECT (gtk_widget_get_toplevel (widget)),
|
|
|
|
"gimp-keyboard-shortcuts-dialog", dialog);
|
|
|
|
|
2004-10-29 18:58:16 +08:00
|
|
|
gimp_dialog_factory_add_foreign (gimp_dialog_factory_from_name ("toplevel"),
|
|
|
|
"gimp-keyboard-shortcuts-dialog", dialog);
|
|
|
|
|
2004-07-21 02:50:20 +08:00
|
|
|
g_signal_connect (dialog, "response",
|
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
|
|
|
NULL);
|
2004-07-21 19:28:31 +08:00
|
|
|
g_signal_connect_object (dialog, "destroy",
|
|
|
|
G_CALLBACK (prefs_keyboard_shortcuts_destroy),
|
|
|
|
gtk_widget_get_toplevel (widget), 0);
|
2004-07-21 02:50:20 +08:00
|
|
|
|
2004-12-16 18:57:03 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 12);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
2004-07-21 02:50:20 +08:00
|
|
|
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
|
|
|
|
GTK_SHADOW_IN);
|
2004-12-16 18:57:03 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0);
|
2004-07-21 02:50:20 +08:00
|
|
|
gtk_widget_show (scrolled_window);
|
|
|
|
|
|
|
|
view = gimp_action_view_new (gimp_ui_managers_from_name ("<Image>")->data,
|
2004-10-26 23:10:00 +08:00
|
|
|
NULL, TRUE);
|
2004-07-21 02:50:20 +08:00
|
|
|
gtk_widget_set_size_request (view, 300, 400);
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_window), view);
|
|
|
|
gtk_widget_show (view);
|
|
|
|
|
2004-12-16 18:57:03 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 12);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
image = gtk_image_new_from_stock (GIMP_STOCK_INFO, GTK_ICON_SIZE_DIALOG);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (image);
|
|
|
|
|
|
|
|
label = g_object_new (GTK_TYPE_LABEL,
|
|
|
|
"label", _("To edit a shortcut key, click on the "
|
|
|
|
"corresponding row and type a new "
|
|
|
|
"accelerator, or press backspace to "
|
|
|
|
"clear."),
|
|
|
|
"wrap", TRUE,
|
|
|
|
"justify", GTK_JUSTIFY_LEFT,
|
|
|
|
"xalign", 0.0,
|
|
|
|
"yalign", 0.5,
|
|
|
|
NULL);
|
2005-06-25 08:30:20 +08:00
|
|
|
gimp_label_set_attributes (GTK_LABEL (label),
|
|
|
|
PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
|
|
|
|
-1);
|
2004-12-16 18:57:03 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
2004-07-21 02:50:20 +08:00
|
|
|
gtk_widget_show (dialog);
|
|
|
|
}
|
|
|
|
|
2004-07-22 00:11:31 +08:00
|
|
|
static void
|
|
|
|
prefs_menus_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GtkWidget *clear_button;
|
|
|
|
|
|
|
|
menus_save (gimp, TRUE);
|
|
|
|
|
|
|
|
clear_button = g_object_get_data (G_OBJECT (widget), "clear-button");
|
|
|
|
|
|
|
|
if (clear_button)
|
|
|
|
gtk_widget_set_sensitive (clear_button, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_menus_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
if (! menus_clear (gimp, &error))
|
|
|
|
{
|
|
|
|
g_message (error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (widget, FALSE);
|
|
|
|
|
|
|
|
g_message (_("Your keyboard shortcuts will be reset to default values "
|
|
|
|
"the next time you start GIMP."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_session_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GtkWidget *clear_button;
|
|
|
|
|
|
|
|
session_save (gimp, TRUE);
|
|
|
|
|
|
|
|
clear_button = g_object_get_data (G_OBJECT (widget), "clear-button");
|
|
|
|
|
|
|
|
if (clear_button)
|
|
|
|
gtk_widget_set_sensitive (clear_button, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_session_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
if (! session_clear (gimp, &error))
|
|
|
|
{
|
|
|
|
g_message (error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (widget, FALSE);
|
|
|
|
|
2004-11-06 22:25:03 +08:00
|
|
|
g_message (_("Your window setup will be reset to default values "
|
2004-07-22 00:11:31 +08:00
|
|
|
"the next time you start GIMP."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_devices_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GtkWidget *clear_button;
|
|
|
|
|
|
|
|
gimp_devices_save (gimp, TRUE);
|
|
|
|
|
|
|
|
clear_button = g_object_get_data (G_OBJECT (widget), "clear-button");
|
|
|
|
|
|
|
|
if (clear_button)
|
|
|
|
gtk_widget_set_sensitive (clear_button, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_devices_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
if (! gimp_devices_clear (gimp, &error))
|
|
|
|
{
|
|
|
|
g_message (error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (widget, FALSE);
|
|
|
|
|
|
|
|
g_message (_("Your input device settings will be reset to "
|
|
|
|
"default values the next time you start GIMP."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-04-12 05:17:59 +08:00
|
|
|
static void
|
|
|
|
prefs_tool_options_save_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GtkWidget *clear_button;
|
|
|
|
|
|
|
|
gimp_tools_save (gimp, TRUE, TRUE);
|
|
|
|
|
|
|
|
clear_button = g_object_get_data (G_OBJECT (widget), "clear-button");
|
|
|
|
|
|
|
|
if (clear_button)
|
|
|
|
gtk_widget_set_sensitive (clear_button, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prefs_tool_options_clear_callback (GtkWidget *widget,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
if (! gimp_tools_clear (gimp, &error))
|
|
|
|
{
|
|
|
|
g_message (error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive (widget, FALSE);
|
|
|
|
|
|
|
|
g_message (_("Your tool options will be reset to "
|
|
|
|
"default values the next time you start GIMP."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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,
|
2003-06-11 23:01:38 +08:00
|
|
|
const gchar *notebook_label,
|
2002-02-28 21:47:03 +08:00
|
|
|
const gchar *notebook_icon,
|
2003-06-11 23:01:38 +08:00
|
|
|
GtkTreeStore *tree,
|
|
|
|
const gchar *tree_label,
|
2003-08-24 03:35:05 +08:00
|
|
|
const gchar *help_id,
|
2003-06-11 23:01:38 +08:00
|
|
|
GtkTreeIter *parent,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gint page_index)
|
1999-03-28 02:16:30 +08:00
|
|
|
{
|
2003-09-11 07:42:59 +08:00
|
|
|
GtkWidget *event_box;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
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 ();
|
2005-05-11 03:48:03 +08:00
|
|
|
gtk_event_box_set_visible_window (GTK_EVENT_BOX (event_box), FALSE);
|
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);
|
|
|
|
|
2003-08-24 03:35:05 +08:00
|
|
|
gimp_help_set_help_data (event_box, NULL, help_id);
|
1999-12-18 19:37:11 +08:00
|
|
|
|
2004-05-03 04:30:41 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 12);
|
2004-05-21 22:17:27 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
2002-03-01 02:34:41 +08:00
|
|
|
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)
|
|
|
|
{
|
2003-11-16 01:53:18 +08:00
|
|
|
gchar *filename;
|
2002-02-28 21:47:03 +08:00
|
|
|
|
2003-11-16 01:53:18 +08:00
|
|
|
filename = themes_get_theme_file (gimp, "images", "preferences",
|
|
|
|
notebook_icon, NULL);
|
2002-02-28 21:47:03 +08:00
|
|
|
|
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)
|
2003-09-11 07:42:59 +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,
|
2005-02-11 21:32:10 +08:00
|
|
|
1, tree_label ? tree_label : notebook_label,
|
2002-03-01 02:34:41 +08:00
|
|
|
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,
|
2005-08-01 04:07:14 +08:00
|
|
|
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
|
|
|
|
2005-08-01 04:07:14 +08:00
|
|
|
g_signal_handlers_block_by_func (notebook,
|
|
|
|
prefs_notebook_page_callback,
|
|
|
|
sel);
|
2001-09-27 13:50:59 +08:00
|
|
|
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
g_value_get_int (&val));
|
|
|
|
g_signal_handlers_unblock_by_func (notebook,
|
|
|
|
prefs_notebook_page_callback,
|
|
|
|
sel);
|
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
|
|
|
|
2005-08-01 04:07:14 +08:00
|
|
|
static void
|
|
|
|
prefs_notebook_page_callback (GtkNotebook *notebook,
|
|
|
|
GtkNotebookPage *page,
|
|
|
|
guint page_num,
|
|
|
|
GtkTreeSelection *sel)
|
|
|
|
{
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter child_iter;
|
|
|
|
GtkTreeView *view;
|
|
|
|
GValue val = { 0, };
|
|
|
|
gint val_int;
|
|
|
|
gint num_children;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
view = gtk_tree_selection_get_tree_view (sel);
|
|
|
|
model = gtk_tree_view_get_model (view);
|
|
|
|
|
|
|
|
if (gtk_tree_model_get_iter_first (model, &iter))
|
|
|
|
{
|
|
|
|
do
|
|
|
|
{
|
|
|
|
gtk_tree_model_get_value (model, &iter, 2, &val);
|
|
|
|
|
|
|
|
val_int = g_value_get_int (&val);
|
|
|
|
g_value_unset (&val);
|
|
|
|
|
|
|
|
if (val_int == page_num)
|
|
|
|
{
|
|
|
|
gtk_tree_selection_select_iter (sel, &iter);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (gtk_tree_model_iter_has_child (model, &iter))
|
|
|
|
{
|
|
|
|
num_children = gtk_tree_model_iter_n_children (model, &iter);
|
|
|
|
|
|
|
|
for (i = 0; i < num_children; i++)
|
|
|
|
{
|
|
|
|
gtk_tree_model_iter_nth_child (model, &child_iter, &iter, i);
|
|
|
|
gtk_tree_model_get_value (model, &child_iter, 2, &val);
|
|
|
|
|
|
|
|
val_int = g_value_get_int (&val);
|
|
|
|
g_value_unset (&val);
|
|
|
|
|
|
|
|
if (val_int == page_num)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
|
|
path = gtk_tree_model_get_path (model, &child_iter);
|
|
|
|
gtk_tree_view_expand_to_path (view, path);
|
|
|
|
gtk_tree_selection_select_iter (sel, &child_iter);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (gtk_tree_model_iter_next (model, &iter));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
static void
|
|
|
|
prefs_format_string_select_callback (GtkTreeSelection *sel,
|
|
|
|
GtkEntry *entry)
|
|
|
|
{
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
2003-06-11 23:01:38 +08:00
|
|
|
if (gtk_tree_selection_get_selected (sel, &model, &iter))
|
|
|
|
{
|
|
|
|
GValue val = { 0, };
|
2002-11-23 06:10:40 +08:00
|
|
|
|
2003-06-11 23:01:38 +08:00
|
|
|
gtk_tree_model_get_value (model, &iter, 1, &val);
|
|
|
|
gtk_entry_set_text (entry, g_value_get_string (&val));
|
|
|
|
g_value_unset (&val);
|
|
|
|
}
|
2002-11-23 06:10:40 +08:00
|
|
|
}
|
|
|
|
|
2003-11-12 07:56:00 +08:00
|
|
|
static void
|
|
|
|
prefs_theme_select_callback (GtkTreeSelection *sel,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
if (gtk_tree_selection_get_selected (sel, &model, &iter))
|
|
|
|
{
|
|
|
|
GValue val = { 0, };
|
|
|
|
|
|
|
|
gtk_tree_model_get_value (model, &iter, 0, &val);
|
|
|
|
g_object_set (gimp->config, "theme", g_value_get_string (&val), NULL);
|
|
|
|
g_value_unset (&val);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
static void
|
|
|
|
prefs_theme_reload_callback (GtkWidget *button,
|
|
|
|
Gimp *gimp)
|
|
|
|
{
|
|
|
|
g_object_notify (G_OBJECT (gimp->config), "theme");
|
|
|
|
}
|
|
|
|
|
1999-11-27 21:44:54 +08:00
|
|
|
static GtkWidget *
|
2003-10-22 22:46:05 +08:00
|
|
|
prefs_frame_new (const gchar *label,
|
2005-08-01 04:07:14 +08:00
|
|
|
GtkContainer *parent,
|
2002-11-23 06:10:40 +08:00
|
|
|
gboolean expand)
|
1999-11-27 21:44:54 +08:00
|
|
|
{
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *vbox;
|
2002-02-28 21:47:03 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
frame = gimp_frame_new (label);
|
2002-11-24 08:03:42 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 6);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
2002-11-24 08:03:42 +08:00
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
if (GTK_IS_BOX (parent))
|
2002-11-23 06:10:40 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (parent), frame, expand, expand, 0);
|
2002-02-28 21:47:03 +08:00
|
|
|
else
|
|
|
|
gtk_container_add (parent, frame);
|
|
|
|
|
1999-11-27 21:44:54 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
return vbox;
|
1999-11-27 21:44:54 +08:00
|
|
|
}
|
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
static GtkWidget *
|
|
|
|
prefs_table_new (gint rows,
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkContainer *parent)
|
2002-02-28 21:47:03 +08:00
|
|
|
{
|
|
|
|
GtkWidget *table;
|
|
|
|
|
|
|
|
table = gtk_table_new (rows, 2, FALSE);
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
2002-02-28 21:47:03 +08:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2004-06-17 22:07:05 +08:00
|
|
|
static GtkWidget *
|
|
|
|
prefs_button_add (const gchar *stock_id,
|
|
|
|
const gchar *label,
|
|
|
|
GtkBox *box)
|
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *image;
|
|
|
|
GtkWidget *lab;
|
|
|
|
|
|
|
|
button = gtk_button_new ();
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (button), hbox);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (image);
|
|
|
|
|
|
|
|
lab = gtk_label_new_with_mnemonic (label);
|
|
|
|
gtk_label_set_mnemonic_widget (GTK_LABEL (lab), button);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), lab, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (lab);
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2002-02-28 21:47:03 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2004-03-05 00:10:57 +08:00
|
|
|
static GtkWidget *
|
|
|
|
prefs_check_button_add_with_icon (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
|
|
|
const gchar *stock_id,
|
|
|
|
GtkBox *vbox)
|
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *image;
|
|
|
|
|
|
|
|
button = gimp_prop_check_button_new (config, property_name, label);
|
|
|
|
if (!button)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
|
|
|
gtk_box_pack_start (vbox, hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
|
|
|
|
gtk_misc_set_padding (GTK_MISC (image), 2, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (image);
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
static GtkWidget *
|
2004-05-21 22:17:27 +08:00
|
|
|
prefs_widget_add_aligned (GtkWidget *widget,
|
|
|
|
const gchar *text,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row,
|
|
|
|
gboolean left_align,
|
|
|
|
GtkSizeGroup *group)
|
2002-11-24 06:22:21 +08:00
|
|
|
{
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkWidget *label = gimp_table_attach_aligned (table, 0, table_row,
|
|
|
|
text, 0.0, 0.5,
|
|
|
|
widget, 1, left_align);
|
|
|
|
if (group)
|
|
|
|
gtk_size_group_add_widget (group, label);
|
2002-11-24 06:22:21 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
|
|
|
prefs_color_button_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
|
|
|
const gchar *title,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row,
|
|
|
|
GtkSizeGroup *group)
|
|
|
|
{
|
|
|
|
GtkWidget *button = gimp_prop_color_button_new (config, property_name, title,
|
|
|
|
60, 20,
|
|
|
|
GIMP_COLOR_AREA_FLAT);
|
2002-11-24 06:22:21 +08:00
|
|
|
|
|
|
|
if (button)
|
2004-05-21 22:17:27 +08:00
|
|
|
prefs_widget_add_aligned (button, label, table, table_row, TRUE, group);
|
2002-11-24 06:22:21 +08:00
|
|
|
|
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
static GtkWidget *
|
2004-05-21 22:17:27 +08:00
|
|
|
prefs_enum_combo_box_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row,
|
|
|
|
GtkSizeGroup *group)
|
2002-11-21 03:45:03 +08:00
|
|
|
{
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkWidget *combo = gimp_prop_enum_combo_box_new (config, property_name,
|
|
|
|
minimum, maximum);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
if (combo)
|
|
|
|
prefs_widget_add_aligned (combo, label, table, table_row, FALSE, group);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
return combo;
|
2002-11-21 03:45:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
2004-05-21 22:17:27 +08:00
|
|
|
prefs_boolean_combo_box_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *true_text,
|
|
|
|
const gchar *false_text,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row,
|
|
|
|
GtkSizeGroup *group)
|
2002-11-21 03:45:03 +08:00
|
|
|
{
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkWidget *combo = gimp_prop_boolean_combo_box_new (config, property_name,
|
|
|
|
true_text, false_text);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
if (combo)
|
|
|
|
prefs_widget_add_aligned (combo, label, table, table_row, FALSE, group);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
return combo;
|
2002-11-21 03:45:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
2004-05-21 22:17:27 +08:00
|
|
|
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,
|
|
|
|
GtkSizeGroup *group)
|
2002-11-21 03:45:03 +08:00
|
|
|
{
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkWidget *button = gimp_prop_spin_button_new (config, property_name,
|
|
|
|
step_increment,
|
|
|
|
page_increment,
|
|
|
|
digits);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
if (button)
|
|
|
|
prefs_widget_add_aligned (button, label, table, table_row, TRUE, group);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
return button;
|
2002-11-21 03:45:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget *
|
2004-05-21 22:17:27 +08:00
|
|
|
prefs_memsize_entry_add (GObject *config,
|
|
|
|
const gchar *property_name,
|
|
|
|
const gchar *label,
|
|
|
|
GtkTable *table,
|
|
|
|
gint table_row,
|
|
|
|
GtkSizeGroup *group)
|
2002-11-21 03:45:03 +08:00
|
|
|
{
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkWidget *entry = gimp_prop_memsize_entry_new (config, property_name);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
if (entry)
|
2004-05-21 22:17:27 +08:00
|
|
|
prefs_widget_add_aligned (entry, label, table, table_row, TRUE, group);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
|
2004-11-10 21:44:14 +08:00
|
|
|
static void
|
|
|
|
prefs_canvas_padding_color_changed (GtkWidget *button,
|
|
|
|
GtkWidget *combo)
|
|
|
|
{
|
|
|
|
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo),
|
|
|
|
GIMP_CANVAS_PADDING_MODE_CUSTOM);
|
|
|
|
}
|
|
|
|
|
2003-10-22 22:46:05 +08:00
|
|
|
static void
|
|
|
|
prefs_display_options_frame_add (Gimp *gimp,
|
|
|
|
GObject *object,
|
|
|
|
const gchar *label,
|
|
|
|
GtkContainer *parent)
|
|
|
|
{
|
2003-10-23 19:39:33 +08:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
2003-10-23 04:32:13 +08:00
|
|
|
GtkWidget *checks_vbox;
|
2003-10-22 22:46:05 +08:00
|
|
|
GtkWidget *table;
|
2004-11-10 21:44:14 +08:00
|
|
|
GtkWidget *combo;
|
2003-10-22 22:46:05 +08:00
|
|
|
GtkWidget *button;
|
|
|
|
|
2003-10-23 19:39:33 +08:00
|
|
|
vbox = prefs_frame_new (label, parent, FALSE);
|
|
|
|
|
2004-06-03 01:56:02 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
2003-10-23 19:39:33 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
2003-10-23 04:32:13 +08:00
|
|
|
|
2003-10-23 19:39:33 +08:00
|
|
|
checks_vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), checks_vbox, TRUE, TRUE, 0);
|
2003-10-23 04:32:13 +08:00
|
|
|
gtk_widget_show (checks_vbox);
|
|
|
|
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-menubar",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show _menubar"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-rulers",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show _rulers"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-scrollbars",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show scroll_bars"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-statusbar",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show s_tatusbar"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
|
|
|
|
2003-10-23 19:39:33 +08:00
|
|
|
checks_vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), checks_vbox, TRUE, TRUE, 0);
|
2003-10-23 04:32:13 +08:00
|
|
|
gtk_widget_show (checks_vbox);
|
2003-10-22 22:46:05 +08:00
|
|
|
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-selection",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show s_election"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-layer-boundary",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show _layer boundary"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-guides",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show _guides"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
2003-10-23 19:39:33 +08:00
|
|
|
prefs_check_button_add (object, "show-grid",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show gri_d"),
|
2003-10-23 04:32:13 +08:00
|
|
|
GTK_BOX (checks_vbox));
|
2003-10-22 22:46:05 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox));
|
2003-10-22 22:46:05 +08:00
|
|
|
|
2004-11-10 21:44:14 +08:00
|
|
|
combo = prefs_enum_combo_box_add (object, "padding-mode", 0, 0,
|
|
|
|
_("Canvas _padding mode:"),
|
|
|
|
GTK_TABLE (table), 0,
|
|
|
|
NULL);
|
2003-10-22 22:46:05 +08:00
|
|
|
|
|
|
|
button = prefs_color_button_add (object, "padding-color",
|
2004-10-13 06:57:15 +08:00
|
|
|
_("Custom p_adding color:"),
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Select custom canvas padding color"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 1, NULL);
|
2003-10-22 22:46:05 +08:00
|
|
|
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
|
|
|
|
gimp_get_user_context (gimp));
|
2004-11-10 21:44:14 +08:00
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect (button, "color-changed",
|
2004-11-10 21:44:14 +08:00
|
|
|
G_CALLBACK (prefs_canvas_padding_color_changed),
|
|
|
|
gtk_bin_get_child (GTK_BIN (combo)));
|
2003-10-22 22:46:05 +08:00
|
|
|
}
|
|
|
|
|
1999-12-18 19:37:11 +08:00
|
|
|
static void
|
2003-08-24 03:35:05 +08:00
|
|
|
prefs_help_func (const gchar *help_id,
|
|
|
|
gpointer help_data)
|
1999-12-18 19:37:11 +08:00
|
|
|
{
|
2003-08-24 03:35:05 +08:00
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *event_box;
|
|
|
|
gint page_num;
|
1999-12-18 19:37:11 +08:00
|
|
|
|
2003-08-24 03:35:05 +08:00
|
|
|
notebook = g_object_get_data (G_OBJECT (help_data), "notebook");
|
|
|
|
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
|
|
|
|
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
|
1999-12-18 19:37:11 +08:00
|
|
|
|
2003-08-24 03:35:05 +08:00
|
|
|
help_id = g_object_get_data (G_OBJECT (event_box), "gimp-help-id");
|
|
|
|
gimp_standard_help_func (help_id, NULL);
|
1999-12-18 19:37:11 +08:00
|
|
|
}
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
static GtkWidget *
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_dialog_new (Gimp *gimp,
|
|
|
|
GimpConfig *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;
|
2004-06-10 06:37:49 +08:00
|
|
|
GtkTreePath *path;
|
2002-03-19 05:25:17 +08:00
|
|
|
GtkTreeIter top_iter;
|
|
|
|
GtkTreeIter child_iter;
|
|
|
|
gint page_index;
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
GtkSizeGroup *size_group = NULL;
|
2002-03-19 05:25:17 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *button;
|
2004-07-22 00:11:31 +08:00
|
|
|
GtkWidget *button2;
|
2002-03-19 05:25:17 +08:00
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *image;
|
2005-04-17 03:27:28 +08:00
|
|
|
GtkWidget *entry;
|
2002-03-19 05:25:17 +08:00
|
|
|
GtkWidget *calibrate_button;
|
|
|
|
GSList *group;
|
2003-10-10 22:11:47 +08:00
|
|
|
GtkWidget *editor;
|
2002-11-21 03:45:03 +08:00
|
|
|
gint i;
|
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
GObject *object;
|
2002-11-21 03:45:03 +08:00
|
|
|
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);
|
2003-10-11 22:30:18 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONFIG (config), NULL);
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
object = G_OBJECT (config);
|
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",
|
2003-11-06 23:27:05 +08:00
|
|
|
NULL, 0,
|
2002-11-21 03:45:03 +08:00
|
|
|
prefs_help_func,
|
2003-08-22 09:42:57 +08:00
|
|
|
GIMP_HELP_PREFS_DIALOG,
|
2000-01-26 07:05:47 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
|
|
|
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
2002-11-21 03:45:03 +08:00
|
|
|
|
|
|
|
NULL);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
g_signal_connect (dialog, "response",
|
|
|
|
G_CALLBACK (prefs_response),
|
|
|
|
dialog);
|
|
|
|
|
2005-02-09 04:40:33 +08:00
|
|
|
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
|
|
|
GTK_RESPONSE_OK,
|
|
|
|
GTK_RESPONSE_CANCEL,
|
|
|
|
-1);
|
|
|
|
|
1999-03-28 02:16:30 +08:00
|
|
|
/* The main hbox */
|
2004-05-21 22:17:27 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 12);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
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));
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (tree);
|
2001-09-27 13:50:59 +08:00
|
|
|
|
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);
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 0);
|
2002-03-01 02:34:41 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
2004-09-22 06:31:20 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
|
2002-03-01 02:34:41 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
2002-03-01 02:34:41 +08:00
|
|
|
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);
|
2004-06-21 21:18:50 +08:00
|
|
|
gimp_label_set_attributes (GTK_LABEL (label),
|
|
|
|
PANGO_ATTR_SCALE, PANGO_SCALE_LARGE,
|
|
|
|
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
|
|
|
|
-1);
|
2004-05-21 22:17:27 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6);
|
2002-03-01 02:34:41 +08:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
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-11-23 06:10:40 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 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));
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (sel, "changed",
|
2005-08-01 04:07:14 +08:00
|
|
|
G_CALLBACK (prefs_tree_select_callback),
|
|
|
|
notebook);
|
|
|
|
g_signal_connect (notebook, "switch-page",
|
|
|
|
G_CALLBACK (prefs_notebook_page_callback),
|
|
|
|
sel);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
|
|
|
page_index = 0;
|
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
/*****************/
|
|
|
|
/* Environment */
|
|
|
|
/*****************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Environment"),
|
2005-02-11 21:32:10 +08:00
|
|
|
"environment.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2005-02-11 21:32:10 +08:00
|
|
|
NULL,
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_ENVIRONMENT,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
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
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Resource Consumption"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
2000-02-04 12:31:18 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
#ifdef ENABLE_MP
|
|
|
|
table = prefs_table_new (5, GTK_CONTAINER (vbox2));
|
|
|
|
#else
|
|
|
|
table = prefs_table_new (4, GTK_CONTAINER (vbox2));
|
|
|
|
#endif /* ENABLE_MP */
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
prefs_spin_button_add (object, "undo-levels", 1.0, 5.0, 0,
|
|
|
|
_("Minimal number of _undo levels:"),
|
|
|
|
GTK_TABLE (table), 0, size_group);
|
|
|
|
prefs_memsize_entry_add (object, "undo-size",
|
|
|
|
_("Maximum undo _memory:"),
|
|
|
|
GTK_TABLE (table), 1, size_group);
|
|
|
|
prefs_memsize_entry_add (object, "tile-cache-size",
|
|
|
|
_("Tile cache _size:"),
|
|
|
|
GTK_TABLE (table), 2, size_group);
|
|
|
|
prefs_memsize_entry_add (object, "max-new-image-size",
|
|
|
|
_("Maximum _new image size:"),
|
|
|
|
GTK_TABLE (table), 3, size_group);
|
2002-11-21 23:46:19 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
#ifdef ENABLE_MP
|
|
|
|
prefs_spin_button_add (object, "num-processors", 1.0, 4.0, 0,
|
|
|
|
_("Number of _processors to use:"),
|
|
|
|
GTK_TABLE (table), 4, size_group);
|
|
|
|
#endif /* ENABLE_MP */
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
/* Image Thumbnails */
|
|
|
|
vbox2 = prefs_frame_new (_("Image Thumbnails"), GTK_CONTAINER (vbox), FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
prefs_enum_combo_box_add (object, "thumbnail-size", 0, 0,
|
|
|
|
_("Size of _thumbnails:"),
|
|
|
|
GTK_TABLE (table), 0, size_group);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
prefs_memsize_entry_add (object, "thumbnail-filesize-limit",
|
|
|
|
_("Maximum _filesize for thumbnailing:"),
|
|
|
|
GTK_TABLE (table), 1, size_group);
|
2003-10-10 22:11:47 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
/* File Saving */
|
|
|
|
vbox2 = prefs_frame_new (_("Saving Images"), GTK_CONTAINER (vbox), FALSE);
|
2003-10-10 22:11:47 +08:00
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
prefs_check_button_add (object, "confirm-on-close",
|
|
|
|
_("Confirm closing of unsa_ved images"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
|
|
|
g_object_unref (size_group);
|
|
|
|
size_group = NULL;
|
2003-10-10 22:11:47 +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),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("User Interface"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"interface.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Interface"),
|
|
|
|
GIMP_HELP_PREFS_INTERFACE,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2003-07-18 06:30:13 +08:00
|
|
|
/* Previews */
|
2003-04-08 18:02:42 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Previews"), GTK_CONTAINER (vbox), FALSE);
|
2003-03-07 00:47:34 +08:00
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_check_button_add (object, "layer-previews",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("_Enable layer & channel previews"),
|
2003-03-07 00:47:34 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (3, GTK_CONTAINER (vbox2));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "layer-preview-size", 0, 0,
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Default _layer & channel preview size:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "navigation-preview-size", 0, 0,
|
2004-07-29 09:19:12 +08:00
|
|
|
_("Na_vigation preview size:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 1, size_group);
|
|
|
|
|
|
|
|
/* Keyboard Shortcuts */
|
|
|
|
vbox2 = prefs_frame_new (_("Keyboard Shortcuts"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
2004-07-29 00:24:51 +08:00
|
|
|
prefs_check_button_add (object, "menu-mnemonics",
|
|
|
|
_("Show menu _mnemonics (access keys)"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add (object, "can-change-accels",
|
2004-07-29 09:19:12 +08:00
|
|
|
_("Use _dynamic keyboard shortcuts"),
|
2004-07-29 00:24:51 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
2004-07-21 02:50:20 +08:00
|
|
|
button = prefs_button_add (GTK_STOCK_PREFERENCES,
|
2004-07-29 09:19:12 +08:00
|
|
|
_("Configure _Keyboard Shortcuts..."),
|
2004-07-21 02:50:20 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (prefs_keyboard_shortcuts_dialog),
|
|
|
|
gimp);
|
|
|
|
|
2004-06-17 22:07:05 +08:00
|
|
|
prefs_check_button_add (object, "save-accels",
|
2004-07-29 09:19:12 +08:00
|
|
|
_("_Save keyboard shortcuts on exit"),
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2004-06-17 22:07:05 +08:00
|
|
|
button = prefs_button_add (GTK_STOCK_SAVE,
|
2004-07-29 09:19:12 +08:00
|
|
|
_("Save Keyboard Shortcuts _Now"),
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
2004-07-22 00:11:31 +08:00
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (prefs_menus_save_callback),
|
|
|
|
gimp);
|
1999-11-20 22:27:07 +08:00
|
|
|
|
2004-07-29 09:19:12 +08:00
|
|
|
button2 = prefs_button_add (GIMP_STOCK_RESET,
|
|
|
|
_("_Reset Saved Keyboard Shortcuts to "
|
|
|
|
"Default Values"),
|
2004-07-22 00:11:31 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
g_signal_connect (button2, "clicked",
|
|
|
|
G_CALLBACK (prefs_menus_clear_callback),
|
|
|
|
gimp);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (button), "clear-button", button2);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2003-04-08 18:02:42 +08:00
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/***********/
|
|
|
|
/* Theme */
|
|
|
|
/***********/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2004-06-17 22:07:05 +08:00
|
|
|
_("Theme"),
|
2004-06-10 06:37:49 +08:00
|
|
|
"theme.png",
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
2005-02-11 21:32:10 +08:00
|
|
|
NULL,
|
2004-06-17 22:07:05 +08:00
|
|
|
GIMP_HELP_PREFS_THEME,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-06-10 06:48:33 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Select Theme"), GTK_CONTAINER (vbox), TRUE);
|
2003-11-12 07:56:00 +08:00
|
|
|
|
|
|
|
{
|
2003-11-12 20:56:31 +08:00
|
|
|
GtkWidget *scrolled_win;
|
|
|
|
GtkListStore *list_store;
|
|
|
|
GtkWidget *view;
|
|
|
|
GtkTreeSelection *sel;
|
|
|
|
gchar **themes;
|
|
|
|
gint n_themes;
|
|
|
|
gint i;
|
2003-11-12 07:56:00 +08:00
|
|
|
|
|
|
|
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_widget_set_size_request (scrolled_win, -1, 80);
|
|
|
|
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
|
|
|
|
GTK_SHADOW_IN);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
|
|
|
|
GTK_POLICY_NEVER,
|
|
|
|
GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), scrolled_win, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (scrolled_win);
|
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
|
2003-11-12 07:56:00 +08:00
|
|
|
|
|
|
|
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_win), view);
|
|
|
|
gtk_widget_show (view);
|
|
|
|
|
|
|
|
g_object_unref (list_store);
|
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), 0,
|
|
|
|
_("Theme"),
|
|
|
|
gtk_cell_renderer_text_new (),
|
|
|
|
"text", 0,
|
|
|
|
NULL);
|
|
|
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), 1,
|
|
|
|
_("Folder"),
|
|
|
|
gtk_cell_renderer_text_new (),
|
|
|
|
"text", 1,
|
|
|
|
NULL);
|
2003-11-12 07:56:00 +08:00
|
|
|
|
|
|
|
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
|
|
|
|
|
|
|
|
themes = themes_list_themes (gimp, &n_themes);
|
|
|
|
|
|
|
|
for (i = 0; i < n_themes; i++)
|
|
|
|
{
|
2003-11-12 20:56:31 +08:00
|
|
|
GtkTreeIter iter;
|
|
|
|
|
2003-11-12 07:56:00 +08:00
|
|
|
gtk_list_store_append (list_store, &iter);
|
|
|
|
gtk_list_store_set (list_store, &iter,
|
|
|
|
0, themes[i],
|
2003-11-12 20:56:31 +08:00
|
|
|
1, themes_get_theme_dir (gimp, themes[i]),
|
2003-11-12 07:56:00 +08:00
|
|
|
-1);
|
|
|
|
|
|
|
|
if (GIMP_GUI_CONFIG (object)->theme &&
|
|
|
|
! strcmp (GIMP_GUI_CONFIG (object)->theme, themes[i]))
|
|
|
|
{
|
2004-06-25 18:24:35 +08:00
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
|
|
path = gtk_tree_model_get_path (GTK_TREE_MODEL (list_store), &iter);
|
|
|
|
|
|
|
|
gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
|
|
|
|
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), path,
|
|
|
|
NULL, FALSE, 0.0, 0.0);
|
|
|
|
|
|
|
|
gtk_tree_path_free (path);
|
2003-11-12 07:56:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (themes)
|
|
|
|
g_strfreev (themes);
|
|
|
|
|
|
|
|
g_signal_connect (sel, "changed",
|
|
|
|
G_CALLBACK (prefs_theme_select_callback),
|
|
|
|
gimp);
|
|
|
|
}
|
|
|
|
|
2004-06-03 01:56:02 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 6);
|
2003-11-12 20:56:31 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2004-06-17 22:07:05 +08:00
|
|
|
button = prefs_button_add (GTK_STOCK_REFRESH,
|
|
|
|
_("Reload C_urrent Theme"),
|
|
|
|
GTK_BOX (hbox));
|
2003-11-12 20:56:31 +08:00
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (prefs_theme_reload_callback),
|
|
|
|
gimp);
|
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/*****************/
|
|
|
|
/* Help System */
|
|
|
|
/*****************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2003-10-15 07:41:58 +08:00
|
|
|
_("Help System"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"help-system.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_HELP,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
|
|
|
|
2002-11-24 08:03:42 +08:00
|
|
|
/* General */
|
2002-11-23 06:10:40 +08:00
|
|
|
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox), FALSE);
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_check_button_add (object, "show-tool-tips",
|
2004-06-25 06:35:00 +08:00
|
|
|
_("Show tool _tips"),
|
2002-11-21 03:45:03 +08:00
|
|
|
GTK_BOX (vbox2));
|
2004-10-05 00:21:52 +08:00
|
|
|
prefs_check_button_add (object, "show-help-button",
|
|
|
|
_("Show help _buttons"),
|
|
|
|
GTK_BOX (vbox2));
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_check_button_add (object, "show-tips",
|
2004-06-25 06:35:00 +08:00
|
|
|
_("Show tips on _startup"),
|
2002-11-23 02:06:36 +08:00
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2002-11-24 08:03:42 +08:00
|
|
|
/* Help Browser */
|
2002-11-23 06:10:40 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox), FALSE);
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
|
1999-12-20 01:15:11 +08:00
|
|
|
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "help-browser", 0, 0,
|
2004-10-13 06:57:15 +08:00
|
|
|
_("H_elp browser to use:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
1999-12-20 01:15:11 +08:00
|
|
|
|
2004-03-15 21:25:21 +08:00
|
|
|
/* Web Browser (unused on win32) */
|
|
|
|
#ifndef G_OS_WIN32
|
2003-10-26 22:01:33 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Web Browser"), GTK_CONTAINER (vbox), FALSE);
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
|
2003-10-26 22:01:33 +08:00
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
entry = gimp_prop_file_entry_new (object, "web-browser",
|
|
|
|
_("Select web browser"),
|
|
|
|
FALSE, FALSE);
|
2003-10-26 22:01:33 +08:00
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
prefs_widget_add_aligned (entry, _("_Web browser to use:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, FALSE, size_group);
|
2004-03-15 21:25:21 +08:00
|
|
|
#endif
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
g_object_unref (size_group);
|
|
|
|
size_group = NULL;
|
|
|
|
|
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/******************/
|
|
|
|
/* Tool Options */
|
|
|
|
/******************/
|
2002-03-01 00:55:38 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2003-10-15 07:41:58 +08:00
|
|
|
_("Tool Options"),
|
2002-03-01 00:55:38 +08:00
|
|
|
"tool-options.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_TOOL_OPTIONS,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
|
|
|
|
2005-04-12 05:17:59 +08:00
|
|
|
/* General */
|
|
|
|
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
|
|
|
prefs_check_button_add (object, "save-tool-options",
|
|
|
|
_("_Save tool options on exit"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
|
|
|
button = prefs_button_add (GTK_STOCK_SAVE,
|
|
|
|
_("Save Tool Options _Now"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (prefs_tool_options_save_callback),
|
|
|
|
gimp);
|
|
|
|
|
|
|
|
button2 = prefs_button_add (GIMP_STOCK_RESET,
|
|
|
|
_("_Reset Saved Tool Options to "
|
|
|
|
"Default Values"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
g_signal_connect (button2, "clicked",
|
|
|
|
G_CALLBACK (prefs_tool_options_clear_callback),
|
|
|
|
gimp);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (button), "clear-button", button2);
|
|
|
|
|
|
|
|
|
2004-02-19 04:31:11 +08:00
|
|
|
/* Snapping Distance */
|
|
|
|
vbox2 = prefs_frame_new (_("Guide and Grid Snapping"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
|
2004-02-19 04:31:11 +08:00
|
|
|
|
|
|
|
prefs_spin_button_add (object, "snap-distance", 1.0, 5.0, 0,
|
2004-06-24 06:44:04 +08:00
|
|
|
_("_Snap distance:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2004-02-19 04:31:11 +08:00
|
|
|
|
2002-11-24 08:03:42 +08:00
|
|
|
/* Scaling */
|
|
|
|
vbox2 = prefs_frame_new (_("Scaling"), GTK_CONTAINER (vbox), FALSE);
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "interpolation-type", 0, 0,
|
2004-06-25 06:35:00 +08:00
|
|
|
_("Default _interpolation:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-03-04 22:04:22 +08:00
|
|
|
/* Global Brush, Pattern, ... */
|
|
|
|
vbox2 = prefs_frame_new (_("Paint Options Shared Between Tools"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
2004-03-05 00:10:57 +08:00
|
|
|
prefs_check_button_add_with_icon (object, "global-brush",
|
|
|
|
_("_Brush"), GIMP_STOCK_BRUSH,
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add_with_icon (object, "global-pattern",
|
|
|
|
_("_Pattern"), GIMP_STOCK_PATTERN,
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add_with_icon (object, "global-gradient",
|
|
|
|
_("_Gradient"), GIMP_STOCK_GRADIENT,
|
|
|
|
GTK_BOX (vbox2));
|
2004-03-04 22:04:22 +08:00
|
|
|
|
2004-10-30 23:02:39 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Move Tool"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
|
|
|
prefs_check_button_add_with_icon (object, "move-tool-changes-active",
|
|
|
|
_("Change current layer or path"),
|
|
|
|
GIMP_STOCK_TOOL_MOVE,
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
g_object_unref (size_group);
|
|
|
|
size_group = NULL;
|
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/*************/
|
|
|
|
/* Toolbox */
|
|
|
|
/*************/
|
2004-06-01 04:30:52 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
|
|
|
_("Toolbox"),
|
|
|
|
"toolbox.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_TOOLBOX,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2004-06-01 04:30:52 +08:00
|
|
|
|
|
|
|
/* Appearance */
|
|
|
|
vbox2 = prefs_frame_new (_("Appearance"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
|
|
|
prefs_check_button_add_with_icon (object, "toolbox-color-area",
|
2004-10-13 06:57:15 +08:00
|
|
|
_("Show _foreground & background color"),
|
2004-06-01 04:30:52 +08:00
|
|
|
GIMP_STOCK_DEFAULT_COLORS,
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add_with_icon (object, "toolbox-foo-area",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show active _brush, pattern & gradient"),
|
2004-06-01 04:30:52 +08:00
|
|
|
GIMP_STOCK_BRUSH,
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
prefs_check_button_add_with_icon (object, "toolbox-image-area",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show active _image"),
|
2004-06-01 04:30:52 +08:00
|
|
|
GIMP_STOCK_IMAGE,
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
|
|
|
|
2005-02-11 21:32:10 +08:00
|
|
|
/***********************/
|
|
|
|
/* Default New Image */
|
|
|
|
/***********************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Default New Image"),
|
2005-02-11 21:32:10 +08:00
|
|
|
"new-image.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Default Image"),
|
|
|
|
GIMP_HELP_PREFS_NEW_IMAGE,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2005-02-11 21:32:10 +08:00
|
|
|
|
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox));
|
|
|
|
|
|
|
|
{
|
|
|
|
GtkWidget *combo;
|
|
|
|
|
|
|
|
combo = gimp_container_combo_box_new (gimp->templates, NULL, 16, 0);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("_Template:"), 0.0, 0.5,
|
|
|
|
combo, 1, FALSE);
|
|
|
|
|
|
|
|
gimp_container_view_select_item (GIMP_CONTAINER_VIEW (combo), NULL);
|
|
|
|
|
2005-05-28 08:21:58 +08:00
|
|
|
g_signal_connect (combo, "select-item",
|
2005-02-11 21:32:10 +08:00
|
|
|
G_CALLBACK (prefs_template_select_callback),
|
|
|
|
core_config->default_image);
|
|
|
|
}
|
|
|
|
|
|
|
|
editor = gimp_template_editor_new (core_config->default_image, gimp, FALSE);
|
|
|
|
gimp_template_editor_show_advanced (GIMP_TEMPLATE_EDITOR (editor), TRUE);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), editor, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (editor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************/
|
|
|
|
/* Default Grid */
|
|
|
|
/******************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Default Image Grid"),
|
2005-02-11 21:32:10 +08:00
|
|
|
"default-grid.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Default Grid"),
|
|
|
|
GIMP_HELP_PREFS_DEFAULT_GRID,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2005-02-11 21:32:10 +08:00
|
|
|
|
|
|
|
/* Grid */
|
|
|
|
editor = gimp_grid_editor_new (core_config->default_grid,
|
|
|
|
core_config->default_image->xresolution,
|
|
|
|
core_config->default_image->yresolution);
|
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (vbox), editor);
|
|
|
|
gtk_widget_show (editor);
|
|
|
|
|
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/*******************/
|
|
|
|
/* Image Windows */
|
|
|
|
/*******************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Image Windows"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"image-windows.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_IMAGE_WINDOW,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
|
|
|
|
2003-07-18 06:30:13 +08:00
|
|
|
/* General */
|
|
|
|
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox), FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_check_button_add (object, "default-dot-for-dot",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Use \"_Dot for dot\" by default"),
|
2002-11-21 03:45:03 +08:00
|
|
|
GTK_BOX (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_spin_button_add (object, "marching-ants-speed", 10.0, 100.0, 0,
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Marching _ants speed:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2003-03-04 23:12:27 +08:00
|
|
|
/* Zoom & Resize Behavior */
|
|
|
|
vbox2 = prefs_frame_new (_("Zoom & Resize Behavior"),
|
2002-12-14 22:13:54 +08:00
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_check_button_add (object, "resize-windows-on-zoom",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Resize window on _zoom"),
|
2002-12-14 22:13:54 +08:00
|
|
|
GTK_BOX (vbox2));
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_check_button_add (object, "resize-windows-on-resize",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Resize window on image _size change"),
|
2002-12-14 22:13:54 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (1, GTK_CONTAINER (vbox2));
|
2003-07-18 06:30:13 +08:00
|
|
|
|
2004-04-19 07:48:30 +08:00
|
|
|
prefs_boolean_combo_box_add (object, "initial-zoom-to-fit",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Fit to window"),
|
2004-04-19 07:48:30 +08:00
|
|
|
"1:1",
|
2004-10-13 06:57:15 +08:00
|
|
|
_("Initial zoom _ratio:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2003-07-18 06:30:13 +08:00
|
|
|
|
2004-06-25 06:35:00 +08:00
|
|
|
/* Mouse Cursors */
|
|
|
|
vbox2 = prefs_frame_new (_("Mouse Cursors"),
|
2002-11-23 06:10:40 +08:00
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
prefs_check_button_add (object, "show-brush-outline",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show _brush outline"),
|
2003-08-20 01:20:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
2004-06-13 10:08:54 +08:00
|
|
|
prefs_check_button_add (object, "show-paint-tool-cursor",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Show paint _tool cursor"),
|
2004-06-10 19:24:36 +08:00
|
|
|
GTK_BOX (vbox2));
|
2004-06-13 10:08:54 +08:00
|
|
|
|
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox2));
|
2002-11-23 06:10:40 +08:00
|
|
|
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "cursor-mode", 0, 0,
|
2004-10-13 06:57:15 +08:00
|
|
|
_("Cursor _mode:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2004-06-13 10:08:54 +08:00
|
|
|
prefs_enum_combo_box_add (object, "cursor-format", 0, 0,
|
2004-06-25 06:35:00 +08:00
|
|
|
_("Cursor re_ndering:"),
|
2004-06-13 10:08:54 +08:00
|
|
|
GTK_TABLE (table), 1, size_group);
|
2004-05-21 22:17:27 +08:00
|
|
|
|
|
|
|
g_object_unref (size_group);
|
|
|
|
size_group = NULL;
|
2002-11-23 06:10:40 +08:00
|
|
|
|
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/********************************/
|
|
|
|
/* Image Windows / Appearance */
|
|
|
|
/********************************/
|
2003-07-18 06:30:13 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Image Window Appearance"),
|
2003-07-18 06:30:13 +08:00
|
|
|
"image-windows.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Appearance"),
|
|
|
|
GIMP_HELP_PREFS_IMAGE_WINDOW_APPEARANCE,
|
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
|
|
|
page_index++);
|
2003-07-18 06:30:13 +08:00
|
|
|
|
2003-10-22 22:46:05 +08:00
|
|
|
prefs_display_options_frame_add (gimp,
|
|
|
|
G_OBJECT (display_config->default_view),
|
|
|
|
_("Default Appearance in Normal Mode"),
|
|
|
|
GTK_CONTAINER (vbox));
|
2003-07-18 06:30:13 +08:00
|
|
|
|
2003-10-22 22:46:05 +08:00
|
|
|
prefs_display_options_frame_add (gimp,
|
|
|
|
G_OBJECT (display_config->default_fullscreen_view),
|
|
|
|
_("Default Appearance in Fullscreen Mode"),
|
|
|
|
GTK_CONTAINER (vbox));
|
2003-07-18 06:30:13 +08:00
|
|
|
|
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/****************************************************/
|
|
|
|
/* Image Windows / Image Title & Statusbar Format */
|
|
|
|
/****************************************************/
|
2002-11-23 06:10:40 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Image Title & Statusbar Format"),
|
2002-11-24 08:03:42 +08:00
|
|
|
"image-title.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Title & Status"),
|
|
|
|
GIMP_HELP_PREFS_IMAGE_WINDOW_TITLE,
|
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
|
|
|
page_index++);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
const gchar *format_strings[] =
|
|
|
|
{
|
|
|
|
NULL,
|
2005-01-16 20:05:52 +08:00
|
|
|
NULL,
|
2001-12-08 01:39:51 +08:00
|
|
|
"%f-%p.%i (%t) %z%%",
|
|
|
|
"%f-%p.%i (%t) %d:%s",
|
2005-01-16 20:05:52 +08:00
|
|
|
"%f-%p.%i (%t) %wx%h"
|
2001-12-08 01:39:51 +08:00
|
|
|
};
|
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
const gchar *format_names[] =
|
2001-12-08 01:39:51 +08:00
|
|
|
{
|
2005-01-16 20:05:52 +08:00
|
|
|
N_("Current format"),
|
|
|
|
N_("Default format"),
|
2001-12-08 01:39:51 +08:00
|
|
|
N_("Show zoom percentage"),
|
|
|
|
N_("Show zoom ratio"),
|
2005-01-16 20:05:52 +08:00
|
|
|
N_("Show image size")
|
2001-12-08 01:39:51 +08:00
|
|
|
};
|
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
struct
|
2002-11-23 06:10:40 +08:00
|
|
|
{
|
2002-11-24 06:22:21 +08:00
|
|
|
gchar *current_setting;
|
2005-01-16 20:05:52 +08:00
|
|
|
const gchar *default_setting;
|
2002-11-24 06:22:21 +08:00
|
|
|
const gchar *title;
|
|
|
|
const gchar *property_name;
|
|
|
|
}
|
|
|
|
formats[] =
|
2002-11-23 06:10:40 +08:00
|
|
|
{
|
2005-01-16 20:05:52 +08:00
|
|
|
{ NULL, GIMP_CONFIG_DEFAULT_IMAGE_TITLE_FORMAT,
|
|
|
|
N_("Image Title Format"), "image-title-format" },
|
|
|
|
{ NULL, GIMP_CONFIG_DEFAULT_IMAGE_STATUS_FORMAT,
|
|
|
|
N_("Image Statusbar Format"), "image-status-format" }
|
2002-11-23 06:10:40 +08:00
|
|
|
};
|
2002-02-12 06:39:08 +08:00
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
gint format;
|
2002-02-12 06:39:08 +08:00
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
g_assert (G_N_ELEMENTS (format_strings) == G_N_ELEMENTS (format_names));
|
2002-02-12 06:39:08 +08:00
|
|
|
|
2003-08-20 17:59:12 +08:00
|
|
|
formats[0].current_setting = display_config->image_title_format;
|
|
|
|
formats[1].current_setting = display_config->image_status_format;
|
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
for (format = 0; format < G_N_ELEMENTS (formats); format++)
|
2002-02-12 06:39:08 +08:00
|
|
|
{
|
2003-11-12 20:56:31 +08:00
|
|
|
GtkWidget *scrolled_win;
|
|
|
|
GtkListStore *list_store;
|
|
|
|
GtkWidget *view;
|
|
|
|
GtkTreeSelection *sel;
|
|
|
|
gint i;
|
2002-11-23 06:10:40 +08:00
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
format_strings[0] = formats[format].current_setting;
|
2005-01-16 20:05:52 +08:00
|
|
|
format_strings[1] = formats[format].default_setting;
|
2002-11-23 06:10:40 +08:00
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
vbox2 = prefs_frame_new (gettext (formats[format].title),
|
|
|
|
GTK_CONTAINER (vbox), TRUE);
|
2002-11-23 06:10:40 +08:00
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
entry = gimp_prop_entry_new (object, formats[format].property_name, 0);
|
2002-11-23 06:10:40 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), entry, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (entry);
|
|
|
|
|
|
|
|
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
|
|
|
|
GTK_SHADOW_IN);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
|
|
|
|
GTK_POLICY_NEVER,
|
|
|
|
GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), scrolled_win, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (scrolled_win);
|
|
|
|
|
|
|
|
list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
|
|
|
|
|
|
|
|
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
|
|
|
|
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE);
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_win), view);
|
|
|
|
gtk_widget_show (view);
|
|
|
|
|
|
|
|
g_object_unref (list_store);
|
|
|
|
|
2003-11-12 20:56:31 +08:00
|
|
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), 0,
|
|
|
|
NULL,
|
|
|
|
gtk_cell_renderer_text_new (),
|
|
|
|
"text", 0,
|
|
|
|
NULL);
|
|
|
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), 1,
|
|
|
|
NULL,
|
|
|
|
gtk_cell_renderer_text_new (),
|
|
|
|
"text", 1,
|
|
|
|
NULL);
|
2002-11-23 06:10:40 +08:00
|
|
|
|
|
|
|
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (format_strings); i++)
|
|
|
|
{
|
2003-11-12 20:56:31 +08:00
|
|
|
GtkTreeIter iter;
|
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
gtk_list_store_append (list_store, &iter);
|
|
|
|
gtk_list_store_set (list_store, &iter,
|
2004-05-24 05:02:27 +08:00
|
|
|
0, gettext (format_names[i]),
|
2002-11-23 06:10:40 +08:00
|
|
|
1, format_strings[i],
|
|
|
|
-1);
|
|
|
|
|
|
|
|
if (i == 0)
|
|
|
|
gtk_tree_selection_select_iter (sel, &iter);
|
|
|
|
}
|
2003-11-12 20:56:31 +08:00
|
|
|
|
|
|
|
g_signal_connect (sel, "changed",
|
|
|
|
G_CALLBACK (prefs_format_string_select_callback),
|
|
|
|
entry);
|
2002-02-12 06:39:08 +08:00
|
|
|
}
|
2001-12-08 01:39:51 +08:00
|
|
|
}
|
2000-06-06 08:28:28 +08:00
|
|
|
|
2000-01-16 02:13:13 +08:00
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
/*************/
|
|
|
|
/* Display */
|
|
|
|
/*************/
|
2002-02-28 21:47:03 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Display"),
|
2002-03-01 00:55:38 +08:00
|
|
|
"display.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_DISPLAY,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
1999-04-22 22:34:00 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
|
|
|
|
2002-11-24 08:03:42 +08:00
|
|
|
/* Transparency */
|
|
|
|
vbox2 = prefs_frame_new (_("Transparency"), GTK_CONTAINER (vbox), FALSE);
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox2));
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "transparency-type", 0, 0,
|
2005-04-27 19:49:51 +08:00
|
|
|
_("_Check Style:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "transparency-size", 0, 0,
|
2005-04-27 19:49:51 +08:00
|
|
|
_("Check _Size:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 1, size_group);
|
1999-09-24 04:21:15 +08:00
|
|
|
|
2002-11-23 06:10:40 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Get Monitor Resolution"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
|
2003-10-14 23:20:59 +08:00
|
|
|
{
|
|
|
|
gchar *pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL);
|
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
entry = gimp_prop_coordinates_new (object,
|
|
|
|
"monitor-xresolution",
|
|
|
|
"monitor-yresolution",
|
|
|
|
NULL,
|
|
|
|
pixels_per_unit,
|
|
|
|
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION,
|
|
|
|
0.0, 0.0,
|
|
|
|
TRUE);
|
2003-10-14 23:20:59 +08:00
|
|
|
|
|
|
|
g_free (pixels_per_unit);
|
|
|
|
}
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (entry), 2);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (entry), 2);
|
2002-11-21 23:46:19 +08:00
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Horizontal"), 0, 1, 0.0);
|
2005-04-17 03:27:28 +08:00
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Vertical"), 0, 2, 0.0);
|
2005-04-17 03:27:28 +08:00
|
|
|
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (entry),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("dpi"), 1, 4, 0.0);
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2004-06-10 07:51:06 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 24);
|
|
|
|
gtk_widget_show (entry);
|
|
|
|
gtk_widget_set_sensitive (entry, ! display_config->monitor_res_from_gdk);
|
2002-11-21 23:46:19 +08:00
|
|
|
|
2004-06-10 07:51:06 +08:00
|
|
|
group = NULL;
|
2003-07-18 06:30:13 +08:00
|
|
|
|
2004-06-10 07:51:06 +08:00
|
|
|
{
|
|
|
|
gdouble xres, yres;
|
|
|
|
gchar *str;
|
2000-09-25 09:27:47 +08:00
|
|
|
|
2004-06-10 07:51:06 +08:00
|
|
|
gimp_get_screen_resolution (NULL, &xres, &yres);
|
2001-07-25 08:42:47 +08:00
|
|
|
|
2004-06-24 06:44:04 +08:00
|
|
|
str = g_strdup_printf (_("From _windowing system (currently %d x %d dpi)"),
|
2005-08-01 04:07:14 +08:00
|
|
|
ROUND (xres), ROUND (yres));
|
2004-06-10 07:51:06 +08:00
|
|
|
|
|
|
|
button = gtk_radio_button_new_with_mnemonic (group, str);
|
|
|
|
|
|
|
|
g_free (str);
|
|
|
|
}
|
2002-11-21 03:45:03 +08:00
|
|
|
|
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);
|
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
g_object_set_data (G_OBJECT (button), "monitor_resolution_sizeentry", entry);
|
|
|
|
g_object_set_data (G_OBJECT (button), "set_sensitive", label);
|
|
|
|
g_object_set_data (G_OBJECT (button), "inverse_sensitive", entry);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (button, "toggled",
|
2005-08-01 04:07:14 +08:00
|
|
|
G_CALLBACK (prefs_resolution_source_callback),
|
|
|
|
config);
|
2002-11-21 03:45:03 +08:00
|
|
|
|
2002-11-21 23:46:19 +08:00
|
|
|
button = gtk_radio_button_new_with_mnemonic (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
|
|
|
|
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
|
|
|
|
2004-06-10 07:51:06 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
calibrate_button = gtk_button_new_with_mnemonic (_("C_alibrate..."));
|
|
|
|
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);
|
|
|
|
gtk_widget_set_sensitive (calibrate_button,
|
|
|
|
! display_config->monitor_res_from_gdk);
|
|
|
|
|
2005-04-17 03:27:28 +08:00
|
|
|
g_object_set_data (G_OBJECT (entry), "inverse_sensitive", calibrate_button);
|
2004-06-10 07:51:06 +08:00
|
|
|
|
|
|
|
g_signal_connect (calibrate_button, "clicked",
|
2005-08-01 04:07:14 +08:00
|
|
|
G_CALLBACK (prefs_resolution_calibrate_callback),
|
|
|
|
entry);
|
2004-06-10 07:51:06 +08:00
|
|
|
|
2005-08-10 08:24:59 +08:00
|
|
|
g_object_unref (size_group);
|
|
|
|
size_group = NULL;
|
|
|
|
|
2002-03-01 00:55:38 +08:00
|
|
|
|
2005-02-08 08:04:50 +08:00
|
|
|
/**********************/
|
|
|
|
/* Color Management */
|
|
|
|
/**********************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Color Management"),
|
2005-02-08 08:04:50 +08:00
|
|
|
"color-management.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_COLOR_MANAGEMENT,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2005-02-08 08:04:50 +08:00
|
|
|
|
2005-06-24 17:41:16 +08:00
|
|
|
table = prefs_table_new (8, GTK_CONTAINER (vbox));
|
2005-02-08 08:04:50 +08:00
|
|
|
|
|
|
|
{
|
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
const gchar *label;
|
|
|
|
const gchar *fs_label;
|
|
|
|
const gchar *property_name;
|
|
|
|
}
|
|
|
|
profiles[] =
|
|
|
|
{
|
2005-06-16 03:55:26 +08:00
|
|
|
{ N_("_RGB profile:"),
|
2005-02-08 08:04:50 +08:00
|
|
|
N_("Select RGB color profile"), "rgb-profile" },
|
2005-06-16 03:55:26 +08:00
|
|
|
{ N_("_CMYK profile:"),
|
2005-02-08 08:04:50 +08:00
|
|
|
N_("Select CMYK color profile"), "cmyk-profile" },
|
2005-06-16 03:55:26 +08:00
|
|
|
{ N_("_Monitor profile:"),
|
2005-02-08 08:04:50 +08:00
|
|
|
N_("Select monitor color profile"), "display-profile" },
|
2005-06-25 07:06:07 +08:00
|
|
|
{ N_("_Print simulation profile:"),
|
2005-02-08 08:04:50 +08:00
|
|
|
N_("Select printer color profile"), "printer-profile" }
|
|
|
|
};
|
|
|
|
|
|
|
|
GObject *color_config;
|
2005-06-24 17:41:16 +08:00
|
|
|
gint row;
|
2005-02-08 08:04:50 +08:00
|
|
|
|
|
|
|
g_object_get (object, "color-management", &color_config, NULL);
|
|
|
|
|
|
|
|
prefs_enum_combo_box_add (color_config, "mode", 0, 0,
|
|
|
|
_("_Mode of operation:"),
|
|
|
|
GTK_TABLE (table), 0, NULL);
|
|
|
|
prefs_enum_combo_box_add (color_config, "display-rendering-intent", 0, 0,
|
2005-06-16 03:55:26 +08:00
|
|
|
_("_Display rendering intent:"),
|
2005-02-08 08:04:50 +08:00
|
|
|
GTK_TABLE (table), 1, NULL);
|
|
|
|
prefs_enum_combo_box_add (color_config, "simulation-rendering-intent", 0, 0,
|
2005-06-16 03:55:26 +08:00
|
|
|
_("_Softproof rendering intent:"),
|
2005-02-08 08:04:50 +08:00
|
|
|
GTK_TABLE (table), 2, NULL);
|
|
|
|
|
2005-06-24 17:41:16 +08:00
|
|
|
for (i = 0, row = 3; i < G_N_ELEMENTS (profiles); i++, row++)
|
2005-02-08 08:04:50 +08:00
|
|
|
{
|
2005-08-10 08:24:59 +08:00
|
|
|
#if 0
|
|
|
|
button = gimp_prop_file_entry_new (color_config,
|
|
|
|
profiles[i].property_name,
|
|
|
|
gettext (profiles[i].fs_label),
|
|
|
|
FALSE, TRUE);
|
|
|
|
#else
|
2005-08-01 04:07:14 +08:00
|
|
|
button =
|
2005-03-25 08:37:16 +08:00
|
|
|
gimp_prop_file_chooser_button_new (color_config,
|
|
|
|
profiles[i].property_name,
|
|
|
|
gettext (profiles[i].fs_label),
|
|
|
|
GTK_FILE_CHOOSER_ACTION_OPEN);
|
2005-08-10 08:24:59 +08:00
|
|
|
#endif
|
2005-06-24 17:41:16 +08:00
|
|
|
|
2005-08-01 04:07:14 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, row,
|
|
|
|
gettext (profiles[i].label), 0.0, 0.5,
|
|
|
|
button, 1, FALSE);
|
2005-06-24 17:41:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
#if defined (GDK_WINDOWING_X11)
|
|
|
|
if (i == 2) /* display profile */
|
|
|
|
{
|
|
|
|
button =
|
|
|
|
gimp_prop_check_button_new (color_config,
|
|
|
|
"display-profile-from-gdk",
|
2005-06-25 04:29:24 +08:00
|
|
|
_("_Try to obtain the monitor "
|
|
|
|
"profile from the X server"));
|
2005-06-24 17:41:16 +08:00
|
|
|
|
|
|
|
row++;
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table),
|
|
|
|
button, 0, 2, row, row + 1);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
}
|
|
|
|
#endif
|
2005-02-08 08:04:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_object_unref (color_config);
|
|
|
|
}
|
|
|
|
|
2004-06-17 22:07:05 +08:00
|
|
|
/*******************/
|
|
|
|
/* Input Devices */
|
|
|
|
/*******************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Input Devices"),
|
2004-06-17 22:07:05 +08:00
|
|
|
"input-devices.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_INPUT_DEVICES,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2004-06-17 22:07:05 +08:00
|
|
|
|
|
|
|
/* Extended Input Devices */
|
|
|
|
vbox2 = prefs_frame_new (_("Extended Input Devices"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
|
|
|
button = prefs_button_add (GTK_STOCK_PREFERENCES,
|
2004-07-29 09:19:12 +08:00
|
|
|
_("Configure E_xtended Input Devices..."),
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (prefs_input_devices_dialog),
|
|
|
|
gimp);
|
|
|
|
|
|
|
|
prefs_check_button_add (object, "save-device-status",
|
2004-07-29 09:19:12 +08:00
|
|
|
_("_Save input device settings on exit"),
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
|
|
|
button = prefs_button_add (GTK_STOCK_SAVE,
|
2004-07-29 09:19:12 +08:00
|
|
|
_("Save Input Device Settings _Now"),
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
2004-07-22 00:11:31 +08:00
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (prefs_devices_save_callback),
|
|
|
|
gimp);
|
2004-06-17 22:07:05 +08:00
|
|
|
|
2004-07-29 09:19:12 +08:00
|
|
|
button2 = prefs_button_add (GIMP_STOCK_RESET,
|
|
|
|
_("_Reset Saved Input Device Settings to "
|
|
|
|
"Default Values"),
|
2004-07-22 00:11:31 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
g_signal_connect (button2, "clicked",
|
|
|
|
G_CALLBACK (prefs_devices_clear_callback),
|
|
|
|
gimp);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (button), "clear-button", button2);
|
2004-06-17 22:07:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
/****************************/
|
|
|
|
/* Additional Controllers */
|
|
|
|
/****************************/
|
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Additional Input Controllers"),
|
2004-06-17 22:07:05 +08:00
|
|
|
"controllers.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
_("Input Controllers"),
|
|
|
|
GIMP_HELP_PREFS_INPUT_CONTROLLERS,
|
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
|
|
|
page_index++);
|
2004-06-17 22:07:05 +08:00
|
|
|
|
2005-05-09 17:35:41 +08:00
|
|
|
vbox2 = gimp_controller_list_new (gimp);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), vbox2, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (vbox2);
|
2004-06-17 22:07:05 +08:00
|
|
|
|
|
|
|
|
2003-11-22 02:39:52 +08:00
|
|
|
/***********************/
|
|
|
|
/* Window Management */
|
|
|
|
/***********************/
|
2003-11-21 07:02:54 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Window Management"),
|
2003-11-22 02:39:52 +08:00
|
|
|
"window-management.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_WINDOW_MANAGEMENT,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
page_index++);
|
2003-11-21 07:02:54 +08:00
|
|
|
|
2004-05-04 21:31:57 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Window Manager Hints"),
|
2003-11-21 07:02:54 +08:00
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (2, GTK_CONTAINER (vbox2));
|
2003-11-21 07:02:54 +08:00
|
|
|
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "toolbox-window-hint", 0, 0,
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Hint for the _toolbox:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 0, size_group);
|
2003-11-21 07:02:54 +08:00
|
|
|
|
2004-04-18 23:12:42 +08:00
|
|
|
prefs_enum_combo_box_add (object, "dock-window-hint", 0, 0,
|
2005-05-12 06:18:47 +08:00
|
|
|
_("Hint for other _docks:"),
|
2004-05-21 22:17:27 +08:00
|
|
|
GTK_TABLE (table), 1, size_group);
|
2003-11-21 07:02:54 +08:00
|
|
|
|
2005-05-12 06:18:47 +08:00
|
|
|
prefs_check_button_add (object, "transient-docks",
|
|
|
|
_("Toolbox and other docks are transient "
|
|
|
|
"to the active display"),
|
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
2003-11-21 07:02:54 +08:00
|
|
|
vbox2 = prefs_frame_new (_("Focus"),
|
|
|
|
GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
|
|
|
prefs_check_button_add (object, "activate-on-focus",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("Activate the _focused image"),
|
2003-11-21 07:02:54 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
2004-06-17 22:07:05 +08:00
|
|
|
/* Window Positions */
|
|
|
|
vbox2 = prefs_frame_new (_("Window Positions"), GTK_CONTAINER (vbox), FALSE);
|
|
|
|
|
|
|
|
prefs_check_button_add (object, "save-session-info",
|
2004-06-24 06:44:04 +08:00
|
|
|
_("_Save window positions on exit"),
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
|
|
|
|
button = prefs_button_add (GTK_STOCK_SAVE,
|
2004-07-29 09:19:12 +08:00
|
|
|
_("Save Window Positions _Now"),
|
2004-06-17 22:07:05 +08:00
|
|
|
GTK_BOX (vbox2));
|
2004-07-22 00:11:31 +08:00
|
|
|
g_signal_connect (button, "clicked",
|
|
|
|
G_CALLBACK (prefs_session_save_callback),
|
|
|
|
gimp);
|
2004-06-17 22:07:05 +08:00
|
|
|
|
2004-07-29 09:19:12 +08:00
|
|
|
button2 = prefs_button_add (GIMP_STOCK_RESET,
|
|
|
|
_("_Reset Saved Window Positions to "
|
|
|
|
"Default Values"),
|
2004-07-22 00:11:31 +08:00
|
|
|
GTK_BOX (vbox2));
|
|
|
|
g_signal_connect (button2, "clicked",
|
|
|
|
G_CALLBACK (prefs_session_clear_callback),
|
|
|
|
gimp);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (button), "clear-button", button2);
|
2004-06-17 22:07:05 +08:00
|
|
|
|
2003-11-21 07:02:54 +08:00
|
|
|
|
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),
|
2005-08-01 04:07:14 +08:00
|
|
|
_("Folders"),
|
2002-02-28 21:47:03 +08:00
|
|
|
"folders.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
NULL,
|
|
|
|
GIMP_HELP_PREFS_FOLDERS,
|
|
|
|
NULL,
|
|
|
|
&top_iter,
|
|
|
|
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[] =
|
|
|
|
{
|
2004-06-25 06:35:00 +08:00
|
|
|
{ N_("Temp folder:"), N_("Select Temp Folder"), "temp-path" },
|
|
|
|
{ N_("Swap folder:"), N_("Select Swap Folder"), "swap-path" },
|
1999-03-28 02:16:30 +08:00
|
|
|
};
|
2001-12-08 01:39:51 +08:00
|
|
|
|
2004-05-21 22:17:27 +08:00
|
|
|
table = prefs_table_new (G_N_ELEMENTS (dirs) + 1, GTK_CONTAINER (vbox));
|
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
|
|
|
{
|
2005-03-25 08:37:16 +08:00
|
|
|
entry = gimp_prop_file_entry_new (object, dirs[i].property_name,
|
|
|
|
gettext (dirs[i].fs_label),
|
|
|
|
TRUE, TRUE);
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, i,
|
|
|
|
gettext (dirs[i].label), 0.0, 0.5,
|
|
|
|
entry, 1, FALSE);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-11-24 06:22:21 +08:00
|
|
|
|
|
|
|
/*********************/
|
2002-02-12 06:30:45 +08:00
|
|
|
/* Folders / <paths> */
|
2002-11-24 06:22:21 +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 *tree_label;
|
|
|
|
const gchar *label;
|
|
|
|
const gchar *icon;
|
|
|
|
const gchar *help_data;
|
|
|
|
const gchar *fs_label;
|
2004-01-29 05:53:50 +08:00
|
|
|
const gchar *path_property_name;
|
|
|
|
const gchar *writable_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",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_BRUSHES,
|
|
|
|
N_("Select Brush Folders"),
|
|
|
|
"brush-path", "brush-path-writable" },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Patterns"), N_("Pattern Folders"), "folders-patterns.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_PATTERNS,
|
|
|
|
N_("Select Pattern Folders"),
|
|
|
|
"pattern-path", "pattern-path-writable" },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Palettes"), N_("Palette Folders"), "folders-palettes.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_PALETTES,
|
|
|
|
N_("Select Palette Folders"),
|
2004-01-29 05:53:50 +08:00
|
|
|
"palette-path", "palette-path-writable" },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Gradients"), N_("Gradient Folders"), "folders-gradients.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_GRADIENTS,
|
|
|
|
N_("Select Gradient Folders"),
|
2004-01-29 05:53:50 +08:00
|
|
|
"gradient-path", "gradient-path-writable" },
|
2003-09-02 02:20:56 +08:00
|
|
|
{ N_("Fonts"), N_("Font Folders"), "folders-fonts.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_FONTS,
|
|
|
|
N_("Select Font Folders"),
|
2005-04-13 21:14:24 +08:00
|
|
|
"font-path", NULL },
|
2002-03-01 21:34:09 +08:00
|
|
|
{ N_("Plug-Ins"), N_("Plug-In Folders"), "folders-plug-ins.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_PLUG_INS,
|
|
|
|
N_("Select Plug-In Folders"),
|
2004-01-29 05:53:50 +08:00
|
|
|
"plug-in-path", NULL },
|
2003-07-08 23:36:32 +08:00
|
|
|
{ N_("Scripts"), N_("Script-Fu Folders"), "folders-scripts.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_SCRIPTS,
|
|
|
|
N_("Select Script-Fu Folders"),
|
2004-01-29 05:53:50 +08:00
|
|
|
"script-fu-path", NULL },
|
2002-03-06 19:48:16 +08:00
|
|
|
{ N_("Modules"), N_("Module Folders"), "folders-modules.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_MODULES,
|
|
|
|
N_("Select Module Folders"),
|
2004-01-29 05:53:50 +08:00
|
|
|
"module-path", NULL },
|
2005-02-21 10:56:29 +08:00
|
|
|
{ N_("Interpreters"), N_("Interpreter Folders"), "folders-interp.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_INTERPRETERS,
|
|
|
|
N_("Select Interpreter Folders"),
|
2005-02-21 10:56:29 +08:00
|
|
|
"interpreter-path", NULL },
|
2002-11-12 11:34:11 +08:00
|
|
|
{ N_("Environment"), N_("Environment Folders"), "folders-environ.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_ENVIRONMENT,
|
|
|
|
N_("Select Environment Folders"),
|
2004-01-29 05:53:50 +08:00
|
|
|
"environ-path", NULL },
|
2002-03-06 19:48:16 +08:00
|
|
|
{ N_("Themes"), N_("Theme Folders"), "folders-themes.png",
|
2005-08-01 04:07:14 +08:00
|
|
|
GIMP_HELP_PREFS_FOLDERS_THEMES,
|
|
|
|
N_("Select Theme Folders"),
|
2004-01-29 05:53:50 +08:00
|
|
|
"theme-path", NULL }
|
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
|
|
|
{
|
2005-04-17 03:27:28 +08:00
|
|
|
GtkWidget *editor;
|
|
|
|
|
2005-08-01 04:07:14 +08:00
|
|
|
vbox = prefs_notebook_append_page (gimp,
|
2002-02-28 21:47:03 +08:00
|
|
|
GTK_NOTEBOOK (notebook),
|
2005-08-01 04:07:14 +08:00
|
|
|
gettext (paths[i].label),
|
2002-03-01 21:34:09 +08:00
|
|
|
paths[i].icon,
|
2005-08-01 04:07:14 +08:00
|
|
|
GTK_TREE_STORE (tree),
|
|
|
|
gettext (paths[i].tree_label),
|
|
|
|
paths[i].help_data,
|
|
|
|
&top_iter,
|
|
|
|
&child_iter,
|
|
|
|
page_index++);
|
|
|
|
|
|
|
|
editor = gimp_prop_path_editor_new (object,
|
2005-04-17 03:27:28 +08:00
|
|
|
paths[i].path_property_name,
|
|
|
|
paths[i].writable_property_name,
|
|
|
|
gettext (paths[i].fs_label));
|
2005-08-01 04:07:14 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (vbox), editor);
|
|
|
|
gtk_widget_show (editor);
|
1999-03-28 02:16:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-10 06:37:49 +08:00
|
|
|
gtk_tree_view_expand_all (GTK_TREE_VIEW (tv));
|
|
|
|
|
|
|
|
/* collapse the Folders subtree */
|
|
|
|
path = gtk_tree_model_get_path (GTK_TREE_MODEL (tree), &top_iter);
|
|
|
|
gtk_tree_view_collapse_row (GTK_TREE_VIEW (tv), path);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
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
|
|
|
|
2002-11-21 03:45:03 +08:00
|
|
|
return dialog;
|
1998-06-09 05:53:45 +08:00
|
|
|
}
|