Changeset 1446 in josm for trunk/src/org


Ignore:
Timestamp:
2009-02-25T16:09:21+01:00 (16 years ago)
Author:
stoecker
Message:

fixed #2236 - editing membership of untagged ways. patch by singularita

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r1415 r1446  
    719719        }
    720720
    721         boolean hasTags = !newSelection.isEmpty() && propertyData.getRowCount() > 0;
    722         boolean hasSelection = !newSelection.isEmpty();
    723         btnAdd.setEnabled(hasSelection);
    724         btnEdit.setEnabled(hasTags);
    725         btnDel.setEnabled(hasTags);
    726         propertyTable.setVisible(hasSelection);
    727         propertyTable.getTableHeader().setVisible(hasSelection);
    728         selectSth.setVisible(!hasSelection);
    729         if(hasTags) propertyTable.changeSelection(0, 0, false, false);
    730 
    731         checkPresets(nodes, ways, relations, closedways);
    732 
    733721        // re-load membership data
    734722        // this is rather expensive since we have to walk through all members of all existing relationships.
     
    760748        membershipTable.setVisible(membershipData.getRowCount() > 0);
    761749
     750        boolean hasSelection = !newSelection.isEmpty();
     751        boolean hasTags = hasSelection && propertyData.getRowCount() > 0;
     752        boolean hasMemberships = hasSelection && membershipData.getRowCount() > 0;
     753        btnAdd.setEnabled(hasSelection);
     754        btnEdit.setEnabled(hasTags || hasMemberships);
     755        btnDel.setEnabled(hasTags || hasMemberships);
     756        propertyTable.setVisible(hasSelection);
     757        propertyTable.getTableHeader().setVisible(hasSelection);
     758        selectSth.setVisible(!hasSelection);
     759        if(hasTags) propertyTable.changeSelection(0, 0, false, false);
     760        else if(hasMemberships) membershipTable.changeSelection(0, 0, false, false);
     761
     762        checkPresets(nodes, ways, relations, closedways);
     763
    762764        if(propertyData.getRowCount() != 0 || membershipData.getRowCount() != 0) {
    763765            setTitle(tr("Properties: {0} / Memberships: {1}",
Note: See TracChangeset for help on using the changeset viewer.