Ignore:
Timestamp:
2014-08-20T03:07:15+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #8885 (see #4614) - add offline mode with new command line argument --offline which can take one of several of these values (comma separated):

  • josm_website: to disable all accesses to JOSM website (when not cached, disables Getting Started page, help, plugin list, styles, imagery, presets, rules)
  • osm_api: to disable all accesses to OSM API (disables download, upload, changeset queries, history, user message notification)
  • all: alias to disable all values. Currently equivalent to "josm_website,osm_api"

Plus improved javadoc, fixed EDT violations, and fixed a bug with HTTP redirection sent without "Location" header

File:
1 edited

Legend:

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

    r7005 r7434  
    4949import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
    5050import org.openstreetmap.josm.io.ChangesetQuery;
     51import org.openstreetmap.josm.io.OnlineResource;
    5152import org.openstreetmap.josm.tools.ImageProvider;
    5253import org.openstreetmap.josm.tools.WindowGeometry;
     
    364365            putValue(SMALL_ICON, ImageProvider.get("dialogs","search"));
    365366            putValue(SHORT_DESCRIPTION, tr("Launch the dialog for querying changesets"));
     367            setEnabled(!Main.isOffline(OnlineResource.OSM_API));
    366368        }
    367369
     
    476478
    477479        protected void updateEnabledState() {
    478             setEnabled(model.hasSelectedChangesets());
     480            setEnabled(model.hasSelectedChangesets() && !Main.isOffline(OnlineResource.OSM_API));
    479481        }
    480482
     
    504506
    505507        protected void updateEnabledState() {
    506             setEnabled(model.hasSelectedChangesets());
     508            setEnabled(model.hasSelectedChangesets() && !Main.isOffline(OnlineResource.OSM_API));
    507509        }
    508510
     
    532534            putValue(SMALL_ICON, ImageProvider.get("dialogs/changeset", "downloadchangeset"));
    533535            putValue(SHORT_DESCRIPTION, tr("Download my changesets from the OSM server (max. 100 changesets)"));
     536            setEnabled(!Main.isOffline(OnlineResource.OSM_API));
    534537        }
    535538
Note: See TracChangeset for help on using the changeset viewer.