Changeset 16464 in josm


Ignore:
Timestamp:
2020-05-19T09:39:22+02:00 (3 weeks ago)
Author:
GerdP
Message:

see #17270: apply warn.open.maxhistory only on not-new objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java

    r16438 r16464  
    228228     */
    229229    public void showHistory(Component parent, final Collection<? extends PrimitiveId> primitives) {
    230         if (primitives.size() > Config.getPref().getInt("warn.open.maxhistory", 5) &&
    231                 /* I18N english text for value 1 makes no real sense, never called for values <= maxhistory (usually 5) */
    232                 JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(MainApplication.getMainFrame(),
    233                         "<html>" + trn(
    234                                 "You are about to open <b>{0}</b> history dialog.<br/>Do you want to continue?",
    235                                 "You are about to open <b>{0}</b> different history dialogs simultaneously.<br/>Do you want to continue?",
    236                                 primitives.size(), primitives.size()) + "</html>",
    237                         tr("Confirmation"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE)) {
    238             return;
    239         }
    240 
    241230        final List<PrimitiveId> realPrimitives = new ArrayList<>(primitives);
    242231        hooks.forEach(h -> h.modifyRequestedIds(realPrimitives));
     
    248237                    tr("Warning"),
    249238                    JOptionPane.WARNING_MESSAGE);
     239            return;
     240        }
     241        if (notNewPrimitives.size() > Config.getPref().getInt("warn.open.maxhistory", 5) &&
     242                /* I18N english text for value 1 makes no real sense, never called for values <= maxhistory (usually 5) */
     243                JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(MainApplication.getMainFrame(),
     244                        "<html>" + trn(
     245                                "You are about to open <b>{0}</b> history dialog.<br/>Do you want to continue?",
     246                                "You are about to open <b>{0}</b> different history dialogs simultaneously.<br/>Do you want to continue?",
     247                                notNewPrimitives.size(), notNewPrimitives.size()) + "</html>",
     248                        tr("Confirmation"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE)) {
    250249            return;
    251250        }
Note: See TracChangeset for help on using the changeset viewer.