Ignore:
Timestamp:
2018-08-12T17:24:32+02:00 (8 years ago)
Author:
Don-vip
Message:

see #15229 - deprecate Main.pref

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r13838 r14149  
    130130            }
    131131        });
    132         readPreferences(Main.pref);
     132        readPreferences(Preferences.main());
    133133
    134134        applyFilter();
     
    181181    private void readPreferences(Preferences tmpPrefs) {
    182182        Map<String, Setting<?>> loaded;
    183         Map<String, Setting<?>> orig = Main.pref.getAllSettings();
     183        Map<String, Setting<?>> orig = Preferences.main().getAllSettings();
    184184        Map<String, Setting<?>> defaults = tmpPrefs.getAllDefaults();
    185185        orig.remove("osm-server.password");
    186186        defaults.remove("osm-server.password");
    187         if (tmpPrefs != Main.pref) {
     187        if (tmpPrefs != Preferences.main()) {
    188188            loaded = tmpPrefs.getAllSettings();
    189189            // plugins preference keys may be changed directly later, after plugins are downloaded
     
    262262            return;
    263263
    264         Preferences tmpPrefs = new Preferences(Main.pref);
     264        Preferences tmpPrefs = new Preferences(Preferences.main());
    265265
    266266        StringBuilder log = new StringBuilder();
     
    324324
    325325        for (Entry<String, String> e: profileTypes.entrySet()) {
    326             menu.add(new ExportProfileAction(Main.pref, e.getKey(), e.getValue()));
     326            menu.add(new ExportProfileAction(Preferences.main(), e.getKey(), e.getValue()));
    327327        }
    328328
     
    339339                        "Are you sure you want to continue?")
    340340                        +"</html>", null, "")) {
    341                     Main.pref.resetToDefault();
     341                    Preferences.main().resetToDefault();
    342342                    try {
    343                         Main.pref.save();
     343                        Preferences.main().save();
    344344                    } catch (IOException | InvalidPathException e) {
    345345                        Logging.log(Logging.LEVEL_WARN, "Exception while saving preferences:", e);
    346346                    }
    347                     readPreferences(Main.pref);
     347                    readPreferences(Preferences.main());
    348348                    applyFilter();
    349349                }
     
    412412        @Override
    413413        public void actionPerformed(ActionEvent ae) {
    414             Preferences tmpPrefs = new Preferences(Main.pref);
     414            Preferences tmpPrefs = new Preferences(Preferences.main());
    415415            CustomConfigurator.readXML(file, tmpPrefs);
    416416            readPreferences(tmpPrefs);
     
    460460        for (PrefEntry e : allData) {
    461461            if (e.isChanged()) {
    462                 Main.pref.putSetting(e.getKey(), e.getValue().getValue() == null ? null : e.getValue());
     462                Preferences.main().putSetting(e.getKey(), e.getValue().getValue() == null ? null : e.getValue());
    463463            }
    464464        }
Note: See TracChangeset for help on using the changeset viewer.