- Timestamp:
- 2011-04-16T17:21:43+02:00 (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/User.java
r4026 r4031 33 33 private static HashMap<Long,User> userMap = new HashMap<Long,User>(); 34 34 private static HashSet<Long> relicensingUsers = null; 35 private static HashSet<Long> nonRelicensingUsers = null; 35 36 36 37 private static long getNextLocalUid() { … … 111 112 112 113 public static void initRelicensingInformation() { 113 if (relicensingUsers == null) {114 if (relicensingUsers == null) { 114 115 loadRelicensingInformation(false); 115 116 } … … 118 119 public static void loadRelicensingInformation(boolean clean) { 119 120 relicensingUsers = new HashSet<Long>(); 121 nonRelicensingUsers = new HashSet<Long>(); 120 122 try { 121 MirroredInputStream stream = new MirroredInputStream(Main.pref.get("url.licensechange", 122 "http://planet.openstreetmap.org/users_agreed/users_agreed.txt"), clean ? 1 : 7200); 123 MirroredInputStream stream = new MirroredInputStream( 124 Main.pref.get("url.licensechange", 125 "http://planet.openstreetmap.org/users_agreed/users_agreed.txt"), 126 clean ? 1 : 7200); 123 127 try { 124 128 InputStreamReader r; … … 129 133 if (line.startsWith("#")) continue; 130 134 try { 131 relicensingUsers.add(new Long(Long.parseLong(line.trim()))); 135 Long id = new Long(Long.parseLong(line.trim())); 136 relicensingUsers.add(id); 137 } catch (java.lang.NumberFormatException ex) { 138 } 139 } 140 } 141 finally { 142 stream.close(); 143 } 144 } catch (IOException ex) { 145 } 146 147 try { 148 MirroredInputStream stream = new MirroredInputStream( 149 Main.pref.get("url.licensechange_reject", 150 "http://planet.openstreetmap.org/users_agreed/users_disagreed.txt"), 151 clean ? 1 : 7200); 152 try { 153 InputStreamReader r; 154 r = new InputStreamReader(stream); 155 BufferedReader reader = new BufferedReader(r); 156 String line; 157 while ((line = reader.readLine()) != null) { 158 if (line.startsWith("#")) continue; 159 try { 160 Long id = new Long(Long.parseLong(line.trim())); 161 nonRelicensingUsers.add(id); 132 162 } catch (java.lang.NumberFormatException ex) { 133 163 } … … 156 186 if (uid >= 286582) return STATUS_AUTO_AGREED; 157 187 if (relicensingUsers == null) return STATUS_UNKNOWN; 158 return (relicensingUsers.contains(new Long(uid)) ? STATUS_AGREED : STATUS_NOT_AGREED); 188 Long id = new Long(uid); 189 if (relicensingUsers.contains(id)) return STATUS_AGREED; 190 if (nonRelicensingUsers.contains(id)) return STATUS_NOT_AGREED; 191 return STATUS_UNKNOWN; 159 192 } 160 193 -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r4026 r4031 339 339 private ArrayList<UserInfo> data; 340 340 private ImageIcon greenCheckmark; 341 private ImageIcon greyCheckmark; 342 private ImageIcon redX; 341 343 342 344 public UserTableModel() { … … 344 346 data = new ArrayList<UserInfo>(); 345 347 greenCheckmark = ImageProvider.get("misc", "green_check.png"); 348 greyCheckmark = ImageProvider.get("misc", "grey_check.png"); 349 redX = ImageProvider.get("misc", "red_x.png"); 346 350 } 347 351 … … 385 389 case 2: /* percent */ return NumberFormat.getPercentInstance().format(info.percent); 386 390 case 3: /* relicensing status */ 387 if (info.getRelicensingStatus() == User.STATUS_AGREED) return greenCheckmark; 388 if (info.getRelicensingStatus() == User.STATUS_AUTO_AGREED) return greenCheckmark; 389 return null; 391 switch(info.getRelicensingStatus()) { 392 case User.STATUS_AGREED: return greenCheckmark; 393 case User.STATUS_AUTO_AGREED: return greyCheckmark; 394 case User.STATUS_NOT_AGREED: return redX; 395 default: return null; 396 } 390 397 } 391 398 return null;
Note:
See TracChangeset
for help on using the changeset viewer.