Changeset 2042 in josm
- Timestamp:
- 2009-09-03T19:02:18+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r2034 r2042 11 11 import java.awt.event.MouseAdapter; 12 12 import java.awt.event.MouseEvent; 13 import java.io.UnsupportedEncodingException; 14 import java.net.URLEncoder; 13 15 import java.text.NumberFormat; 14 16 import java.util.ArrayList; … … 24 26 25 27 import javax.swing.AbstractAction; 28 import javax.swing.JOptionPane; 26 29 import javax.swing.JPanel; 27 30 import javax.swing.JScrollPane; … … 185 188 Iterator<User> it = users.iterator(); 186 189 while(it.hasNext() && num > 0) { 187 launchBrowser(createInfoUrl(it.next())); 190 String url = createInfoUrl(it.next()); 191 if (url == null) { 192 break; 193 } 194 launchBrowser(url); 188 195 num--; 189 196 } … … 193 200 protected String createInfoUrl(Object infoObject) { 194 201 User user = (User)infoObject; 195 return getBaseUserUrl() + "/" + user.name; 202 try { 203 return getBaseUserUrl() + "/" + URLEncoder.encode(user.name, "UTF-8"); 204 } catch(UnsupportedEncodingException e) { 205 e.printStackTrace(); 206 JOptionPane.showMessageDialog( 207 Main.parent, 208 tr("<html>Failed to create an URL because the encoding ''{0}'' was<br>" 209 + "was missing on this system.</html>", "UTF-8"), 210 tr("Missing encoding"), 211 JOptionPane.ERROR_MESSAGE 212 ); 213 return null; 214 } 196 215 } 197 216
Note:
See TracChangeset
for help on using the changeset viewer.