[gimp/gimp-2-10] Issue #1371 - Add title printf-like expando for export-clean and export-dirty
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] Issue #1371 - Add title printf-like expando for export-clean and export-dirty
- Date: Sat, 20 Oct 2018 09:26:21 +0000 (UTC)
commit 8da246b2a3be8e973015ede4947cd295307fd0dc
Author: Liam Quin <liam w3 org>
Date: Sat Oct 20 11:20:16 2018 +0200
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]