Commit 62c23a23 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

reset the tool options before deserializing so they have the correct

2004-10-06  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimp-tools.c (gimp_tools_restore): reset the tool
	options before deserializing so they have the correct default
	values. Fixes bug #120832.

	* app/tools/gimpbucketfilloptions.c
	* app/tools/gimpmagnifyoptions.c
	* app/tools/gimpselectionoptions.c
	* app/tools/gimptransformoptions.c: removed all set_defaults()
	utility functions and moved their code to reset(). The change
	above calls them automatically so there is no need to call them
	from the GUI constructors any more.
parent dc3e9ec8
2004-10-06 Michael Natterer <mitch@gimp.org>
* app/tools/gimp-tools.c (gimp_tools_restore): reset the tool
options before deserializing so they have the correct default
values. Fixes bug #120832.
* app/tools/gimpbucketfilloptions.c
* app/tools/gimpmagnifyoptions.c
* app/tools/gimpselectionoptions.c
* app/tools/gimptransformoptions.c: removed all set_defaults()
utility functions and moved their code to reset(). The change
above calls them automatically so there is no need to call them
from the GUI constructors any more.
2004-10-06 Michael Natterer <mitch@gimp.org>
* plug-ins/script-fu/scripts/selection-round.scm: use a
......
......@@ -262,6 +262,9 @@ gimp_tools_restore (Gimp *gimp)
tool_info = GIMP_TOOL_INFO (list->data);
/* get default values from prefs (see bug #120832) */
gimp_tool_options_reset (tool_info->tool_options);
gimp_tool_options_deserialize (tool_info->tool_options, NULL, NULL);
options_gui_func = g_object_get_data (G_OBJECT (tool_info),
......
......@@ -65,7 +65,6 @@ static void gimp_bucket_fill_options_get_property (GObject *object,
GParamSpec *pspec);
static void gimp_bucket_fill_options_reset (GimpToolOptions *tool_options);
static void gimp_bucket_fill_options_set_defaults (GimpToolOptions *tool_options);
static void gimp_bucket_fill_options_notify (GimpBucketFillOptions *options,
GParamSpec *pspec,
GtkWidget *widget);
......@@ -207,14 +206,6 @@ gimp_bucket_fill_options_get_property (GObject *object,
static void
gimp_bucket_fill_options_reset (GimpToolOptions *tool_options)
{
gimp_bucket_fill_options_set_defaults (tool_options);
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
static void
gimp_bucket_fill_options_set_defaults (GimpToolOptions *tool_options)
{
GParamSpec *pspec;
......@@ -224,6 +215,8 @@ gimp_bucket_fill_options_set_defaults (GimpToolOptions *tool_options)
if (pspec)
G_PARAM_SPEC_DOUBLE (pspec)->default_value =
GIMP_GUI_CONFIG (tool_options->tool_info->gimp->config)->default_threshold;
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
GtkWidget *
......@@ -298,8 +291,6 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
1.0, 16.0, 1,
FALSE, 0.0, 0.0);
gimp_bucket_fill_options_set_defaults (tool_options);
return vbox;
}
......
......@@ -60,7 +60,6 @@ static void gimp_magnify_options_get_property (GObject *object,
GParamSpec *pspec);
static void gimp_magnify_options_reset (GimpToolOptions *tool_options);
static void gimp_magnify_options_set_defaults (GimpToolOptions *tool_options);
static GimpToolOptionsClass *parent_class = NULL;
......@@ -174,14 +173,6 @@ gimp_magnify_options_get_property (GObject *object,
static void
gimp_magnify_options_reset (GimpToolOptions *tool_options)
{
gimp_magnify_options_set_defaults (tool_options);
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
static void
gimp_magnify_options_set_defaults (GimpToolOptions *tool_options)
{
GParamSpec *pspec;
......@@ -191,6 +182,8 @@ gimp_magnify_options_set_defaults (GimpToolOptions *tool_options)
if (pspec)
G_PARAM_SPEC_BOOLEAN (pspec)->default_value =
GIMP_DISPLAY_CONFIG (tool_options->tool_info->gimp->config)->resize_windows_on_zoom;
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
GtkWidget *
......@@ -234,7 +227,5 @@ gimp_magnify_options_gui (GimpToolOptions *tool_options)
1.0, 3.0, 1,
FALSE, 0.0, 0.0);
gimp_magnify_options_set_defaults (tool_options);
return vbox;
}
......@@ -74,7 +74,7 @@ static void gimp_selection_options_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gimp_selection_options_reset (GimpToolOptions *tool_options);static void gimp_selection_options_set_defaults (GimpToolOptions *tool_options);
static void gimp_selection_options_reset (GimpToolOptions *tool_options);
static void selection_options_fixed_mode_notify (GimpSelectionOptions *options,
GParamSpec *pspec,
......@@ -324,14 +324,6 @@ gimp_selection_options_get_property (GObject *object,
static void
gimp_selection_options_reset (GimpToolOptions *tool_options)
{
gimp_selection_options_set_defaults (tool_options);
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
static void
gimp_selection_options_set_defaults (GimpToolOptions *tool_options)
{
GParamSpec *pspec;
......@@ -348,6 +340,8 @@ gimp_selection_options_set_defaults (GimpToolOptions *tool_options)
if (pspec)
G_PARAM_SPEC_DOUBLE (pspec)->default_value =
GIMP_GUI_CONFIG (tool_options->tool_info->gimp->config)->default_threshold;
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
GtkWidget *
......@@ -554,8 +548,6 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (table);
}
gimp_selection_options_set_defaults (tool_options);
return vbox;
}
......
......@@ -71,7 +71,6 @@ static void gimp_transform_options_get_property (GObject *object,
GParamSpec *pspec);
static void gimp_transform_options_reset (GimpToolOptions *tool_options);
static void gimp_transform_options_set_defaults (GimpToolOptions *tool_options);
static void gimp_transform_options_preview_notify (GimpTransformOptions *options,
GParamSpec *pspec,
......@@ -289,14 +288,6 @@ gimp_transform_options_get_property (GObject *object,
static void
gimp_transform_options_reset (GimpToolOptions *tool_options)
{
gimp_transform_options_set_defaults (tool_options);
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
static void
gimp_transform_options_set_defaults (GimpToolOptions *tool_options)
{
GParamSpec *pspec;
......@@ -306,6 +297,8 @@ gimp_transform_options_set_defaults (GimpToolOptions *tool_options)
if (pspec)
G_PARAM_SPEC_ENUM (pspec)->default_value =
tool_options->tool_info->gimp->config->interpolation_type;
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
}
GtkWidget *
......@@ -486,8 +479,6 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
}
}
gimp_transform_options_set_defaults (tool_options);
return vbox;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment