- Timestamp:
- 2020-05-16T21:25:54+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
r15251 r16427 105 105 int interval = PROP_INTERVAL.get(); 106 106 if (NetworkManager.isOffline(OnlineResource.OSM_API)) { 107 Logging.info( tr("{0} not available (offline mode)",tr("Message notifier")));107 Logging.info(OfflineAccessException.forResource(tr("Message notifier")).getMessage()); 108 108 } else if (!isRunning() && interval > 0 && isUserEnoughIdentified()) { 109 109 task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, interval, TimeUnit.MINUTES); -
trunk/src/org/openstreetmap/josm/io/OfflineAccessException.java
r7937 r16427 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.io; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 /** … … 15 17 super(s); 16 18 } 19 20 /** 21 * Returns a new OfflineAccessException with a translated message for the given resource 22 * @param name the translated name/description of the resource 23 * @return a new OfflineAccessException 24 */ 25 public static OfflineAccessException forResource(String name) { 26 return new OfflineAccessException(tr("{0} not available (offline mode)", name)); 27 } 17 28 } -
trunk/src/org/openstreetmap/josm/io/OnlineResource.java
r16426 r16427 69 69 public final void checkOfflineAccess(String downloadString, String ignore) { 70 70 if (NetworkManager.isOffline(downloadString)) { 71 throw newOfflineAccessException(tr("Unable to access ''{0}'': {1} not available (offline mode)",downloadString, getLocName()));71 throw OfflineAccessException.forResource(downloadString); 72 72 } 73 73 } -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r16426 r16427 256 256 if (capabilities == null) { 257 257 if (NetworkManager.isOffline(OnlineResource.OSM_API)) { 258 Logging.warn( tr("{0} not available (offline mode)", tr("OSM API")));258 Logging.warn(OfflineAccessException.forResource(tr("")).getMessage()); 259 259 } else { 260 260 Logging.error(tr("Unable to initialize OSM API.")); -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r16426 r16427 158 158 try { 159 159 if (NetworkManager.isOffline(urlStr)) { 160 throw new OsmApiException( newOfflineAccessException(tr("{0} not available (offline mode)", urlStr)));160 throw new OsmApiException(OfflineAccessException.forResource(urlStr)); 161 161 } 162 162 -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r16426 r16427 67 67 import org.openstreetmap.josm.gui.widgets.JosmTextArea; 68 68 import org.openstreetmap.josm.io.NetworkManager; 69 import org.openstreetmap.josm.io.OfflineAccessException; 69 70 import org.openstreetmap.josm.spi.preferences.Config; 70 71 import org.openstreetmap.josm.tools.Destroyable; … … 435 436 public static boolean checkAndConfirmPluginUpdate(Component parent) { 436 437 if (Preferences.main().getPluginSites().stream().anyMatch(NetworkManager::isOffline)) { 437 Logging.info( tr("{0} not available (offline mode)",tr("Plugin update")));438 Logging.info(OfflineAccessException.forResource(tr("Plugin update")).getMessage()); 438 439 return false; 439 440 }
Note:
See TracChangeset
for help on using the changeset viewer.