gimp r25890 - in trunk: . app/tools



Author: neo
Date: Wed Jun  4 13:57:39 2008
New Revision: 25890
URL: http://svn.gnome.org/viewvc/gimp?rev=25890&view=rev

Log:
2008-06-04  Sven Neumann  <sven gimp org>

	* app/tools/gimpcropoptions.c
	* app/tools/gimprectangleoptions.c
	* app/tools/gimprectangleselectoptions.c: fixed handling of the
	"highlight" property that needs different default values for the
	Crop and Rectangle Select tools (bug #536582).


Modified:
   trunk/ChangeLog
   trunk/app/tools/gimpcropoptions.c
   trunk/app/tools/gimprectangleoptions.c
   trunk/app/tools/gimprectangleselectoptions.c

Modified: trunk/app/tools/gimpcropoptions.c
==============================================================================
--- trunk/app/tools/gimpcropoptions.c	(original)
+++ trunk/app/tools/gimpcropoptions.c	Wed Jun  4 13:57:39 2008
@@ -68,6 +68,15 @@
   object_class->set_property = gimp_crop_options_set_property;
   object_class->get_property = gimp_crop_options_get_property;
 
+  /* The 'highlight' property is defined here because we want different
+   * default values for the Crop and the Rectangle Select tools.
+   */
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class,
+                                    GIMP_RECTANGLE_OPTIONS_PROP_HIGHLIGHT,
+                                    "highlight", NULL,
+                                    TRUE,
+                                    GIMP_PARAM_STATIC_STRINGS);
+
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_LAYER_ONLY,
                                     "layer-only", NULL,
                                     FALSE,
@@ -97,14 +106,16 @@
                                 const GValue *value,
                                 GParamSpec   *pspec)
 {
+  GimpCropOptions *options = GIMP_CROP_OPTIONS (object);
+
   switch (property_id)
     {
     case PROP_LAYER_ONLY:
-      GIMP_CROP_OPTIONS (object)->layer_only = g_value_get_boolean (value);
+      options->layer_only = g_value_get_boolean (value);
       break;
 
     case PROP_ALLOW_GROWING:
-      GIMP_CROP_OPTIONS (object)->allow_growing = g_value_get_boolean (value);
+      options->allow_growing = g_value_get_boolean (value);
       break;
 
     default:
@@ -119,14 +130,16 @@
                                 GValue     *value,
                                 GParamSpec *pspec)
 {
+  GimpCropOptions *options = GIMP_CROP_OPTIONS (object);
+
   switch (property_id)
     {
     case PROP_LAYER_ONLY:
-      g_value_set_boolean (value, GIMP_CROP_OPTIONS (object)->layer_only);
+      g_value_set_boolean (value, options->layer_only);
       break;
 
     case PROP_ALLOW_GROWING:
-      g_value_set_boolean (value, GIMP_CROP_OPTIONS (object)->allow_growing);
+      g_value_set_boolean (value, options->allow_growing);
       break;
 
     default:

Modified: trunk/app/tools/gimprectangleoptions.c
==============================================================================
--- trunk/app/tools/gimprectangleoptions.c	(original)
+++ trunk/app/tools/gimprectangleoptions.c	Wed Jun  4 13:57:39 2008
@@ -116,13 +116,6 @@
                                                                  GIMP_PARAM_STATIC_STRINGS));
 
       g_object_interface_install_property (iface,
-                                           g_param_spec_boolean ("highlight",
-                                                                 NULL, NULL,
-                                                                 TRUE,
-                                                                 GIMP_CONFIG_PARAM_FLAGS |
-                                                                 GIMP_PARAM_STATIC_STRINGS));
-
-      g_object_interface_install_property (iface,
                                            g_param_spec_enum ("guide",
                                                               NULL, NULL,
                                                               GIMP_TYPE_RECTANGLE_GUIDE,
@@ -380,9 +373,6 @@
                                     GIMP_RECTANGLE_OPTIONS_PROP_SHRINK_MERGED,
                                     "shrink-merged");
   g_object_class_override_property (klass,
-                                    GIMP_RECTANGLE_OPTIONS_PROP_HIGHLIGHT,
-                                    "highlight");
-  g_object_class_override_property (klass,
                                     GIMP_RECTANGLE_OPTIONS_PROP_GUIDE,
                                     "guide");
 

Modified: trunk/app/tools/gimprectangleselectoptions.c
==============================================================================
--- trunk/app/tools/gimprectangleselectoptions.c	(original)
+++ trunk/app/tools/gimprectangleselectoptions.c	Wed Jun  4 13:57:39 2008
@@ -69,6 +69,15 @@
   object_class->set_property = gimp_rectangle_select_options_set_property;
   object_class->get_property = gimp_rectangle_select_options_get_property;
 
+  /* The 'highlight' property is defined here because we want different
+   * default values for the Crop and the Rectangle Select tools.
+   */
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class,
+                                    GIMP_RECTANGLE_OPTIONS_PROP_HIGHLIGHT,
+                                    "highlight", NULL,
+                                    FALSE,
+                                    GIMP_PARAM_STATIC_STRINGS);
+
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ROUND_CORNERS,
                                     "round-corners", NULL,
                                     FALSE,
@@ -176,10 +185,6 @@
     vbox_rectangle = gimp_rectangle_options_gui (tool_options);
     gtk_box_pack_start (GTK_BOX (vbox), vbox_rectangle, FALSE, FALSE, 0);
     gtk_widget_show (vbox_rectangle);
-
-    g_object_set (GIMP_RECTANGLE_OPTIONS (tool_options),
-                  "highlight", FALSE,
-                  NULL);
   }
 
   return vbox;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]