Changeset 15147 in josm


Ignore:
Timestamp:
2019-05-30T23:26:43+02:00 (5 months ago)
Author:
Don-vip
Message:

see #17744 - register JMapViewer SettingsAdapter so that the Bing API key can be set using jmapviewer.bing.api-key

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainInitialization.java

    r14480 r15147  
    1313
    1414import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
     15import org.openstreetmap.gui.jmapviewer.FeatureAdapter.SettingsAdapter;
    1516import org.openstreetmap.josm.data.UndoRedoHandler;
    1617import org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager;
     
    144145                FeatureAdapter.registerTranslationAdapter(I18n::tr);
    145146                FeatureAdapter.registerLoggingAdapter(name -> Logging.getLogger());
     147                FeatureAdapter.registerSettingsAdapter(new JosmSettingsAdapter());
    146148                // UI update
    147149                MainApplication.toolbar.refreshToolbarControl();
     
    151153        );
    152154    }
     155
     156    private static class JosmSettingsAdapter implements SettingsAdapter {
     157
     158        @Override
     159        public String get(String key, String def) {
     160            return Config.getPref().get(key, def);
     161        }
     162
     163        @Override
     164        public boolean put(String key, String value) {
     165            return Config.getPref().put(key, value);
     166        }
     167    }
    153168}
Note: See TracChangeset for help on using the changeset viewer.