From 8da246b2a3be8e973015ede4947cd295307fd0dc Mon Sep 17 00:00:00 2001 From: Liam Quin Date: Sat, 20 Oct 2018 11:20:16 +0200 Subject: [PATCH] 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 2e4b3ae05a8d48f2dace1cf01c1595bf1ab97d34) --- app/config/gimpconfig-dump.c | 2 ++ app/display/gimpdisplayshell-title.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/app/config/gimpconfig-dump.c b/app/config/gimpconfig-dump.c index 8858c28a96..eb35746dfe 100644 --- a/app/config/gimpconfig-dump.c +++ b/app/config/gimpconfig-dump.c @@ -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" diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c index 6ea69daa8f..ff356ceb20 100644 --- a/app/display/gimpdisplayshell-title.c +++ b/app/display/gimpdisplayshell-title.c @@ -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);