source: josm/trunk/src/org/openstreetmap/josm/gui/MainApplication.java@ 10977

Last change on this file since 10977 was 10962, checked in by Don-vip, 8 years ago

improve unit tests

  • Property svn:eol-style set to native
File size: 25.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5import static org.openstreetmap.josm.tools.I18n.trn;
6
7import java.awt.Dimension;
8import java.io.File;
9import java.io.IOException;
10import java.io.InputStream;
11import java.net.Authenticator;
12import java.net.Inet6Address;
13import java.net.InetAddress;
14import java.net.InetSocketAddress;
15import java.net.ProxySelector;
16import java.net.Socket;
17import java.net.URL;
18import java.security.AllPermission;
19import java.security.CodeSource;
20import java.security.GeneralSecurityException;
21import java.security.KeyStoreException;
22import java.security.NoSuchAlgorithmException;
23import java.security.PermissionCollection;
24import java.security.Permissions;
25import java.security.Policy;
26import java.security.cert.CertificateException;
27import java.util.Arrays;
28import java.util.Collection;
29import java.util.List;
30import java.util.Locale;
31import java.util.Optional;
32import java.util.Set;
33import java.util.TreeSet;
34import java.util.logging.Level;
35
36import javax.swing.JOptionPane;
37import javax.swing.RepaintManager;
38import javax.swing.SwingUtilities;
39
40import org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager;
41import org.openstreetmap.josm.Main;
42import org.openstreetmap.josm.actions.PreferencesAction;
43import org.openstreetmap.josm.actions.RestartAction;
44import org.openstreetmap.josm.data.AutosaveTask;
45import org.openstreetmap.josm.data.CustomConfigurator;
46import org.openstreetmap.josm.data.Version;
47import org.openstreetmap.josm.gui.ProgramArguments.Option;
48import org.openstreetmap.josm.gui.SplashScreen.SplashProgressMonitor;
49import org.openstreetmap.josm.gui.download.DownloadDialog;
50import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
51import org.openstreetmap.josm.gui.preferences.server.ProxyPreference;
52import org.openstreetmap.josm.gui.util.GuiHelper;
53import org.openstreetmap.josm.io.CertificateAmendment;
54import org.openstreetmap.josm.io.DefaultProxySelector;
55import org.openstreetmap.josm.io.MessageNotifier;
56import org.openstreetmap.josm.io.OnlineResource;
57import org.openstreetmap.josm.io.auth.CredentialsManager;
58import org.openstreetmap.josm.io.auth.DefaultAuthenticator;
59import org.openstreetmap.josm.io.protocols.data.Handler;
60import org.openstreetmap.josm.io.remotecontrol.RemoteControl;
61import org.openstreetmap.josm.plugins.PluginHandler;
62import org.openstreetmap.josm.plugins.PluginInformation;
63import org.openstreetmap.josm.tools.FontsManager;
64import org.openstreetmap.josm.tools.HttpClient;
65import org.openstreetmap.josm.tools.I18n;
66import org.openstreetmap.josm.tools.Logging;
67import org.openstreetmap.josm.tools.OsmUrlToBounds;
68import org.openstreetmap.josm.tools.PlatformHookWindows;
69import org.openstreetmap.josm.tools.Utils;
70import org.openstreetmap.josm.tools.WindowGeometry;
71import org.openstreetmap.josm.tools.bugreport.BugReport;
72import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
73
74/**
75 * Main window class application.
76 *
77 * @author imi
78 */
79public class MainApplication extends Main {
80
81 private MainFrame mainFrame;
82
83 /**
84 * Constructs a new {@code MainApplication} without a window.
85 */
86 public MainApplication() {
87 // Allow subclassing (see JOSM.java)
88 this(null);
89 }
90
91 /**
92 * Constructs a main frame, ready sized and operating. Does not display the frame.
93 * @param mainFrame The main JFrame of the application
94 * @since 10340
95 */
96 public MainApplication(MainFrame mainFrame) {
97 this.mainFrame = mainFrame;
98 }
99
100 @Override
101 protected void initializeMainWindow() {
102 mainPanel.reAddListeners();
103 if (mainFrame != null) {
104 mainFrame.initialize();
105
106 menu = mainFrame.getMenu();
107 } else {
108 // required for running some tests.
109 menu = new MainMenu();
110 }
111 }
112
113 @Override
114 protected void shutdown() {
115 mainFrame.storeState();
116 super.shutdown();
117 }
118
119 /**
120 * Displays help on the console
121 * @since 2748
122 */
123 public static void showHelp() {
124 // TODO: put in a platformHook for system that have no console by default
125 System.out.println(tr("Java OpenStreetMap Editor")+" ["
126 +Version.getInstance().getAgentString()+"]\n\n"+
127 tr("usage")+":\n"+
128 "\tjava -jar josm.jar <options>...\n\n"+
129 tr("options")+":\n"+
130 "\t--help|-h "+tr("Show this help")+'\n'+
131 "\t--geometry=widthxheight(+|-)x(+|-)y "+tr("Standard unix geometry argument")+'\n'+
132 "\t[--download=]minlat,minlon,maxlat,maxlon "+tr("Download the bounding box")+'\n'+
133 "\t[--download=]<URL> "+tr("Download the location at the URL (with lat=x&lon=y&zoom=z)")+'\n'+
134 "\t[--download=]<filename> "+tr("Open a file (any file type that can be opened with File/Open)")+'\n'+
135 "\t--downloadgps=minlat,minlon,maxlat,maxlon "+tr("Download the bounding box as raw GPS")+'\n'+
136 "\t--downloadgps=<URL> "+tr("Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS")+'\n'+
137 "\t--selection=<searchstring> "+tr("Select with the given search")+'\n'+
138 "\t--[no-]maximize "+tr("Launch in maximized mode")+'\n'+
139 "\t--reset-preferences "+tr("Reset the preferences to default")+"\n\n"+
140 "\t--load-preferences=<url-to-xml> "+tr("Changes preferences according to the XML file")+"\n\n"+
141 "\t--set=<key>=<value> "+tr("Set preference key to value")+"\n\n"+
142 "\t--language=<language> "+tr("Set the language")+"\n\n"+
143 "\t--version "+tr("Displays the JOSM version and exits")+"\n\n"+
144 "\t--debug "+tr("Print debugging messages to console")+"\n\n"+
145 "\t--skip-plugins "+tr("Skip loading plugins")+"\n\n"+
146 "\t--offline=<osm_api|josm_website|all> "+tr("Disable access to the given resource(s), separated by comma")+"\n\n"+
147 tr("options provided as Java system properties")+":\n"+
148 // CHECKSTYLE.OFF: SingleSpaceSeparator
149 "\t-Djosm.pref=" +tr("/PATH/TO/JOSM/PREF ")+tr("Set the preferences directory")+"\n\n"+
150 "\t-Djosm.userdata="+tr("/PATH/TO/JOSM/USERDATA")+tr("Set the user data directory")+"\n\n"+
151 "\t-Djosm.cache=" +tr("/PATH/TO/JOSM/CACHE ")+tr("Set the cache directory")+"\n\n"+
152 "\t-Djosm.home=" +tr("/PATH/TO/JOSM/HOMEDIR ")+
153 // CHECKSTYLE.ON: SingleSpaceSeparator
154 tr("Relocate all 3 directories to homedir. Cache directory will be in homedir/cache")+"\n\n"+
155 tr("-Djosm.home has lower precedence, i.e. the specific setting overrides the general one")+"\n\n"+
156 tr("note: For some tasks, JOSM needs a lot of memory. It can be necessary to add the following\n" +
157 " Java option to specify the maximum size of allocated memory in megabytes")+":\n"+
158 "\t-Xmx...m\n\n"+
159 tr("examples")+":\n"+
160 "\tjava -jar josm.jar track1.gpx track2.gpx london.osm\n"+
161 "\tjava -jar josm.jar "+OsmUrlToBounds.getURL(43.2, 11.1, 13)+'\n'+
162 "\tjava -jar josm.jar london.osm --selection=http://www.ostertag.name/osm/OSM_errors_node-duplicate.xml\n"+
163 "\tjava -jar josm.jar 43.2,11.1,43.4,11.4\n"+
164 "\tjava -Djosm.pref=$XDG_CONFIG_HOME -Djosm.userdata=$XDG_DATA_HOME -Djosm.cache=$XDG_CACHE_HOME -jar josm.jar\n"+
165 "\tjava -Djosm.home=/home/user/.josm_dev -jar josm.jar\n"+
166 "\tjava -Xmx1024m -jar josm.jar\n\n"+
167 tr("Parameters --download, --downloadgps, and --selection are processed in this order.")+'\n'+
168 tr("Make sure you load some data if you use --selection.")+'\n'
169 );
170 }
171
172 /**
173 * Main application Startup
174 * @param argArray Command-line arguments
175 */
176 public static void main(final String[] argArray) {
177 I18n.init();
178
179 // construct argument table
180 ProgramArguments args = null;
181 try {
182 args = new ProgramArguments(argArray);
183 } catch (IllegalArgumentException e) {
184 System.exit(1);
185 return;
186 }
187
188 Level logLevel = args.getLogLevel();
189 Logging.setLogLevel(logLevel);
190 Main.info(tr("Log level is at {0} ({1}, {2})", logLevel.getLocalizedName(), logLevel.getName(), logLevel.intValue()));
191
192 Optional<String> language = args.getSingle(Option.LANGUAGE);
193 I18n.set(language.orElse(null));
194
195 Policy.setPolicy(new Policy() {
196 // Permissions for plug-ins loaded when josm is started via webstart
197 private PermissionCollection pc;
198
199 {
200 pc = new Permissions();
201 pc.add(new AllPermission());
202 }
203
204 @Override
205 public PermissionCollection getPermissions(CodeSource codesource) {
206 return pc;
207 }
208 });
209
210 Thread.setDefaultUncaughtExceptionHandler(new BugReportExceptionHandler());
211
212 // initialize the platform hook, and
213 Main.determinePlatformHook();
214 // call the really early hook before we do anything else
215 Main.platform.preStartupHook();
216
217 Main.COMMAND_LINE_ARGS.addAll(Arrays.asList(argArray));
218
219 if (args.showVersion()) {
220 System.out.println(Version.getInstance().getAgentString());
221 System.exit(0);
222 } else if (args.showHelp()) {
223 showHelp();
224 System.exit(0);
225 }
226
227 boolean skipLoadingPlugins = args.hasOption(Option.SKIP_PLUGINS);
228 if (skipLoadingPlugins) {
229 Main.info(tr("Plugin loading skipped"));
230 }
231
232 if (Logging.isLoggingEnabled(Logging.LEVEL_TRACE)) {
233 // Enable debug in OAuth signpost via system preference, but only at trace level
234 Utils.updateSystemProperty("debug", "true");
235 Main.info(tr("Enabled detailed debug level (trace)"));
236 }
237
238 Main.pref.init(args.hasOption(Option.RESET_PREFERENCES));
239
240 args.getPreferencesToSet().forEach(Main.pref::put);
241
242 if (!language.isPresent()) {
243 I18n.set(Main.pref.get("language", null));
244 }
245 Main.pref.updateSystemProperties();
246
247 checkIPv6();
248
249 // asking for help? show help and exit
250 if (args.hasOption(Option.HELP)) {
251 showHelp();
252 System.exit(0);
253 }
254
255 processOffline(args);
256
257 Main.platform.afterPrefStartupHook();
258
259 FontsManager.initialize();
260
261 I18n.setupLanguageFonts();
262
263 Handler.install();
264
265 WindowGeometry geometry = WindowGeometry.mainWindow("gui.geometry",
266 args.getSingle(Option.GEOMETRY).orElse(null),
267 !args.hasOption(Option.NO_MAXIMIZE) && Main.pref.getBoolean("gui.maximized", false));
268 final MainFrame mainFrame = new MainFrame(contentPanePrivate, mainPanel, geometry);
269 Main.parent = mainFrame;
270
271 if (args.hasOption(Option.LOAD_PREFERENCES)) {
272 CustomConfigurator.XMLCommandProcessor config = new CustomConfigurator.XMLCommandProcessor(Main.pref);
273 for (String i : args.get(Option.LOAD_PREFERENCES)) {
274 info("Reading preferences from " + i);
275 try (InputStream is = HttpClient.create(new URL(i)).connect().getContent()) {
276 config.openAndReadXML(is);
277 } catch (IOException ex) {
278 throw BugReport.intercept(ex).put("file", i);
279 }
280 }
281 }
282
283 try {
284 CertificateAmendment.addMissingCertificates();
285 } catch (IOException | GeneralSecurityException ex) {
286 Main.warn(ex);
287 Main.warn(getErrorMessage(Utils.getRootCause(ex)));
288 }
289 Authenticator.setDefault(DefaultAuthenticator.getInstance());
290 DefaultProxySelector proxySelector = new DefaultProxySelector(ProxySelector.getDefault());
291 ProxySelector.setDefault(proxySelector);
292 OAuthAccessTokenHolder.getInstance().init(Main.pref, CredentialsManager.getInstance());
293
294 final SplashScreen splash = GuiHelper.runInEDTAndWaitAndReturn(SplashScreen::new);
295 final SplashScreen.SplashProgressMonitor monitor = splash.getProgressMonitor();
296 monitor.beginTask(tr("Initializing"));
297 GuiHelper.runInEDT(() -> splash.setVisible(Main.pref.getBoolean("draw.splashscreen", true)));
298 Main.setInitStatusListener(new InitStatusListener() {
299
300 @Override
301 public Object updateStatus(String event) {
302 monitor.beginTask(event);
303 return event;
304 }
305
306 @Override
307 public void finish(Object status) {
308 if (status instanceof String) {
309 monitor.finishTask((String) status);
310 }
311 }
312 });
313
314 Collection<PluginInformation> pluginsToLoad = null;
315
316 if (!skipLoadingPlugins) {
317 pluginsToLoad = updateAndLoadEarlyPlugins(splash, monitor);
318 }
319
320 monitor.indeterminateSubTask(tr("Setting defaults"));
321 preConstructorInit();
322
323 monitor.indeterminateSubTask(tr("Creating main GUI"));
324 final Main main = new MainApplication(mainFrame);
325 main.initialize();
326
327 if (!skipLoadingPlugins) {
328 loadLatePlugins(splash, monitor, pluginsToLoad);
329 }
330
331 // Wait for splash disappearance (fix #9714)
332 GuiHelper.runInEDTAndWait(() -> {
333 splash.setVisible(false);
334 splash.dispose();
335 mainFrame.setVisible(true);
336 });
337
338 Main.MasterWindowListener.setup();
339
340 boolean maximized = Main.pref.getBoolean("gui.maximized", false);
341 if ((!args.hasOption(Option.NO_MAXIMIZE) && maximized) || args.hasOption(Option.MAXIMIZE)) {
342 mainFrame.setMaximized(true);
343 }
344 if (main.menu.fullscreenToggleAction != null) {
345 main.menu.fullscreenToggleAction.initial();
346 }
347
348 SwingUtilities.invokeLater(new GuiFinalizationWorker(args, proxySelector));
349
350 if (Main.isPlatformWindows()) {
351 try {
352 // Check for insecure certificates to remove.
353 // This is Windows-dependant code but it can't go to preStartupHook (need i18n)
354 // neither startupHook (need to be called before remote control)
355 PlatformHookWindows.removeInsecureCertificates();
356 } catch (NoSuchAlgorithmException | CertificateException | KeyStoreException | IOException e) {
357 error(e);
358 }
359 }
360
361 if (RemoteControl.PROP_REMOTECONTROL_ENABLED.get()) {
362 RemoteControl.start();
363 }
364
365 if (MessageNotifier.PROP_NOTIFIER_ENABLED.get()) {
366 MessageNotifier.start();
367 }
368
369 if (Main.pref.getBoolean("debug.edt-checker.enable", Version.getInstance().isLocalBuild())) {
370 // Repaint manager is registered so late for a reason - there is lots of violation during startup process
371 // but they don't seem to break anything and are difficult to fix
372 info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console");
373 RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager());
374 }
375 }
376
377 static Collection<PluginInformation> updateAndLoadEarlyPlugins(SplashScreen splash, SplashProgressMonitor monitor) {
378 Collection<PluginInformation> pluginsToLoad;
379 pluginsToLoad = PluginHandler.buildListOfPluginsToLoad(splash, monitor.createSubTaskMonitor(1, false));
380 if (!pluginsToLoad.isEmpty() && PluginHandler.checkAndConfirmPluginUpdate(splash)) {
381 monitor.subTask(tr("Updating plugins"));
382 pluginsToLoad = PluginHandler.updatePlugins(splash, null, monitor.createSubTaskMonitor(1, false), false);
383 }
384
385 monitor.indeterminateSubTask(tr("Installing updated plugins"));
386 PluginHandler.installDownloadedPlugins(true);
387
388 monitor.indeterminateSubTask(tr("Loading early plugins"));
389 PluginHandler.loadEarlyPlugins(splash, pluginsToLoad, monitor.createSubTaskMonitor(1, false));
390 return pluginsToLoad;
391 }
392
393 static void loadLatePlugins(SplashScreen splash, SplashProgressMonitor monitor, Collection<PluginInformation> pluginsToLoad) {
394 monitor.indeterminateSubTask(tr("Loading plugins"));
395 PluginHandler.loadLatePlugins(splash, pluginsToLoad, monitor.createSubTaskMonitor(1, false));
396 toolbar.refreshToolbarControl();
397 }
398
399 private static void processOffline(ProgramArguments args) {
400 for (String offlineNames : args.get(Option.OFFLINE)) {
401 for (String s : offlineNames.split(",")) {
402 try {
403 Main.setOffline(OnlineResource.valueOf(s.toUpperCase(Locale.ENGLISH)));
404 } catch (IllegalArgumentException e) {
405 Main.error(e, tr("''{0}'' is not a valid value for argument ''{1}''. Possible values are {2}, possibly delimited by commas.",
406 s.toUpperCase(Locale.ENGLISH), Option.OFFLINE.getName(), Arrays.toString(OnlineResource.values())));
407 System.exit(1);
408 return;
409 }
410 }
411 }
412 Set<OnlineResource> offline = Main.getOfflineResources();
413 if (!offline.isEmpty()) {
414 Main.warn(trn("JOSM is running in offline mode. This resource will not be available: {0}",
415 "JOSM is running in offline mode. These resources will not be available: {0}",
416 offline.size(), offline.size() == 1 ? offline.iterator().next() : Arrays.toString(offline.toArray())));
417 }
418 }
419
420 /**
421 * Check if IPv6 can be safely enabled and do so. Because this cannot be done after network activation,
422 * disabling or enabling IPV6 may only be done with next start.
423 */
424 private static void checkIPv6() {
425 if ("auto".equals(Main.pref.get("prefer.ipv6", "auto"))) {
426 new Thread((Runnable) () -> { /* this may take some time (DNS, Connect) */
427 boolean hasv6 = false;
428 boolean wasv6 = Main.pref.getBoolean("validated.ipv6", false);
429 try {
430 /* Use the check result from last run of the software, as after the test, value
431 changes have no effect anymore */
432 if (wasv6) {
433 Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
434 }
435 for (InetAddress a : InetAddress.getAllByName("josm.openstreetmap.de")) {
436 if (a instanceof Inet6Address) {
437 if (a.isReachable(1000)) {
438 /* be sure it REALLY works */
439 Socket s = new Socket();
440 s.connect(new InetSocketAddress(a, 80), 1000);
441 s.close();
442 Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
443 if (!wasv6) {
444 Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4 after next restart."));
445 } else {
446 Main.info(tr("Detected useable IPv6 network, prefering IPv6 over IPv4."));
447 }
448 hasv6 = true;
449 }
450 break; /* we're done */
451 }
452 }
453 } catch (IOException | SecurityException e) {
454 if (Main.isDebugEnabled()) {
455 Main.debug("Exception while checking IPv6 connectivity: "+e);
456 }
457 Main.trace(e);
458 }
459 if (wasv6 && !hasv6) {
460 Main.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart."));
461 Main.pref.put("validated.ipv6", hasv6); // be sure it is stored before the restart!
462 new RestartAction().actionPerformed(null);
463 }
464 Main.pref.put("validated.ipv6", hasv6);
465 }, "IPv6-checker").start();
466 }
467 }
468
469 private static class GuiFinalizationWorker implements Runnable {
470
471 private final ProgramArguments args;
472 private final DefaultProxySelector proxySelector;
473
474 GuiFinalizationWorker(ProgramArguments args, DefaultProxySelector proxySelector) {
475 this.args = args;
476 this.proxySelector = proxySelector;
477 }
478
479 @Override
480 public void run() {
481
482 // Handle proxy/network errors early to inform user he should change settings to be able to use JOSM correctly
483 if (!handleProxyErrors()) {
484 handleNetworkErrors();
485 }
486
487 // Restore autosave layers after crash and start autosave thread
488 handleAutosave();
489
490 // Handle command line instructions
491 postConstructorProcessCmdLine(args);
492
493 // Show download dialog if autostart is enabled
494 DownloadDialog.autostartIfNeeded();
495 }
496
497 private static void handleAutosave() {
498 if (AutosaveTask.PROP_AUTOSAVE_ENABLED.get()) {
499 AutosaveTask autosaveTask = new AutosaveTask();
500 List<File> unsavedLayerFiles = autosaveTask.getUnsavedLayersFiles();
501 if (!unsavedLayerFiles.isEmpty()) {
502 ExtendedDialog dialog = new ExtendedDialog(
503 Main.parent,
504 tr("Unsaved osm data"),
505 new String[] {tr("Restore"), tr("Cancel"), tr("Discard")}
506 );
507 dialog.setContent(
508 trn("JOSM found {0} unsaved osm data layer. ",
509 "JOSM found {0} unsaved osm data layers. ", unsavedLayerFiles.size(), unsavedLayerFiles.size()) +
510 tr("It looks like JOSM crashed last time. Would you like to restore the data?"));
511 dialog.setButtonIcons(new String[] {"ok", "cancel", "dialogs/delete"});
512 int selection = dialog.showDialog().getValue();
513 if (selection == 1) {
514 autosaveTask.recoverUnsavedLayers();
515 } else if (selection == 3) {
516 autosaveTask.discardUnsavedLayers();
517 }
518 }
519 autosaveTask.schedule();
520 }
521 }
522
523 private static boolean handleNetworkOrProxyErrors(boolean hasErrors, String title, String message) {
524 if (hasErrors) {
525 ExtendedDialog ed = new ExtendedDialog(
526 Main.parent, title,
527 new String[]{tr("Change proxy settings"), tr("Cancel")});
528 ed.setButtonIcons(new String[]{"dialogs/settings", "cancel"}).setCancelButton(2);
529 ed.setMinimumSize(new Dimension(460, 260));
530 ed.setIcon(JOptionPane.WARNING_MESSAGE);
531 ed.setContent(message);
532
533 if (ed.showDialog().getValue() == 1) {
534 PreferencesAction.forPreferenceSubTab(null, null, ProxyPreference.class).run();
535 }
536 }
537 return hasErrors;
538 }
539
540 private boolean handleProxyErrors() {
541 return handleNetworkOrProxyErrors(proxySelector.hasErrors(), tr("Proxy errors occurred"),
542 tr("JOSM tried to access the following resources:<br>" +
543 "{0}" +
544 "but <b>failed</b> to do so, because of the following proxy errors:<br>" +
545 "{1}" +
546 "Would you like to change your proxy settings now?",
547 Utils.joinAsHtmlUnorderedList(proxySelector.getErrorResources()),
548 Utils.joinAsHtmlUnorderedList(proxySelector.getErrorMessages())
549 ));
550 }
551
552 private static boolean handleNetworkErrors() {
553 boolean condition = !NETWORK_ERRORS.isEmpty();
554 if (condition) {
555 Set<String> errors = new TreeSet<>();
556 for (Throwable t : NETWORK_ERRORS.values()) {
557 errors.add(t.toString());
558 }
559 return handleNetworkOrProxyErrors(condition, tr("Network errors occurred"),
560 tr("JOSM tried to access the following resources:<br>" +
561 "{0}" +
562 "but <b>failed</b> to do so, because of the following network errors:<br>" +
563 "{1}" +
564 "It may be due to a missing proxy configuration.<br>" +
565 "Would you like to change your proxy settings now?",
566 Utils.joinAsHtmlUnorderedList(NETWORK_ERRORS.keySet()),
567 Utils.joinAsHtmlUnorderedList(errors)
568 ));
569 }
570 return false;
571 }
572 }
573}
Note: See TracBrowser for help on using the repository browser.