Commit d164aa74 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

do nothing if this message is at the top of the stack already.

2005-04-01  Sven Neumann  <sven@gimp.org>

	* app/display/gimpstatusbar.c (gimp_statusbar_push): do nothing if
	this message is at the top of the stack already.
parent 45a7cd9a
2005-04-01 Sven Neumann <sven@gimp.org>
* app/display/gimpstatusbar.c (gimp_statusbar_push): do nothing if
this message is at the top of the stack already.
2005-04-01 Sven Neumann <sven@gimp.org>
* app/tools/gimppainttool.c: added a statusbar message suggesting
......
......@@ -18,6 +18,8 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
......@@ -469,6 +471,12 @@ gimp_statusbar_push (GimpStatusbar *statusbar,
context_id = gimp_statusbar_get_context_id (statusbar, context);
/* do nothing if this message is at the top of the queue already */
msg = statusbar->messages ? statusbar->messages->data : NULL;
if (msg &&
msg->context_id == context_id && strcmp (msg->text, message) == 0)
return;
for (list = statusbar->messages; list; list = g_slist_next (list))
{
msg = list->data;
......
......@@ -120,6 +120,12 @@ static void gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
GParamSpec *pspec,
GimpPaintTool *paint_tool);
static void gimp_paint_tool_push_status (GimpTool *tool,
GimpDisplayShell *shell,
const gchar *message);
static void gimp_paint_tool_pop_status (GimpTool *tool,
GimpDisplayShell *status);
static GimpColorToolClass *parent_class = NULL;
......@@ -638,8 +644,7 @@ gimp_paint_tool_oper_update (GimpTool *tool,
if (gimp_draw_tool_is_active (draw_tool))
gimp_draw_tool_stop (draw_tool);
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool));
gimp_paint_tool_pop_status (tool, shell);
if (tool->gdisp &&
tool->gdisp != gdisp &&
......@@ -707,17 +712,16 @@ gimp_paint_tool_oper_update (GimpTool *tool,
g_snprintf (status_str, sizeof (status_str), format_str, dist);
}
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool), status_str);
gimp_paint_tool_push_status (tool, shell, status_str);
paint_tool->draw_line = TRUE;
}
else
{
if (gdisp == tool->gdisp)
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool),
_("Press Shift to draw a straight line."));
gimp_paint_tool_push_status (tool, shell,
_("Press Shift to "
"draw a straight line."));
paint_tool->draw_line = FALSE;
}
......@@ -933,3 +937,20 @@ gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
gimp_draw_tool_resume (GIMP_DRAW_TOOL (paint_tool));
}
static void
gimp_paint_tool_push_status (GimpTool *tool,
GimpDisplayShell *shell,
const gchar *message)
{
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool), message);
}
static void
gimp_paint_tool_pop_status (GimpTool *tool,
GimpDisplayShell *shell)
{
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool));
}
......@@ -120,6 +120,12 @@ static void gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
GParamSpec *pspec,
GimpPaintTool *paint_tool);
static void gimp_paint_tool_push_status (GimpTool *tool,
GimpDisplayShell *shell,
const gchar *message);
static void gimp_paint_tool_pop_status (GimpTool *tool,
GimpDisplayShell *status);
static GimpColorToolClass *parent_class = NULL;
......@@ -638,8 +644,7 @@ gimp_paint_tool_oper_update (GimpTool *tool,
if (gimp_draw_tool_is_active (draw_tool))
gimp_draw_tool_stop (draw_tool);
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool));
gimp_paint_tool_pop_status (tool, shell);
if (tool->gdisp &&
tool->gdisp != gdisp &&
......@@ -707,17 +712,16 @@ gimp_paint_tool_oper_update (GimpTool *tool,
g_snprintf (status_str, sizeof (status_str), format_str, dist);
}
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool), status_str);
gimp_paint_tool_push_status (tool, shell, status_str);
paint_tool->draw_line = TRUE;
}
else
{
if (gdisp == tool->gdisp)
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool),
_("Press Shift to draw a straight line."));
gimp_paint_tool_push_status (tool, shell,
_("Press Shift to "
"draw a straight line."));
paint_tool->draw_line = FALSE;
}
......@@ -933,3 +937,20 @@ gimp_paint_tool_notify_brush (GimpDisplayConfig *config,
gimp_draw_tool_resume (GIMP_DRAW_TOOL (paint_tool));
}
static void
gimp_paint_tool_push_status (GimpTool *tool,
GimpDisplayShell *shell,
const gchar *message)
{
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool), message);
}
static void
gimp_paint_tool_pop_status (GimpTool *tool,
GimpDisplayShell *shell)
{
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar),
G_OBJECT_TYPE_NAME (tool));
}
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