Changeset 18999 in josm for trunk/src/org


Ignore:
Timestamp:
2024-02-26T15:00:15+01:00 (9 months ago)
Author:
taylor.smock
Message:

See #23355: Ensure that the dialog has read the preference key for the sanity check

File:
1 edited

Legend:

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

    r18998 r18999  
    425425        ed.setDefaultButton(1).setCancelButton(1);
    426426        // Check if the dialog has not already been permanently hidden by user
    427         if (!ed.toggleEnable("sanityCheckFailed").toggleCheckState() || !canContinue) {
    428             final String content = Arrays.stream(message).collect(Collectors.joining("</li><li>",
    429                     "<html><body><ul><li>", "</li></ul></body></html>"));
    430             final JTextPane textField = new JTextPane();
    431             textField.setContentType("text/html");
    432             textField.setText(content);
    433             TextContextualPopupMenu.enableMenuFor(textField, true);
    434             ed.setMinimumSize(new Dimension(480, 300));
    435             ed.setIcon(JOptionPane.WARNING_MESSAGE);
    436             ed.setContent(textField);
    437             ed.showDialog();
    438         }
     427        ed.toggleEnable("sanityCheckFailed");
     428        final String content = Arrays.stream(message).collect(Collectors.joining("</li><li>",
     429                 "<html><body><ul><li>", "</li></ul></body></html>"));
     430        final JTextPane textField = new JTextPane();
     431        textField.setContentType("text/html");
     432        textField.setText(content);
     433        TextContextualPopupMenu.enableMenuFor(textField, true);
     434        ed.setMinimumSize(new Dimension(480, 300));
     435        ed.setIcon(JOptionPane.WARNING_MESSAGE);
     436        ed.setContent(textField);
     437        ed.showDialog(); // This won't show the dialog if the user has previously saved their response
    439438        if (!canContinue || ed.getValue() <= 1) { // 0 == cancel (we want to stop) and 1 == stop
    440439            // Never store cancel/stop -- this would otherwise lead to the user never seeing the window again, and JOSM just stopping.
Note: See TracChangeset for help on using the changeset viewer.