Subject: [PATCH] Notifications fix
---
Index: src/org/openstreetmap/josm/actions/search/SearchAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/search/SearchAction.java b/src/org/openstreetmap/josm/actions/search/SearchAction.java
--- a/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/actions/search/SearchAction.java	(date 1718872199001)
@@ -315,7 +315,7 @@
                     map.statusLine.setHelpText(msg);
                 }
                 if (!GraphicsEnvironment.isHeadless()) {
-                    new Notification(msg).show();
+                    new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
                 }
             } else {
                 map.statusLine.setHelpText(tr("Found {0} matches", foundMatches));
Index: src/org/openstreetmap/josm/actions/JosmAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/JosmAction.java b/src/org/openstreetmap/josm/actions/JosmAction.java
--- a/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/actions/JosmAction.java	(date 1718872078845)
@@ -536,7 +536,7 @@
                 JOptionPane.YES_OPTION);
         if (!answer && JOptionPane.NO_OPTION == ConditionalOptionPaneUtil.getDialogReturnValue(preferenceKey)) {
             String message = tr("Operation was not performed, as per {0} preference", preferenceKey);
-            new Notification(message).show();
+            new Notification(message).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
             Logging.info(message);
         }
         return answer;
Index: src/org/openstreetmap/josm/actions/OpenFileAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/OpenFileAction.java b/src/org/openstreetmap/josm/actions/OpenFileAction.java
--- a/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/actions/OpenFileAction.java	(date 1718872198993)
@@ -166,7 +166,7 @@
                 } else {
                     String message = tr("Unable to locate file  ''{0}''.", file.getPath());
                     Logging.warn(message);
-                    new Notification(message).show();
+                    new Notification(message).setIcon(JOptionPane.WARNING_MESSAGE).show();
                 }
             }
         }
Index: src/org/openstreetmap/josm/actions/ToggleUploadDiscouragedLayerAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/ToggleUploadDiscouragedLayerAction.java b/src/org/openstreetmap/josm/actions/ToggleUploadDiscouragedLayerAction.java
--- a/src/org/openstreetmap/josm/actions/ToggleUploadDiscouragedLayerAction.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/actions/ToggleUploadDiscouragedLayerAction.java	(date 1718869363898)
@@ -11,6 +11,7 @@
 import javax.swing.AbstractAction;
 import javax.swing.JCheckBoxMenuItem;
 
+import javax.swing.JOptionPane;
 import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -43,7 +44,7 @@
     public void actionPerformed(ActionEvent e) {
         layer.setUploadDiscouraged(!layer.isUploadDiscouraged());
         String msg = layer.isUploadDiscouraged() ? tr("Upload is discouraged") : tr("Upload is encouraged");
-        GuiHelper.runInEDT(() -> new Notification(msg).show());
+        GuiHelper.runInEDT(() -> new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show());
         LayerListDialog.getInstance().repaint();
     }
 
