Ticket #23745: 23745.patch

File 23745.patch, 12.1 KB (added by gaben, 6 months ago)
  • src/org/openstreetmap/josm/actions/search/SearchAction.java

    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  
    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/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 b  
    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

    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  
    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

    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  
    1111import javax.swing.AbstractAction;
    1212import javax.swing.JCheckBoxMenuItem;
    1313
     14import javax.swing.JOptionPane;
    1415import org.openstreetmap.josm.gui.Notification;
    1516import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
    1617import org.openstreetmap.josm.gui.layer.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

    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  
    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    }
     
    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

    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  
    1313import java.util.Stack;
    1414import java.util.stream.Collectors;
    1515
     16import javax.swing.JOptionPane;
    1617import javax.swing.SwingUtilities;
    1718
    1819import org.openstreetmap.josm.data.APIDataSet;
     
    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();
     
    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

    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  
    77import java.awt.event.ActionEvent;
    88import java.awt.event.KeyEvent;
    99
     10import javax.swing.JOptionPane;
    1011import org.openstreetmap.josm.actions.mapmode.DrawAction;
    1112import org.openstreetmap.josm.data.preferences.BooleanProperty;
    1213import org.openstreetmap.josm.gui.Notification;
     
    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/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 b  
    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

    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  
    5252import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    5353import org.openstreetmap.josm.gui.util.GuiHelper;
    5454import org.openstreetmap.josm.spi.preferences.Config;
     55import org.openstreetmap.josm.tools.ImageProvider;
    5556import org.openstreetmap.josm.tools.Logging;
    5657import org.openstreetmap.josm.tools.Utils;
    5758
     
    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
  • 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 b  
    4949import javax.swing.JCheckBoxMenuItem;
    5050import javax.swing.JLabel;
    5151import javax.swing.JMenuItem;
     52import javax.swing.JOptionPane;
    5253import javax.swing.JPanel;
    5354import javax.swing.JPopupMenu;
    5455import javax.swing.JProgressBar;
     
    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        }