- Timestamp:
- 2015-10-01T21:31:05+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r8811 r8814 26 26 import javax.swing.ImageIcon; 27 27 import javax.swing.JLabel; 28 import javax.swing.JOptionPane; 28 29 import javax.swing.JPanel; 29 30 import javax.swing.JToggleButton; … … 43 44 import org.openstreetmap.josm.gui.ExtendedDialog; 44 45 import org.openstreetmap.josm.gui.MapView; 46 import org.openstreetmap.josm.gui.Notification; 45 47 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; 46 48 import org.openstreetmap.josm.gui.layer.Layer; … … 377 379 378 380 int answer = 1; 379 if (p.getComponentCount() != 0 && (sel.isEmpty() || p.hasElements)) { 381 boolean canCreateRelation = types == null || types.contains(TaggingPresetType.RELATION); 382 if (originalSelectionEmpty && !canCreateRelation) { 383 new Notification( 384 tr("The preset <i>{0}</i> cannot be applied since nothing has been selected!", getLocaleName())) 385 .setIcon(JOptionPane.WARNING_MESSAGE) 386 .show(); 387 return DIALOG_ANSWER_CANCEL; 388 } else if (sel.isEmpty() && !canCreateRelation) { 389 new Notification( 390 tr("The preset <i>{0}</i> cannot be applied since the selection is unsuitable!", getLocaleName())) 391 .setIcon(JOptionPane.WARNING_MESSAGE) 392 .show(); 393 return DIALOG_ANSWER_CANCEL; 394 } else if (p.getComponentCount() != 0 && (sel.isEmpty() || p.hasElements)) { 380 395 String title = trn("Change {0} object", "Change {0} objects", sel.size(), sel.size()); 381 396 if (sel.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.