Index: src/org/openstreetmap/josm/actions/UploadAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/UploadAction.java b/src/org/openstreetmap/josm/actions/UploadAction.java
--- a/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/actions/UploadAction.java	(date 1718872264909)
@@ -265,14 +265,16 @@
      */
     public void uploadData(final OsmDataLayer layer, APIDataSet apiData) {
         if (apiData.isEmpty()) {
-            new Notification(tr("No changes to upload.")).show();
+            new Notification(tr("No changes to upload.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
             return;
         }
         checkPreUploadConditionsAsync(layer, apiData, passed -> GuiHelper.runInEDT(() -> {
             if (Boolean.TRUE.equals(passed)) {
                 realUploadData(layer, apiData);
             } else {
-                new Notification(tr("One of the upload verification processes failed")).show();
+                new Notification(tr("One of the upload verification processes failed"))
+                        .setIcon(JOptionPane.WARNING_MESSAGE)
+                        .show();
             }
         }));
     }
@@ -341,7 +343,7 @@
         if (!isEnabled())
             return;
         if (MainApplication.getMap() == null) {
-            new Notification(tr("Nothing to upload. Get some data first.")).show();
+            new Notification(tr("Nothing to upload. Get some data first.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
             return;
         }
         APIDataSet apiData = new APIDataSet(getLayerManager().getEditDataSet());
Index: src/org/openstreetmap/josm/actions/UploadSelectionAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/UploadSelectionAction.java b/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
--- a/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(date 1718872199001)
@@ -13,6 +13,7 @@
 import java.util.Stack;
 import java.util.stream.Collectors;
 
+import javax.swing.JOptionPane;
 import javax.swing.SwingUtilities;
 
 import org.openstreetmap.josm.data.APIDataSet;
@@ -96,7 +97,7 @@
         Collection<OsmPrimitive> modifiedCandidates = getModifiedPrimitives(editLayer.data.getAllSelected());
         Collection<OsmPrimitive> deletedCandidates = getDeletedPrimitives(editLayer.getDataSet());
         if (modifiedCandidates.isEmpty() && deletedCandidates.isEmpty()) {
-            new Notification(tr("No changes to upload.")).show();
+            new Notification(tr("No changes to upload.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
             return;
         }
         UploadSelectionDialog dialog = new UploadSelectionDialog();
@@ -109,7 +110,7 @@
             return;
         Collection<OsmPrimitive> toUpload = new UploadHullBuilder().build(dialog.getSelectedPrimitives());
         if (toUpload.isEmpty()) {
-            new Notification(tr("No changes to upload.")).show();
+            new Notification(tr("No changes to upload.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
             return;
         }
         uploadPrimitives(editLayer, toUpload);
Index: src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java b/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
--- a/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java	(date 1718872116797)
@@ -7,6 +7,7 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
 
+import javax.swing.JOptionPane;
 import org.openstreetmap.josm.actions.mapmode.DrawAction;
 import org.openstreetmap.josm.data.preferences.BooleanProperty;
 import org.openstreetmap.josm.gui.Notification;
@@ -52,7 +53,7 @@
             String msg = isSelected()
                     ? tr("Viewport following is enabled, press {0} to disable it", getShortcut().getKeyText())
                     : tr("Viewport following is disabled");
-            GuiHelper.runInEDT(() -> new Notification(msg).show());
+            GuiHelper.runInEDT(() -> new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show());
         }
         notifySelectedState();
     }
Index: src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
--- a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(date 1718872116817)
@@ -515,7 +515,7 @@
         if (tile != null) {
             try {
                 new Notification(HttpClient.create(new URL(tile.getUrl() + '/' + request))
-                        .connect().fetchContent()).show();
+                        .connect().fetchContent()).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
             } catch (IOException ex) {
                 Logging.error(ex);
             }
Index: src/org/openstreetmap/josm/gui/layer/AutosaveTask.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java b/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java
--- a/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java	(date 1718872198993)
@@ -52,6 +52,7 @@
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -272,8 +273,9 @@
 
     protected void displayNotification() {
         new Notification(tr("Your work has been saved automatically."))
-        .setDuration(Notification.TIME_SHORT)
-        .show();
+                .setIcon(ImageProvider.get("save"))
+                .setDuration(Notification.TIME_SHORT)
+                .show();
     }
 
     @Override
Index: src/org/openstreetmap/josm/gui/MapStatus.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/MapStatus.java b/src/org/openstreetmap/josm/gui/MapStatus.java
--- a/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 19119)
+++ b/src/org/openstreetmap/josm/gui/MapStatus.java	(date 1718869110541)
@@ -49,6 +49,7 @@
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JLabel;
 import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JProgressBar;
@@ -1016,6 +1017,7 @@
         SystemOfMeasurement.setSystemOfMeasurement(som);
         if (Config.getPref().getBoolean("statusbar.notify.change-system-of-measurement", true)) {
             new Notification(tr("System of measurement changed to {0}", som.toString()))
+                .setIcon(JOptionPane.INFORMATION_MESSAGE)
                 .setDuration(Notification.TIME_SHORT)
                 .show();
         }
