gimp r27970 - in trunk: . app/core app/display app/tools
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27970 - in trunk: . app/core app/display app/tools
- Date: Thu, 29 Jan 2009 21:32:30 +0000 (UTC)
Author: neo
Date: Thu Jan 29 21:32:30 2009
New Revision: 27970
URL: http://svn.gnome.org/viewvc/gimp?rev=27970&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/app/core/gimpimage.c
trunk/app/core/gimpimage.h
trunk/app/display/gimpdisplayshell-title.c
trunk/app/tools/gimptool.c
Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c (original)
+++ trunk/app/core/gimpimage.c Thu Jan 29 21:32:30 2009
@@ -3714,20 +3714,6 @@
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,
Modified: trunk/app/core/gimpimage.h
==============================================================================
--- trunk/app/core/gimpimage.h (original)
+++ trunk/app/core/gimpimage.h Thu Jan 29 21:32:30 2009
@@ -544,8 +544,6 @@
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);
Modified: trunk/app/display/gimpdisplayshell-title.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-title.c (original)
+++ trunk/app/display/gimpdisplayshell-title.c Thu Jan 29 21:32:30 2009
@@ -121,6 +121,16 @@
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 @@
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 */
Modified: trunk/app/tools/gimptool.c
==============================================================================
--- trunk/app/tools/gimptool.c (original)
+++ trunk/app/tools/gimptool.c Thu Jan 29 21:32:30 2009
@@ -38,6 +38,7 @@
#include "gimptoolcontrol.h"
#include "gimp-log.h"
+#include "gimp-intl.h"
enum
@@ -840,6 +841,15 @@
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]