Skip to content

Commit da7de91

Browse files
author
stoecker
committed
fix #23745 - add more icons, patch by gaben
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19122 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent a3c8bd4 commit da7de91

10 files changed

+22
-13
lines changed

src/org/openstreetmap/josm/actions/JosmAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ private static boolean showConfirmOutlyingOperationDialog(String preferenceKey,
536536
JOptionPane.YES_OPTION);
537537
if (!answer && JOptionPane.NO_OPTION == ConditionalOptionPaneUtil.getDialogReturnValue(preferenceKey)) {
538538
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();
540540
Logging.info(message);
541541
}
542542
return answer;

src/org/openstreetmap/josm/actions/OpenFileAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public OpenFileTask(final List<File> files, final FileFilter fileFilter, final S
166166
} else {
167167
String message = tr("Unable to locate file ''{0}''.", file.getPath());
168168
Logging.warn(message);
169-
new Notification(message).show();
169+
new Notification(message).setIcon(JOptionPane.WARNING_MESSAGE).show();
170170
}
171171
}
172172
}

src/org/openstreetmap/josm/actions/ToggleUploadDiscouragedLayerAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import javax.swing.AbstractAction;
1212
import javax.swing.JCheckBoxMenuItem;
1313

14+
import javax.swing.JOptionPane;
1415
import org.openstreetmap.josm.gui.Notification;
1516
import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
1617
import org.openstreetmap.josm.gui.layer.Layer;
@@ -43,7 +44,7 @@ public ToggleUploadDiscouragedLayerAction(OsmDataLayer layer) {
4344
public void actionPerformed(ActionEvent e) {
4445
layer.setUploadDiscouraged(!layer.isUploadDiscouraged());
4546
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());
4748
LayerListDialog.getInstance().repaint();
4849
}
4950

src/org/openstreetmap/josm/actions/UploadAction.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,16 @@ private static Future<Boolean> checkPreUploadConditionsAsync(AbstractModifiableL
265265
*/
266266
public void uploadData(final OsmDataLayer layer, APIDataSet apiData) {
267267
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();
269269
return;
270270
}
271271
checkPreUploadConditionsAsync(layer, apiData, passed -> GuiHelper.runInEDT(() -> {
272272
if (Boolean.TRUE.equals(passed)) {
273273
realUploadData(layer, apiData);
274274
} 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();
276278
}
277279
}));
278280
}
@@ -341,7 +343,7 @@ public void actionPerformed(ActionEvent e) {
341343
if (!isEnabled())
342344
return;
343345
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();
345347
return;
346348
}
347349
APIDataSet apiData = new APIDataSet(getLayerManager().getEditDataSet());

src/org/openstreetmap/josm/actions/UploadSelectionAction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.util.Stack;
1414
import java.util.stream.Collectors;
1515

16+
import javax.swing.JOptionPane;
1617
import javax.swing.SwingUtilities;
1718

1819
import org.openstreetmap.josm.data.APIDataSet;
@@ -96,7 +97,7 @@ public void actionPerformed(ActionEvent e) {
9697
Collection<OsmPrimitive> modifiedCandidates = getModifiedPrimitives(editLayer.data.getAllSelected());
9798
Collection<OsmPrimitive> deletedCandidates = getDeletedPrimitives(editLayer.getDataSet());
9899
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();
100101
return;
101102
}
102103
UploadSelectionDialog dialog = new UploadSelectionDialog();
@@ -109,7 +110,7 @@ public void actionPerformed(ActionEvent e) {
109110
return;
110111
Collection<OsmPrimitive> toUpload = new UploadHullBuilder().build(dialog.getSelectedPrimitives());
111112
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();
113114
return;
114115
}
115116
uploadPrimitives(editLayer, toUpload);

src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.awt.event.ActionEvent;
88
import java.awt.event.KeyEvent;
99

10+
import javax.swing.JOptionPane;
1011
import org.openstreetmap.josm.actions.mapmode.DrawAction;
1112
import org.openstreetmap.josm.data.preferences.BooleanProperty;
1213
import org.openstreetmap.josm.gui.Notification;
@@ -52,7 +53,7 @@ public void actionPerformed(ActionEvent e) {
5253
String msg = isSelected()
5354
? tr("Viewport following is enabled, press {0} to disable it", getShortcut().getKeyText())
5455
: tr("Viewport following is disabled");
55-
GuiHelper.runInEDT(() -> new Notification(msg).show());
56+
GuiHelper.runInEDT(() -> new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show());
5657
}
5758
notifySelectedState();
5859
}

src/org/openstreetmap/josm/actions/search/SearchAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public void receiveSearchResult(OsmData<?, ?, ?, ?> ds, Collection<IPrimitive> r
315315
map.statusLine.setHelpText(msg);
316316
}
317317
if (!GraphicsEnvironment.isHeadless()) {
318-
new Notification(msg).show();
318+
new Notification(msg).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
319319
}
320320
} else {
321321
map.statusLine.setHelpText(tr("Found {0} matches", foundMatches));

src/org/openstreetmap/josm/gui/MapStatus.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import javax.swing.JCheckBoxMenuItem;
5050
import javax.swing.JLabel;
5151
import javax.swing.JMenuItem;
52+
import javax.swing.JOptionPane;
5253
import javax.swing.JPanel;
5354
import javax.swing.JPopupMenu;
5455
import javax.swing.JProgressBar;
@@ -1016,6 +1017,7 @@ public void updateSystemOfMeasurement(SystemOfMeasurement som) {
10161017
SystemOfMeasurement.setSystemOfMeasurement(som);
10171018
if (Config.getPref().getBoolean("statusbar.notify.change-system-of-measurement", true)) {
10181019
new Notification(tr("System of measurement changed to {0}", som.toString()))
1020+
.setIcon(JOptionPane.INFORMATION_MESSAGE)
10191021
.setDuration(Notification.TIME_SHORT)
10201022
.show();
10211023
}

src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ private static void sendOsmTileRequest(Tile tile, String request) {
515515
if (tile != null) {
516516
try {
517517
new Notification(HttpClient.create(new URL(tile.getUrl() + '/' + request))
518-
.connect().fetchContent()).show();
518+
.connect().fetchContent()).setIcon(JOptionPane.INFORMATION_MESSAGE).show();
519519
} catch (IOException ex) {
520520
Logging.error(ex);
521521
}

src/org/openstreetmap/josm/gui/layer/AutosaveTask.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
5353
import org.openstreetmap.josm.gui.util.GuiHelper;
5454
import org.openstreetmap.josm.spi.preferences.Config;
55+
import org.openstreetmap.josm.tools.ImageProvider;
5556
import org.openstreetmap.josm.tools.Logging;
5657
import org.openstreetmap.josm.tools.Utils;
5758

@@ -272,8 +273,9 @@ public void run() {
272273

273274
protected void displayNotification() {
274275
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();
277279
}
278280

279281
@Override

0 commit comments

Comments
 (0)