Ignore:
Timestamp:
2008-09-22T03:53:47+02:00 (16 years ago)
Author:
framm
Message:
  • display a confirmation request if user tries to delete data outside downloaded area (can be don't-show-again'd). Note this feature is not a hard measure but needs to be actively requested by the component making the deletion, so it is possible that plugins deleting data do not honour this. Also, this currently only affects deleting, not otherwise modifying stuff outside of the box.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/DontShowAgainInfo.java

    r745 r1004  
    1717
    1818        public static boolean show(String prefKey, String msg) {
    19                 return show(prefKey, new JLabel(msg), true);
     19                return show(prefKey, new JLabel(msg), true, JOptionPane.OK_CANCEL_OPTION, JOptionPane.OK_OPTION);
    2020        }
    2121
    2222        public static boolean show(String prefKey, String msg, Boolean state) {
    23                 return show(prefKey, new JLabel(msg), state);
     23                return show(prefKey, new JLabel(msg), state, JOptionPane.OK_CANCEL_OPTION, JOptionPane.OK_OPTION);
    2424        }
    2525
    2626        public static boolean show(String prefKey, Container msg) {
    27                 return show(prefKey, msg, true);
     27                return show(prefKey, msg, true, JOptionPane.OK_CANCEL_OPTION, JOptionPane.OK_OPTION);
    2828        }
    2929
    30         public static boolean show(String prefKey, Container msg, Boolean state) {
     30        public static boolean show(String prefKey, Container msg, Boolean state, int options, int true_option) {
    3131                if (!Main.pref.getBoolean("message."+prefKey)) {
    3232                        JCheckBox dontshowagain = new JCheckBox(tr("Do not show again"));
     
    3535                        all.add(msg, GBC.eop());
    3636                        all.add(dontshowagain, GBC.eol());
    37                         int answer = JOptionPane.showConfirmDialog(Main.parent, all, tr("Information"), JOptionPane.OK_CANCEL_OPTION);
    38                         if (answer != JOptionPane.OK_OPTION)
     37                        int answer = JOptionPane.showConfirmDialog(Main.parent, all, tr("Information"), options);
     38                        if (answer != true_option)
    3939                                return false;
    4040                        Main.pref.put("message."+prefKey, dontshowagain.isSelected());
Note: See TracChangeset for help on using the changeset viewer.