Changeset 7918 in josm
- Timestamp:
- 2014-12-31T19:07:38+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java
r7005 r7918 21 21 22 22 /** 23 * The action for editing a relation 23 * The action for editing a relation. 24 24 * @since 5793 25 25 */ … … 36 36 37 37 /** 38 * Returns the set of currently selected relation members for the given relation. 38 * Returns the set of currently selected relation members for the given relation. 39 39 * @param r The relation to inspect 40 40 * @return The set of currently selected relation members for the given relation. … … 61 61 */ 62 62 public static void launchEditor(Relation toEdit) { 63 if (toEdit == null || !Main.isDisplayingMapView()) return;63 if (toEdit == null || toEdit.isDeleted() || !Main.isDisplayingMapView()) return; 64 64 RelationEditor.getEditor(Main.main.getEditLayer(), toEdit, 65 65 getMembersForCurrentSelection(toEdit)).setVisible(true); … … 71 71 if (relations.size() > Main.pref.getInteger("warn.open.maxrelations", 5) && 72 72 /* I18N english text for value 1 makes no real sense, never called for values <= maxrel (usually 5) */ 73 JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(Main.parent, 73 JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(Main.parent, 74 74 "<html>"+trn("You are about to open <b>{0}</b> different relation editor simultaneously.<br/>Do you want to continue?", 75 75 "You are about to open <b>{0}</b> different relation editors simultaneously.<br/>Do you want to continue?", 76 relations.size(), relations.size())+"</html>", 76 relations.size(), relations.size())+"</html>", 77 77 tr("Confirmation"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE)) { 78 78 return; … … 85 85 @Override 86 86 protected void updateEnabledState() { 87 setEnabled( !relations.isEmpty() ); 87 boolean enabled = false; 88 for (Relation r : relations) { 89 if (!r.isDeleted()) { 90 enabled = true; 91 break; 92 } 93 } 94 setEnabled(enabled); 88 95 } 89 96 }
Note:
See TracChangeset
for help on using the changeset viewer.