removed gimp_image_get_type_string() again.

2009-01-29  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage.[ch]: removed gimp_image_get_type_string()
	again.
	
	* app/display/gimpdisplayshell-title.c
	(gimp_display_shell_format_title): use the GimpImageBaseType 
enum
	instead.

	* app/tools/gimptool.c (gimp_tool_oper_update): if the image is
	empty and the tool can't handle that, display a message in the
	statusbar telling the user about this.


svn path=/trunk/; revision=27970
This commit is contained in:
Sven Neumann 2009-01-29 21:32:30 +00:00 committed by Sven Neumann
parent d9bd97d02b
commit b25b979fc9
5 changed files with 35 additions and 17 deletions

View File

@ -1,3 +1,16 @@
2009-01-29 Sven Neumann <sven@gimp.org>
* app/core/gimpimage.[ch]: removed gimp_image_get_type_string()
again.
* app/display/gimpdisplayshell-title.c
(gimp_display_shell_format_title): use the GimpImageBaseType enum
instead.
* app/tools/gimptool.c (gimp_tool_oper_update): if the image is
empty and the tool can't handle that, display a message in the
statusbar telling the user about this.
2009-01-29 Sven Neumann <sven@gimp.org>
* app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse_rect):

View File

@ -3714,20 +3714,6 @@ gimp_image_position_vectors (GimpImage *image,
return TRUE;
}
const gchar *
gimp_image_get_type_string (GimpImage *image)
{
gboolean empty = gimp_image_is_empty (image);
switch (gimp_image_base_type (image))
{
case GIMP_RGB: return empty ? _("RGB-empty") : _("RGB");
case GIMP_GRAY: return empty ? _("grayscale-empty") : _("grayscale");
case GIMP_INDEXED: return empty ? _("indexed-empty") : _("indexed");
default: return "unknown";
}
}
gboolean
gimp_image_layer_boundary (const GimpImage *image,
BoundSeg **segs,

View File

@ -544,8 +544,6 @@ gboolean gimp_image_position_vectors (GimpImage *image,
gint new_index,
gboolean push_undo,
const gchar *undo_desc);
const gchar * gimp_image_get_type_string (GimpImage *image);
gboolean gimp_image_layer_boundary (const GimpImage *image,
BoundSeg **segs,
gint *n_segs);

View File

@ -121,6 +121,16 @@ gimp_display_shell_update_title_idle (gpointer data)
return FALSE;
}
static const gchar *
gimp_display_shell_title_image_type (GimpImage *image)
{
const gchar *name = "";
gimp_enum_get_value (GIMP_TYPE_IMAGE_BASE_TYPE,
gimp_image_base_type (image), NULL, NULL, &name, NULL);
return name;
}
static gint print (gchar *buf,
gint len,
@ -218,7 +228,8 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
break;
case 't': /* type */
i += print (title, title_len, i, "%s", gimp_image_get_type_string (image));
i += print (title, title_len, i, "%s",
gimp_display_shell_title_image_type (image));
break;
case 's': /* user source zoom factor */

View File

@ -38,6 +38,7 @@
#include "gimptoolcontrol.h"
#include "gimp-log.h"
#include "gimp-intl.h"
enum
@ -840,6 +841,15 @@ gimp_tool_oper_update (GimpTool *tool,
GIMP_TOOL_GET_CLASS (tool)->oper_update (tool, coords, state, proximity,
display);
if (G_UNLIKELY (gimp_image_is_empty (display->image) &&
! gimp_tool_control_get_handle_empty_image (tool->control)))
{
gimp_tool_replace_status (tool, display,
"%s",
_("Can't work on an empty image, "
"add a layer first"));
}
}
void