app: move "default-threshold" from GimpGuiConfig to GimpCoreConfig

This commit is contained in:
Michael Natterer 2011-02-04 15:19:44 +01:00
parent 1cf5295d2e
commit f76bcab221
6 changed files with 16 additions and 16 deletions

View File

@ -52,6 +52,7 @@ enum
PROP_0, PROP_0,
PROP_LANGUAGE, PROP_LANGUAGE,
PROP_INTERPOLATION_TYPE, PROP_INTERPOLATION_TYPE,
PROP_DEFAULT_THRESHOLD,
PROP_PLUG_IN_PATH, PROP_PLUG_IN_PATH,
PROP_MODULE_PATH, PROP_MODULE_PATH,
PROP_INTERPRETER_PATH, PROP_INTERPRETER_PATH,
@ -151,6 +152,10 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_TYPE_INTERPOLATION_TYPE, GIMP_TYPE_INTERPOLATION_TYPE,
GIMP_INTERPOLATION_CUBIC, GIMP_INTERPOLATION_CUBIC,
GIMP_PARAM_STATIC_STRINGS); GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_THRESHOLD,
"default-threshold", DEFAULT_THRESHOLD_BLURB,
0, 255, 15,
GIMP_PARAM_STATIC_STRINGS);
path = gimp_config_build_plug_in_path ("plug-ins"); path = gimp_config_build_plug_in_path ("plug-ins");
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUG_IN_PATH, GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUG_IN_PATH,
@ -533,6 +538,9 @@ gimp_core_config_set_property (GObject *object,
case PROP_INTERPOLATION_TYPE: case PROP_INTERPOLATION_TYPE:
core_config->interpolation_type = g_value_get_enum (value); core_config->interpolation_type = g_value_get_enum (value);
break; break;
case PROP_DEFAULT_THRESHOLD:
core_config->default_threshold = g_value_get_int (value);
break;
case PROP_PLUG_IN_PATH: case PROP_PLUG_IN_PATH:
g_free (core_config->plug_in_path); g_free (core_config->plug_in_path);
core_config->plug_in_path = g_value_dup_string (value); core_config->plug_in_path = g_value_dup_string (value);
@ -731,6 +739,9 @@ gimp_core_config_get_property (GObject *object,
case PROP_INTERPOLATION_TYPE: case PROP_INTERPOLATION_TYPE:
g_value_set_enum (value, core_config->interpolation_type); g_value_set_enum (value, core_config->interpolation_type);
break; break;
case PROP_DEFAULT_THRESHOLD:
g_value_set_int (value, core_config->default_threshold);
break;
case PROP_PLUG_IN_PATH: case PROP_PLUG_IN_PATH:
g_value_set_string (value, core_config->plug_in_path); g_value_set_string (value, core_config->plug_in_path);
break; break;

View File

@ -41,6 +41,7 @@ struct _GimpCoreConfig
gchar *language; gchar *language;
GimpInterpolationType interpolation_type; GimpInterpolationType interpolation_type;
gint default_threshold;
gchar *plug_in_path; gchar *plug_in_path;
gchar *module_path; gchar *module_path;
gchar *interpreter_path; gchar *interpreter_path;

View File

@ -43,7 +43,6 @@
enum enum
{ {
PROP_0, PROP_0,
PROP_DEFAULT_THRESHOLD,
PROP_MOVE_TOOL_CHANGES_ACTIVE, PROP_MOVE_TOOL_CHANGES_ACTIVE,
PROP_IMAGE_MAP_TOOL_MAX_RECENT, PROP_IMAGE_MAP_TOOL_MAX_RECENT,
PROP_TRUST_DIRTY_FLAG, PROP_TRUST_DIRTY_FLAG,
@ -112,10 +111,6 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
object_class->set_property = gimp_gui_config_set_property; object_class->set_property = gimp_gui_config_set_property;
object_class->get_property = gimp_gui_config_get_property; object_class->get_property = gimp_gui_config_get_property;
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_DEFAULT_THRESHOLD,
"default-threshold", DEFAULT_THRESHOLD_BLURB,
0, 255, 15,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MOVE_TOOL_CHANGES_ACTIVE, GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MOVE_TOOL_CHANGES_ACTIVE,
"move-tool-changes-active", "move-tool-changes-active",
MOVE_TOOL_CHANGES_ACTIVE_BLURB, MOVE_TOOL_CHANGES_ACTIVE_BLURB,
@ -332,9 +327,6 @@ gimp_gui_config_set_property (GObject *object,
switch (property_id) switch (property_id)
{ {
case PROP_DEFAULT_THRESHOLD:
gui_config->default_threshold = g_value_get_int (value);
break;
case PROP_MOVE_TOOL_CHANGES_ACTIVE: case PROP_MOVE_TOOL_CHANGES_ACTIVE:
gui_config->move_tool_changes_active = g_value_get_boolean (value); gui_config->move_tool_changes_active = g_value_get_boolean (value);
break; break;
@ -456,9 +448,6 @@ gimp_gui_config_get_property (GObject *object,
switch (property_id) switch (property_id)
{ {
case PROP_DEFAULT_THRESHOLD:
g_value_set_int (value, gui_config->default_threshold);
break;
case PROP_MOVE_TOOL_CHANGES_ACTIVE: case PROP_MOVE_TOOL_CHANGES_ACTIVE:
g_value_set_boolean (value, gui_config->move_tool_changes_active); g_value_set_boolean (value, gui_config->move_tool_changes_active);
break; break;

View File

@ -37,7 +37,6 @@ struct _GimpGuiConfig
{ {
GimpDisplayConfig parent_instance; GimpDisplayConfig parent_instance;
gint default_threshold;
gboolean move_tool_changes_active; gboolean move_tool_changes_active;
gint image_map_tool_max_recent; gint image_map_tool_max_recent;
gboolean trust_dirty_flag; gboolean trust_dirty_flag;

View File

@ -24,7 +24,7 @@
#include "tools-types.h" #include "tools-types.h"
#include "config/gimpguiconfig.h" #include "config/gimpcoreconfig.h"
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpdatafactory.h" #include "core/gimpdatafactory.h"
@ -204,7 +204,7 @@ gimp_bucket_fill_options_reset (GimpToolOptions *tool_options)
if (pspec) if (pspec)
G_PARAM_SPEC_DOUBLE (pspec)->default_value = G_PARAM_SPEC_DOUBLE (pspec)->default_value =
GIMP_GUI_CONFIG (tool_options->tool_info->gimp->config)->default_threshold; tool_options->tool_info->gimp->config->default_threshold;
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options); GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
} }

View File

@ -24,7 +24,7 @@
#include "tools-types.h" #include "tools-types.h"
#include "config/gimpguiconfig.h" #include "config/gimpcoreconfig.h"
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimptoolinfo.h" #include "core/gimptoolinfo.h"
@ -182,7 +182,7 @@ gimp_region_select_options_reset (GimpToolOptions *tool_options)
if (pspec) if (pspec)
G_PARAM_SPEC_DOUBLE (pspec)->default_value = G_PARAM_SPEC_DOUBLE (pspec)->default_value =
GIMP_GUI_CONFIG (tool_options->tool_info->gimp->config)->default_threshold; tool_options->tool_info->gimp->config->default_threshold;
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options); GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
} }