Commit e19c0977 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added gimp_tool_message() which uses the new statusbar messages.

2006-09-28  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]: added gimp_tool_message() which uses
	the new statusbar messages.

	* app/tools/gimptool.c
	* app/tools/gimppainttool.c: use it instead of accessing the
	statusbar directly.

	* app/tools/gimptransformtool.c: use it instead of gimp_message().
parent 5124acf1
2006-09-28 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.[ch]: added gimp_tool_message() which uses
the new statusbar messages.
* app/tools/gimptool.c
* app/tools/gimppainttool.c: use it instead of accessing the
statusbar directly.
* app/tools/gimptransformtool.c: use it instead of gimp_message().
2006-09-28 Sven Neumann <sven@gimp.org>
* app/paint-funcs/paint-funcs.c: some more cleanup.
......
......@@ -39,7 +39,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpstatusbar.h"
#include "gimpcoloroptions.h"
#include "gimppainttool.h"
......@@ -317,11 +316,7 @@ gimp_paint_tool_button_press (GimpTool *tool,
if (! gimp_paint_core_start (core, drawable, paint_options, &curr_coords,
&error))
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
gimp_statusbar_push_temp (GIMP_STATUSBAR (shell->statusbar),
error->message);
gimp_tool_message (tool, display, error->message);
g_clear_error (&error);
return;
}
......
......@@ -385,11 +385,7 @@ gimp_tool_initialize (GimpTool *tool,
if (! GIMP_TOOL_GET_CLASS (tool)->initialize (tool, display, &error))
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
gimp_statusbar_push_temp (GIMP_STATUSBAR (shell->statusbar),
error->message);
gimp_tool_message (tool, display, error->message);
g_clear_error (&error);
return FALSE;
}
......@@ -722,6 +718,7 @@ gimp_tool_push_status (GimpTool *tool,
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
g_return_if_fail (message != NULL);
shell = GIMP_DISPLAY_SHELL (display->shell);
......@@ -778,6 +775,7 @@ gimp_tool_replace_status (GimpTool *tool,
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
g_return_if_fail (message != NULL);
shell = GIMP_DISPLAY_SHELL (display->shell);
......@@ -801,6 +799,23 @@ gimp_tool_pop_status (GimpTool *tool,
G_OBJECT_TYPE_NAME (tool));
}
void
gimp_tool_message (GimpTool *tool,
GimpDisplay *display,
const gchar *message)
{
GimpDisplayShell *shell;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
g_return_if_fail (message != NULL);
shell = GIMP_DISPLAY_SHELL (display->shell);
gimp_statusbar_push_temp (GIMP_STATUSBAR (shell->statusbar),
"%s", message);
}
void
gimp_tool_set_cursor (GimpTool *tool,
GimpDisplay *display,
......
......@@ -193,6 +193,10 @@ void gimp_tool_replace_status (GimpTool *tool,
void gimp_tool_pop_status (GimpTool *tool,
GimpDisplay *display);
void gimp_tool_message (GimpTool *tool,
GimpDisplay *display,
const gchar *message);
void gimp_tool_set_cursor (GimpTool *tool,
GimpDisplay *display,
GimpCursorType cursor,
......
......@@ -31,7 +31,6 @@
#include "base/tile-manager.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable-transform.h"
......@@ -1049,7 +1048,8 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool,
case GIMP_TRANSFORM_TYPE_SELECTION:
active_item = (GimpItem *) gimp_image_get_mask (display->image);
message = _("There is no selection to transform.");
/* cannot happen, so don't translate this message */
message = "There is no selection to transform.";
break;
case GIMP_TRANSFORM_TYPE_PATH:
......@@ -1060,7 +1060,7 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool,
if (! active_item)
{
gimp_message (display->image->gimp, GIMP_PROGRESS (display), message);
gimp_tool_message (tool, display, message);
return;
}
......
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