Changeset 2523 in josm
- Timestamp:
- 2009-11-27T22:30:40+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r2522 r2523 108 108 if (!getDialogShowingEnabled(preferenceKey)) 109 109 return DIALOG_DISABLED_OPTION; 110 MessagePanel pnl = new MessagePanel( preferenceKey, message);110 MessagePanel pnl = new MessagePanel(false, message); 111 111 int ret = JOptionPane.showOptionDialog(parent, pnl, title, optionType, messageType, null,options,defaultOption); 112 112 … … 147 147 */ 148 148 static public boolean showConfirmationDialog(String preferenceKey, Component parent, Object message, String title, int optionType, int messageType, int trueOption) throws HeadlessException { 149 if (!getDialogShowingEnabled(preferenceKey) && (getDialogReturnValue(preferenceKey) >= 0)) 149 boolean donotshow = getDialogShowingEnabled(preferenceKey); 150 if (donotshow && (getDialogReturnValue(preferenceKey) >= 0)) 150 151 return getDialogReturnValue(preferenceKey) == trueOption; 151 MessagePanel pnl = new MessagePanel( preferenceKey, message);152 MessagePanel pnl = new MessagePanel(donotshow, message); 152 153 int ret = JOptionPane.showConfirmDialog(parent, pnl, title, optionType, messageType); 153 154 if ((ret >= 0) && !pnl.getDialogShowingEnabled()) { … … 179 180 if (!getDialogShowingEnabled(preferenceKey)) 180 181 return; 181 MessagePanel pnl = new MessagePanel( preferenceKey, message);182 MessagePanel pnl = new MessagePanel(false, message); 182 183 JOptionPane.showMessageDialog(parent, pnl, title, messageType); 183 184 if(!pnl.getDialogShowingEnabled()) … … 194 195 private static class MessagePanel extends JPanel { 195 196 JCheckBox cbShowDialog; 196 String preferenceKey; 197 198 public MessagePanel(String preferenceKey, Object message) { 199 this.preferenceKey = preferenceKey; 197 198 public MessagePanel(boolean donotshow, Object message) { 200 199 cbShowDialog = new JCheckBox(tr("Do not show again")); 201 cbShowDialog.setSelected( !ConditionalOptionPaneUtil.getDialogShowingEnabled(preferenceKey));200 cbShowDialog.setSelected(donotshow); 202 201 setLayout(new GridBagLayout()); 203 202
Note:
See TracChangeset
for help on using the changeset viewer.