Ignore:
Timestamp:
06.02.2010 09:37:48 (2 years ago)
Author:
jttt
Message:

Improvements in conflicts gui

File:
1 edited

Legend:

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

    r2930 r2945  
    137137     */ 
    138138    private final void resolve() { 
    139         if (conflicts == null) return; 
    140         if (conflicts.size() == 1) { 
    141             lstConflicts.setSelectedIndex(0); 
    142         } 
    143  
    144         if (lstConflicts.getSelectedIndex() == -1) 
    145             return; 
    146  
    147         int [] selectedRows = lstConflicts.getSelectedIndices(); 
    148         if (selectedRows == null || selectedRows.length == 0) 
    149             return; 
    150         int row = selectedRows[0]; 
    151         Conflict<?> c = conflicts.get(row); 
     139        if (conflicts == null || model.getSize() == 0) return; 
     140 
     141        int index = lstConflicts.getSelectedIndex(); 
     142        if (index < 0) { 
     143            index = 0; 
     144        } 
     145 
     146        Conflict<?> c = conflicts.get(index); 
    152147        OsmPrimitive my = c.getMy(); 
    153148        OsmPrimitive their = c.getTheir(); 
     
    155150        dialog.getConflictResolver().populate(my, their); 
    156151        dialog.setVisible(true); 
     152 
     153        lstConflicts.setSelectedIndex(index); 
     154 
    157155        Main.map.mapView.repaint(); 
    158156    } 
Note: See TracChangeset for help on using the changeset viewer.