- Timestamp:
- 2021-03-23T23:31:58+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r17651 r17652 32 32 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener; 33 33 import org.openstreetmap.josm.gui.preferences.SourceEditor; 34 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 34 35 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader; 35 36 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 36 37 import org.openstreetmap.josm.spi.preferences.Config; 37 38 import org.openstreetmap.josm.tools.GBC; 39 import org.openstreetmap.josm.tools.ImageProvider; 38 40 import org.openstreetmap.josm.tools.Logging; 39 41 import org.openstreetmap.josm.tools.Utils; … … 153 155 154 156 private SourceEditor sources; 157 private JCheckBox useValidator; 155 158 private JCheckBox sortMenu; 156 159 … … 170 173 @Override 171 174 public void addGui(PreferenceTabbedPane gui) { 175 useValidator = new JCheckBox(tr("Run data validator on user input"), TaggingPreset.USE_VALIDATOR.get()); 172 176 sortMenu = new JCheckBox(tr("Sort presets menu alphabetically"), TaggingPresets.SORT_MENU.get()); 173 177 174 178 final JPanel panel = new JPanel(new GridBagLayout()); 175 179 panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 176 panel.add(sortMenu, GBC.eol().insets(5, 5, 5, 0)); 180 181 panel.add(useValidator, GBC.std().insets(5, 5, 0, 0)); 182 panel.add(new JLabel(ImageProvider.get("dialogs/validator")), GBC.eol().insets(5, 5, 0, 0)); 183 panel.add(sortMenu, GBC.eol().insets(5, 0, 5, 0)); 184 177 185 sources = new TaggingPresetSourceEditor(); 178 186 panel.add(sources, GBC.eol().fill(GBC.BOTH)); … … 246 254 @Override 247 255 public boolean ok() { 248 if (sources.finish() || TaggingPresets.SORT_MENU.put(sortMenu.getSelectedObjects() != null)) { 256 TaggingPreset.USE_VALIDATOR.put(useValidator.isSelected()); 257 if (sources.finish() || TaggingPresets.SORT_MENU.put(sortMenu.isSelected())) { 249 258 TaggingPresets.destroy(); 250 259 TaggingPresets.initialize();
Note:
See TracChangeset
for help on using the changeset viewer.