Issue #1371 - Add title printf-like expando for export-clean and export-dirty

Add %Ex to print 'x' as export-clean indicator and %Nx for 'x' as
export-dirty indicator.

(cherry picked from commit 2e4b3ae05a)
This commit is contained in:
Liam Quin
2018-10-20 11:20:16 +02:00
committed by Michael Natterer
parent b20bb29148
commit 8da246b2a3
2 changed files with 26 additions and 0 deletions

View File

@ -402,6 +402,8 @@ static const gchar display_format_description[] =
"%Cx expands to x if the image is clean, the empty string otherwise\n"
"%B expands to (modified) if the image is dirty, the empty string otherwise\n"
"%A expands to (clean) if the image is clean, the empty string otherwise\n"
"%Nx expands to x if the image is export-dirty, the empty string otherwise\n"
"%Ex expands to x if the image is export-clean, the empty string otherwise\n"
"%l the number of layers\n"
"%L the number of layers (long form)\n"
"%m memory used by the image\n"

View File

@ -295,6 +295,30 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
i += print (title, title_len, i, "%s", _("(clean)"));
break;
case 'N': /* not-exported flag */
if (format[1] == 0)
{
/* format string ends within %E-sequence, print literal '%E' */
i += print (title, title_len, i, "%%N");
break;
}
if (gimp_image_is_export_dirty (image))
title[i++] = format[1];
format++;
break;
case 'E': /* exported flag */
if (format[1] == 0)
{
/* format string ends within %E-sequence, print literal '%E' */
i += print (title, title_len, i, "%%E");
break;
}
if (! gimp_image_is_export_dirty (image))
title[i++] = format[1];
format++;
break;
case 'm': /* memory used by image */
{
GimpObject *object = GIMP_OBJECT (image);