[gimp/goat-invasion: 376/526] app: resurrect the operation tool's title



commit bff1ec155ec65b226d026b5d48d5554c1f630f65
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 1 15:45:58 2012 +0200

    app: resurrect the operation tool's title

 app/tools/gimpoperationtool.c |   34 ++++++++++++++++++++++++++++------
 app/tools/gimpoperationtool.h |    3 ++-
 2 files changed, 30 insertions(+), 7 deletions(-)
---
diff --git a/app/tools/gimpoperationtool.c b/app/tools/gimpoperationtool.c
index e5fd5fc..fcdff2f 100644
--- a/app/tools/gimpoperationtool.c
+++ b/app/tools/gimpoperationtool.c
@@ -142,6 +142,12 @@ gimp_operation_tool_finalize (GObject *object)
       tool->config = NULL;
     }
 
+  if (tool->dialog_desc)
+    {
+      g_free (tool->dialog_desc);
+      tool->dialog_desc = NULL;
+    }
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -206,6 +212,11 @@ gimp_operation_tool_dialog (GimpImageMapTool *image_map_tool)
                          tool->options_table);
       gtk_widget_show (tool->options_table);
     }
+
+  if (tool->dialog_desc)
+    g_object_set (GIMP_IMAGE_MAP_TOOL (tool)->dialog,
+                  "description", tool->dialog_desc,
+                  NULL);
 }
 
 static void
@@ -268,7 +279,7 @@ gimp_operation_tool_config_notify (GObject           *object,
 void
 gimp_operation_tool_set_operation (GimpOperationTool *tool,
                                    const gchar       *operation,
-                                   const gchar       *label)
+                                   const gchar       *dialog_desc)
 {
   g_return_if_fail (GIMP_IS_OPERATION_TOOL (tool));
   g_return_if_fail (operation != NULL);
@@ -312,7 +323,7 @@ gimp_operation_tool_set_operation (GimpOperationTool *tool,
   GIMP_IMAGE_MAP_TOOL (tool)->config = g_object_ref (tool->config);
 
   GIMP_VIEWABLE_GET_CLASS (tool->config)->default_stock_id = GIMP_STOCK_GEGL;
-  GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->settings_name = label; /* XXX hack */
+  GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->settings_name = dialog_desc; /* XXX hack */
 
   if (tool->options_table)
     {
@@ -339,10 +350,21 @@ gimp_operation_tool_set_operation (GimpOperationTool *tool,
         }
     }
 
-  if (label && GIMP_IMAGE_MAP_TOOL (tool)->dialog)
-    g_object_set (GIMP_IMAGE_MAP_TOOL (tool)->dialog,
-                  "description", label,
-                  NULL);
+  if (tool->dialog_desc)
+    {
+      g_free (tool->dialog_desc);
+      tool->dialog_desc = NULL;
+    }
+
+  if (dialog_desc)
+    {
+      tool->dialog_desc = g_strdup (dialog_desc);
+
+      if (GIMP_IMAGE_MAP_TOOL (tool)->dialog)
+        g_object_set (GIMP_IMAGE_MAP_TOOL (tool)->dialog,
+                      "description", dialog_desc,
+                      NULL);
+    }
 
   if (GIMP_TOOL (tool)->drawable)
     gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
diff --git a/app/tools/gimpoperationtool.h b/app/tools/gimpoperationtool.h
index dc2e95d..0abfe73 100644
--- a/app/tools/gimpoperationtool.h
+++ b/app/tools/gimpoperationtool.h
@@ -41,6 +41,7 @@ struct _GimpOperationTool
   GimpObject       *config;
 
   /* dialog */
+  gchar            *dialog_desc;
   GtkWidget        *options_box;
   GtkWidget        *options_table;
 };
@@ -58,7 +59,7 @@ GType   gimp_operation_tool_get_type      (void) G_GNUC_CONST;
 
 void    gimp_operation_tool_set_operation (GimpOperationTool        *tool,
                                            const gchar              *operation,
-                                           const gchar              *label);
+                                           const gchar              *dialog_desc);
 
 
 #endif  /*  __GIMP_OPERATION_TOOL_H__  */



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