From d173ce76541e86358b105de24d09ecc72c34c9dc Mon Sep 17 00:00:00 2001 From: hillp Date: Wed, 16 Jul 2025 13:27:39 -0600 Subject: [PATCH] Added a preference for whether the watermark is enabled by default when you click on an attachment in the olog. --- .../org/phoebus/logbook/olog/ui/AttachmentsViewController.java | 2 +- .../java/org/phoebus/logbook/olog/ui/LogbookUIPreferences.java | 2 ++ .../ui/src/main/resources/log_olog_ui_preferences.properties | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/AttachmentsViewController.java b/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/AttachmentsViewController.java index 476ed70ca9..8290b0dd53 100644 --- a/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/AttachmentsViewController.java +++ b/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/AttachmentsViewController.java @@ -213,7 +213,7 @@ else if(attachments.isEmpty()){ */ private void showImageAttachment() { URI uri = selectedAttachment.get().getFile().toURI(); - URI withWatermark = URI.create(uri + "?watermark=true"); + URI withWatermark = URI.create(uri + "?watermark=" + LogbookUIPreferences.show_log_watermark); ApplicationLauncherService.openResource(withWatermark, false, null); } diff --git a/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/LogbookUIPreferences.java b/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/LogbookUIPreferences.java index eec1525442..344f6819b0 100644 --- a/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/LogbookUIPreferences.java +++ b/app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/LogbookUIPreferences.java @@ -47,6 +47,8 @@ public class LogbookUIPreferences { public static int query_list_size; @Preference public static String search_help; + @Preference + public static boolean show_log_watermark; static { diff --git a/app/logbook/olog/ui/src/main/resources/log_olog_ui_preferences.properties b/app/logbook/olog/ui/src/main/resources/log_olog_ui_preferences.properties index 55bd93601f..937392d288 100644 --- a/app/logbook/olog/ui/src/main/resources/log_olog_ui_preferences.properties +++ b/app/logbook/olog/ui/src/main/resources/log_olog_ui_preferences.properties @@ -59,3 +59,6 @@ query_list_size=15 # Name of the search help content. Language resolution and file extension is handled on service. search_help=SearchHelp + +# Whether or not to show the watermark by default +show_log_watermark=true \ No newline at end of file