Ticket #4602: 4602.patch

File 4602.patch, 1.8 KB (added by simon04, 4 years ago)
  • src/org/openstreetmap/josm/actions/PurgeAction.java

    diff --git a/src/org/openstreetmap/josm/actions/PurgeAction.java b/src/org/openstreetmap/josm/actions/PurgeAction.java
    index 3572064..86a38a1 100644
    a b  
    2525import javax.swing.JCheckBox;
    2626import javax.swing.JLabel;
    2727import javax.swing.JList;
     28import javax.swing.JOptionPane;
    2829import javax.swing.JPanel;
    2930import javax.swing.JScrollPane;
    3031import javax.swing.JSeparator;
     
    3637import org.openstreetmap.josm.data.osm.Relation;
    3738import org.openstreetmap.josm.data.osm.RelationMember;
    3839import org.openstreetmap.josm.data.osm.Way;
    39 import org.openstreetmap.josm.gui.ExtendedDialog;
     40import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
    4041import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
    4142import org.openstreetmap.josm.gui.help.HelpUtil;
    4243import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    public void actionPerformed(ActionEvent e) { 
    205206        boolean clearUndoRedo = false;
    206207
    207208        if (!GraphicsEnvironment.isHeadless()) {
    208             ExtendedDialog confirmDlg = new ExtendedDialog(Main.parent, tr("Confirm Purging"),
    209                     new String[] {tr("Purge"), tr("Cancel")});
    210             confirmDlg.setContent(buildPanel(modified), false);
    211             confirmDlg.setButtonIcons(new String[] {"ok", "cancel"});
    212 
    213             int answer = confirmDlg.showDialog().getValue();
    214             if (answer != 1)
     209            final boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
     210                    "purge", Main.parent, buildPanel(modified), tr("Confirm Purging"),
     211                    JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_OPTION);
     212            if (!answer)
    215213                return;
    216214
    217215            clearUndoRedo = cbClearUndoRedo.isSelected();