Ignore:
Timestamp:
2021-08-24T02:43:50+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #20690 - fix #21240 - Refactoring of UploadDialog, HistoryComboBox and AutoCompletingComboBox (patch by marcello)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java

    r15011 r18173  
    2323import org.openstreetmap.josm.data.projection.ProjectionConfigurationException;
    2424import org.openstreetmap.josm.data.projection.Projections;
    25 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
    2625import org.openstreetmap.josm.gui.ExtendedDialog;
    2726import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator;
     
    2928import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    3029import org.openstreetmap.josm.gui.widgets.JosmTextField;
    31 import org.openstreetmap.josm.spi.preferences.Config;
    3230import org.openstreetmap.josm.tools.GBC;
    3331import org.openstreetmap.josm.tools.ImageProvider;
     
    6462            input = new JosmTextField(30);
    6563            cbInput = new HistoryComboBox();
    66             cbInput.setPrototypeDisplayValue(new AutoCompletionItem("xxxx"));
    6764            cbInput.setEditor(new BasicComboBoxEditor() {
    6865                @Override
     
    7471                    "+proj=lonlat +ellps=WGS84 +datum=WGS84 +bounds=-180,-90,180,90",
    7572                    "+proj=tmerc +lat_0=0 +lon_0=9 +k_0=1 +x_0=3500000 +y_0=0 +ellps=bessel +nadgrids=BETA2007.gsb");
    76             cbInput.setPossibleItemsTopDown(Config.getPref().getList("projection.custom.value.history", samples));
     73            cbInput.getModel().prefs().load("projection.custom.value.history", samples);
    7774            cbInput.setText(initialText == null ? "" : initialText);
    7875
     
    146143        public void rememberHistory() {
    147144            cbInput.addCurrentItemToHistory();
    148             Config.getPref().putList("projection.custom.value.history", cbInput.getHistory());
     145            cbInput.getModel().prefs().save("projection.custom.value.history");
    149146        }
    150147    }
Note: See TracChangeset for help on using the changeset viewer.