[gimp] app: move shutdown code from gimp_measure_tool_halt() to control(HALT)



commit 8ca28f19a36ba39f25395c856863e0d2a57549a9
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 1 14:49:25 2011 +0200

    app: move shutdown code from gimp_measure_tool_halt() to control(HALT)

 app/tools/gimpmeasuretool.c |   28 +++++-----------------------
 1 files changed, 5 insertions(+), 23 deletions(-)
---
diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c
index ab38d12..97c6b3f 100644
--- a/app/tools/gimpmeasuretool.c
+++ b/app/tools/gimpmeasuretool.c
@@ -100,8 +100,6 @@ static void     gimp_measure_tool_cursor_update   (GimpTool              *tool,
 
 static void     gimp_measure_tool_draw            (GimpDrawTool          *draw_tool);
 
-static void     gimp_measure_tool_halt            (GimpMeasureTool       *measure);
-
 static gdouble  gimp_measure_tool_get_angle       (gint                   dx,
                                                    gint                   dy,
                                                    gdouble                xres,
@@ -173,6 +171,8 @@ gimp_measure_tool_control (GimpTool       *tool,
                            GimpToolAction  action,
                            GimpDisplay    *display)
 {
+  GimpMeasureTool *measure = GIMP_MEASURE_TOOL (tool);
+
   switch (action)
     {
     case GIMP_TOOL_ACTION_PAUSE:
@@ -180,7 +180,8 @@ gimp_measure_tool_control (GimpTool       *tool,
       break;
 
     case GIMP_TOOL_ACTION_HALT:
-      gimp_measure_tool_halt (GIMP_MEASURE_TOOL (tool));
+      if (measure->dialog)
+        gtk_widget_destroy (measure->dialog);
       break;
     }
 
@@ -482,7 +483,7 @@ gimp_measure_tool_key_press (GimpTool    *tool,
       switch (kevent->keyval)
         {
         case GDK_KEY_Escape:
-          gimp_measure_tool_halt (GIMP_MEASURE_TOOL (tool));
+          gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
           return TRUE;
 
         default:
@@ -824,25 +825,6 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool)
     }
 }
 
-static void
-gimp_measure_tool_halt (GimpMeasureTool *measure)
-{
-  GimpTool *tool = GIMP_TOOL (measure);
-
-  if (measure->dialog)
-    gtk_widget_destroy (measure->dialog);
-
-  gimp_tool_pop_status (tool, tool->display);
-
-  if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (measure)))
-    gimp_draw_tool_stop (GIMP_DRAW_TOOL (measure));
-
-  if (gimp_tool_control_is_active (tool->control))
-    gimp_tool_control_halt (tool->control);
-
-  tool->display = NULL;
-}
-
 static gdouble
 gimp_measure_tool_get_angle (gint    dx,
                              gint    dy,



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