Subject: [PATCH] Notifications fix
---
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
|
b
|
|
315 | 315 | map.statusLine.setHelpText(msg); |
316 | 316 | } |
317 | 317 | if (!GraphicsEnvironment.isHeadless()) { |
318 | | new Notification(msg).show(); |
| 318 | new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
319 | 319 | } |
320 | 320 | } else { |
321 | 321 | map.statusLine.setHelpText(tr("Found {0} matches", foundMatches)); |
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
|
b
|
|
536 | 536 | JOptionPane.YES_OPTION); |
537 | 537 | if (!answer && JOptionPane.NO_OPTION == ConditionalOptionPaneUtil.getDialogReturnValue(preferenceKey)) { |
538 | 538 | String message = tr("Operation was not performed, as per {0} preference", preferenceKey); |
539 | | new Notification(message).show(); |
| 539 | new Notification(message).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
540 | 540 | Logging.info(message); |
541 | 541 | } |
542 | 542 | return answer; |
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
|
b
|
|
166 | 166 | } else { |
167 | 167 | String message = tr("Unable to locate file ''{0}''.", file.getPath()); |
168 | 168 | Logging.warn(message); |
169 | | new Notification(message).show(); |
| 169 | new Notification(message).setIcon(JOptionPane.WARNING_MESSAGE).show(); |
170 | 170 | } |
171 | 171 | } |
172 | 172 | } |
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
|
b
|
|
11 | 11 | import javax.swing.AbstractAction; |
12 | 12 | import javax.swing.JCheckBoxMenuItem; |
13 | 13 | |
| 14 | import javax.swing.JOptionPane; |
14 | 15 | import org.openstreetmap.josm.gui.Notification; |
15 | 16 | import org.openstreetmap.josm.gui.dialogs.LayerListDialog; |
16 | 17 | import org.openstreetmap.josm.gui.layer.Layer; |
… |
… |
|
43 | 44 | public void actionPerformed(ActionEvent e) { |
44 | 45 | layer.setUploadDiscouraged(!layer.isUploadDiscouraged()); |
45 | 46 | String msg = layer.isUploadDiscouraged() ? tr("Upload is discouraged") : tr("Upload is encouraged"); |
46 | | GuiHelper.runInEDT(() -> new Notification(msg).show()); |
| 47 | GuiHelper.runInEDT(() -> new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show()); |
47 | 48 | LayerListDialog.getInstance().repaint(); |
48 | 49 | } |
49 | 50 | |
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
|
b
|
|
265 | 265 | */ |
266 | 266 | public void uploadData(final OsmDataLayer layer, APIDataSet apiData) { |
267 | 267 | if (apiData.isEmpty()) { |
268 | | new Notification(tr("No changes to upload.")).show(); |
| 268 | new Notification(tr("No changes to upload.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
269 | 269 | return; |
270 | 270 | } |
271 | 271 | checkPreUploadConditionsAsync(layer, apiData, passed -> GuiHelper.runInEDT(() -> { |
272 | 272 | if (Boolean.TRUE.equals(passed)) { |
273 | 273 | realUploadData(layer, apiData); |
274 | 274 | } else { |
275 | | new Notification(tr("One of the upload verification processes failed")).show(); |
| 275 | new Notification(tr("One of the upload verification processes failed")) |
| 276 | .setIcon(JOptionPane.WARNING_MESSAGE) |
| 277 | .show(); |
276 | 278 | } |
277 | 279 | })); |
278 | 280 | } |
… |
… |
|
341 | 343 | if (!isEnabled()) |
342 | 344 | return; |
343 | 345 | if (MainApplication.getMap() == null) { |
344 | | new Notification(tr("Nothing to upload. Get some data first.")).show(); |
| 346 | new Notification(tr("Nothing to upload. Get some data first.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
345 | 347 | return; |
346 | 348 | } |
347 | 349 | APIDataSet apiData = new APIDataSet(getLayerManager().getEditDataSet()); |
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
|
b
|
|
13 | 13 | import java.util.Stack; |
14 | 14 | import java.util.stream.Collectors; |
15 | 15 | |
| 16 | import javax.swing.JOptionPane; |
16 | 17 | import javax.swing.SwingUtilities; |
17 | 18 | |
18 | 19 | import org.openstreetmap.josm.data.APIDataSet; |
… |
… |
|
96 | 97 | Collection<OsmPrimitive> modifiedCandidates = getModifiedPrimitives(editLayer.data.getAllSelected()); |
97 | 98 | Collection<OsmPrimitive> deletedCandidates = getDeletedPrimitives(editLayer.getDataSet()); |
98 | 99 | if (modifiedCandidates.isEmpty() && deletedCandidates.isEmpty()) { |
99 | | new Notification(tr("No changes to upload.")).show(); |
| 100 | new Notification(tr("No changes to upload.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
100 | 101 | return; |
101 | 102 | } |
102 | 103 | UploadSelectionDialog dialog = new UploadSelectionDialog(); |
… |
… |
|
109 | 110 | return; |
110 | 111 | Collection<OsmPrimitive> toUpload = new UploadHullBuilder().build(dialog.getSelectedPrimitives()); |
111 | 112 | if (toUpload.isEmpty()) { |
112 | | new Notification(tr("No changes to upload.")).show(); |
| 113 | new Notification(tr("No changes to upload.")).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
113 | 114 | return; |
114 | 115 | } |
115 | 116 | uploadPrimitives(editLayer, toUpload); |
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
|
b
|
|
7 | 7 | import java.awt.event.ActionEvent; |
8 | 8 | import java.awt.event.KeyEvent; |
9 | 9 | |
| 10 | import javax.swing.JOptionPane; |
10 | 11 | import org.openstreetmap.josm.actions.mapmode.DrawAction; |
11 | 12 | import org.openstreetmap.josm.data.preferences.BooleanProperty; |
12 | 13 | import org.openstreetmap.josm.gui.Notification; |
… |
… |
|
52 | 53 | String msg = isSelected() |
53 | 54 | ? tr("Viewport following is enabled, press {0} to disable it", getShortcut().getKeyText()) |
54 | 55 | : tr("Viewport following is disabled"); |
55 | | GuiHelper.runInEDT(() -> new Notification(msg).show()); |
| 56 | GuiHelper.runInEDT(() -> new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show()); |
56 | 57 | } |
57 | 58 | notifySelectedState(); |
58 | 59 | } |
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
|
b
|
|
515 | 515 | if (tile != null) { |
516 | 516 | try { |
517 | 517 | new Notification(HttpClient.create(new URL(tile.getUrl() + '/' + request)) |
518 | | .connect().fetchContent()).show(); |
| 518 | .connect().fetchContent()).setIcon(JOptionPane.INFORMATION_MESSAGE).show(); |
519 | 519 | } catch (IOException ex) { |
520 | 520 | Logging.error(ex); |
521 | 521 | } |
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
|
b
|
|
52 | 52 | import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; |
53 | 53 | import org.openstreetmap.josm.gui.util.GuiHelper; |
54 | 54 | import org.openstreetmap.josm.spi.preferences.Config; |
| 55 | import org.openstreetmap.josm.tools.ImageProvider; |
55 | 56 | import org.openstreetmap.josm.tools.Logging; |
56 | 57 | import org.openstreetmap.josm.tools.Utils; |
57 | 58 | |
… |
… |
|
272 | 273 | |
273 | 274 | protected void displayNotification() { |
274 | 275 | new Notification(tr("Your work has been saved automatically.")) |
275 | | .setDuration(Notification.TIME_SHORT) |
276 | | .show(); |
| 276 | .setIcon(ImageProvider.get("save")) |
| 277 | .setDuration(Notification.TIME_SHORT) |
| 278 | .show(); |
277 | 279 | } |
278 | 280 | |
279 | 281 | @Override |
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
|
b
|
|
49 | 49 | import javax.swing.JCheckBoxMenuItem; |
50 | 50 | import javax.swing.JLabel; |
51 | 51 | import javax.swing.JMenuItem; |
| 52 | import javax.swing.JOptionPane; |
52 | 53 | import javax.swing.JPanel; |
53 | 54 | import javax.swing.JPopupMenu; |
54 | 55 | import javax.swing.JProgressBar; |
… |
… |
|
1016 | 1017 | SystemOfMeasurement.setSystemOfMeasurement(som); |
1017 | 1018 | if (Config.getPref().getBoolean("statusbar.notify.change-system-of-measurement", true)) { |
1018 | 1019 | new Notification(tr("System of measurement changed to {0}", som.toString())) |
| 1020 | .setIcon(JOptionPane.INFORMATION_MESSAGE) |
1019 | 1021 | .setDuration(Notification.TIME_SHORT) |
1020 | 1022 | .show(); |
1021 | 1023 | } |