- Timestamp:
- 2021-04-07T20:43:30+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r17298 r17706 37 37 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 38 38 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 39 import org.openstreetmap.josm.gui.util.WindowGeometry; 39 40 import org.openstreetmap.josm.gui.widgets.FileChooserManager; 40 41 import org.openstreetmap.josm.gui.widgets.JosmComboBox; … … 91 92 private final JCheckBox dynamicButtons = new JCheckBox(tr("Dynamic buttons in side menus")); 92 93 private final JCheckBox isoDates = new JCheckBox(tr("Display ISO dates")); 94 private final JCheckBox dialogGeometry = new JCheckBox(tr("Remember dialog geometries")); 93 95 private final JCheckBox nativeFileChoosers = new JCheckBox(tr("Use native file choosers (nicer, but do not support file filters)")); 94 96 private final JCheckBox zoomReverseWheel = new JCheckBox(tr("Reverse zoom with mouse wheel")); … … 182 184 isoDates.setSelected(DateUtils.PROP_ISO_DATES.get()); 183 185 panel.add(isoDates, GBC.eop().insets(20, 0, 0, 0)); 186 187 dialogGeometry.setSelected(WindowGeometry.GUI_GEOMETRY_ENABLED.get()); 188 panel.add(dialogGeometry, GBC.eop().insets(20, 0, 0, 0)); 184 189 185 190 nativeFileChoosers.setToolTipText( … … 234 239 Config.getPref().putBoolean(ToggleDialog.PROP_DYNAMIC_BUTTONS.getKey(), dynamicButtons.isSelected()); 235 240 Config.getPref().putBoolean(DateUtils.PROP_ISO_DATES.getKey(), isoDates.isSelected()); 241 WindowGeometry.GUI_GEOMETRY_ENABLED.put(dialogGeometry.isSelected()); 236 242 Config.getPref().putBoolean(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.getKey(), nativeFileChoosers.isSelected()); 237 243 MapMover.PROP_ZOOM_REVERSE_WHEEL.put(zoomReverseWheel.isSelected()); -
trunk/src/org/openstreetmap/josm/gui/util/WindowGeometry.java
r17705 r17706 21 21 import javax.swing.JComponent; 22 22 23 import org.openstreetmap.josm.data.preferences.BooleanProperty; 23 24 import org.openstreetmap.josm.gui.MainApplication; 24 25 import org.openstreetmap.josm.spi.preferences.Config; … … 39 40 */ 40 41 public static final String PREF_KEY_GUI_GEOMETRY = "gui.geometry"; 42 43 /** 44 * Whether storing/restoring of geometries to/from preferences is enabled 45 */ 46 public static final BooleanProperty GUI_GEOMETRY_ENABLED = new BooleanProperty(PREF_KEY_GUI_GEOMETRY + ".enabled", true); 41 47 42 48 /** the top left point */ … … 214 220 215 221 protected final void initFromPreferences(String preferenceKey) throws WindowGeometryException { 222 if (!GUI_GEOMETRY_ENABLED.get()) { 223 throw new WindowGeometryException("window geometry from preferences is disabled"); 224 } 216 225 String value = Config.getPref().get(preferenceKey); 217 226 if (value.isEmpty())
Note:
See TracChangeset
for help on using the changeset viewer.