Ignore:
Timestamp:
2011-06-21T17:16:51+02:00 (14 years ago)
Author:
stoecker
Message:

fix #6414 - downloading incomplete members

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/relation
Files:
2 edited

Legend:

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

    r3530 r4154  
    4141    public DownloadRelationMemberTask(Relation parent, Collection<OsmPrimitive> children, OsmDataLayer curLayer, Dialog dialog) {
    4242        super(tr("Download relation members"), new PleaseWaitProgressMonitor(dialog), false /* don't ignore exception */);
    43         this.parents.add(parent);
     43        if(parent != null)
     44            this.parents.add(parent);
    4445        this.children = children;
    4546        this.curLayer = curLayer;
     
    4849    public DownloadRelationMemberTask(Relation parent, Collection<OsmPrimitive> children, OsmDataLayer curLayer) {
    4950        super(tr("Download relation members"), false /* don't ignore exception */);
    50         this.parents.add(parent);
     51        if(parent != null)
     52            this.parents.add(parent);
    5153        this.children = children;
    5254        this.curLayer = curLayer;
     
    8991
    9092    protected String buildDownloadFeedbackMessage() {
    91         if (parents.size() == 1) {
     93        if (parents.size() == 0) {
     94            return trn("Downloading {0} incomplete object",
     95                    "Downloading {0} incomplete objects",
     96                    children.size(),
     97                    children.size());
     98        } else if (parents.size() == 1) {
    9299            Relation parent = parents.iterator().next();
    93100            return trn("Downloading {0} incomplete child of relation ''{1}''",
     
    95102                    children.size(),
    96103                    children.size(),
    97                     parent.getDisplayName(DefaultNameFormatter.getInstance())
    98             );
    99         } else
     104                    parent.getDisplayName(DefaultNameFormatter.getInstance()));
     105        } else {
    100106            return trn("Downloading {0} incomplete child of {1} parent relations",
    101107                    "Downloading {0} incomplete children of  {1} parent relations",
    102108                    children.size(),
    103109                    children.size(),
    104                     parents.size()
    105             );
     110                    parents.size());
     111        }
    106112    }
    107113
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r4120 r4154  
    13171317
    13181318        protected void updateEnabledState() {
    1319             setEnabled(
    1320                     getRelation() != null
    1321                     && memberTableModel.hasIncompleteMembers()
    1322             );
     1319            setEnabled(memberTableModel.hasIncompleteMembers());
    13231320        }
    13241321
     
    13501347
    13511348        protected void updateEnabledState() {
    1352             setEnabled(
    1353                     getRelation() != null
    1354                     && memberTableModel.hasIncompleteSelectedMembers()
    1355             );
     1349            setEnabled(memberTableModel.hasIncompleteSelectedMembers());
    13561350        }
    13571351
Note: See TracChangeset for help on using the changeset viewer.