- Timestamp:
- 2014-01-02T01:23:15+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r6594 r6595 71 71 72 72 /** 73 * Determines whether the key has been marked to be part of a bulk operation (in order to provide a "Do not show again (this operation)" option). 74 * @param prefKey the preference key 75 */ 76 public static boolean isInBulkOperation(final String prefKey) { 77 return immediateActive.contains(prefKey); 78 } 79 80 /** 73 81 * Marks the ending of a bulk operation. Removes the "Do not show again (this operation)" result value. 74 82 * @param prefKey the preference key … … 109 117 if (isYesOrNo(ret)) 110 118 return ret; 111 MessagePanel pnl = new MessagePanel(message, i mmediateActive.contains(preferenceKey));119 MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey)); 112 120 ret = JOptionPane.showOptionDialog(parent, pnl, title, optionType, messageType, null, options, defaultOption); 113 121 if (isYesOrNo(ret)) { … … 152 160 if (isYesOrNo(ret)) 153 161 return ret == trueOption; 154 MessagePanel pnl = new MessagePanel(message, i mmediateActive.contains(preferenceKey));162 MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey)); 155 163 ret = JOptionPane.showConfirmDialog(parent, pnl, title, optionType, messageType); 156 164 if ((isYesOrNo(ret))) { … … 185 193 if (getDialogReturnValue(preferenceKey) == Integer.MAX_VALUE) 186 194 return; 187 MessagePanel pnl = new MessagePanel(message, i mmediateActive.contains(preferenceKey));195 MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey)); 188 196 JOptionPane.showMessageDialog(parent, pnl, title, messageType); 189 197 pnl.getNotShowAgain().store(preferenceKey, Integer.MAX_VALUE); -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r6594 r6595 370 370 371 371 if (toggleable) { 372 togglePanel = new ConditionalOptionPaneUtil.MessagePanel(null, false);372 togglePanel = new ConditionalOptionPaneUtil.MessagePanel(null, ConditionalOptionPaneUtil.isInBulkOperation(togglePref)); 373 373 gc.gridx = icon != null ? 1 : 0; 374 374 gc.gridy = y++; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r6557 r6595 75 75 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; 76 76 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 77 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 77 78 import org.openstreetmap.josm.gui.DefaultNameFormatter; 78 79 import org.openstreetmap.josm.gui.ExtendedDialog; … … 845 846 class DeleteAction extends JosmAction implements ListSelectionListener { 846 847 848 static final String DELETE_FROM_RELATION_PREF = "delete_from_relation"; 849 847 850 public DeleteAction() { 848 851 super(tr("Delete"), "dialogs/delete", tr("Delete the selected key in all objects"), … … 901 904 ed.setButtonIcons(new String[] {"dialogs/delete.png", "cancel.png"}); 902 905 ed.setContent(tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance()))); 903 ed.toggleEnable( "delete_from_relation");906 ed.toggleEnable(DELETE_FROM_RELATION_PREF); 904 907 ed.showDialog(); 905 908 … … 925 928 deleteTags(rows); 926 929 } else if (membershipTable.getSelectedRowCount() > 0) { 930 ConditionalOptionPaneUtil.startBulkOperation(DELETE_FROM_RELATION_PREF); 927 931 int[] rows = membershipTable.getSelectedRows(); 928 // delete from last relation to con vserve row numbers in the table932 // delete from last relation to conserve row numbers in the table 929 933 for (int i=rows.length-1; i>=0; i--) { 930 934 deleteFromRelation(rows[i]); 931 935 } 936 ConditionalOptionPaneUtil.endBulkOperation(DELETE_FROM_RELATION_PREF); 932 937 } 933 938 }
Note:
See TracChangeset
for help on using the changeset viewer.