Changeset 35915 in osm for applications/editors


Ignore:
Timestamp:
2022-02-09T19:26:58+01:00 (3 years ago)
Author:
taylor.smock
Message:

buildings_tools: fix #9065, #19348

  • #9065: Add new configuration option to always select new building
  • #19348: Add preference for autoselect setting, which used to be forgotten on

JOSM restart

patch by Woazboat

Location:
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/BuildingSizeDialog.java

    r34968 r35915  
    2222    private final JCheckBox caddr = new JCheckBox(tr("Use Address dialog"));
    2323    private final JCheckBox cAutoSelect = new JCheckBox(tr("Auto-select building"));
     24    private final JCheckBox cAutoSelectReplaceSelection = new JCheckBox(tr("Auto-select replaces existing selection"));
    2425    private final JCheckBox cAddrNode = new JCheckBox(tr("Use address nodes under buildings"));
    2526    private final JRadioButton circleRadio = new JRadioButton(tr("Circle"));
     
    4243        panel.add(caddr, GBC.eol().fill(GBC.HORIZONTAL));
    4344        panel.add(cAutoSelect, GBC.eol().fill(GBC.HORIZONTAL));
     45        panel.add(cAutoSelectReplaceSelection, GBC.eol().fill(GBC.HORIZONTAL));
    4446        panel.add(cAddrNode, GBC.eol().fill(GBC.HORIZONTAL));
    4547
     
    4850        caddr.setSelected(ToolSettings.isUsingAddr());
    4951        cAutoSelect.setSelected(ToolSettings.isAutoSelect());
     52        cAutoSelectReplaceSelection.setSelected(ToolSettings.isAutoSelectReplaceSelection());
    5053        cAddrNode.setSelected(ToolSettings.PROP_USE_ADDR_NODE.get());
    5154
     
    9598        ToolSettings.setAddrDialog(useAddr());
    9699        ToolSettings.setAutoSelect(cAutoSelect.isSelected());
     100        ToolSettings.setAutoSelectReplaceSelection(cAutoSelectReplaceSelection.isSelected());
    97101        ToolSettings.PROP_USE_ADDR_NODE.put(cAddrNode.isSelected());
    98102    }
  • applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/DrawBuildingAction.java

    r35823 r35915  
    351351                    showAddrDialog(w);
    352352                if (ToolSettings.isAutoSelect()
    353                         && (getLayerManager().getEditDataSet().getSelected().isEmpty() || shift)) {
     353                        && (getLayerManager().getEditDataSet().getSelected().isEmpty() || shift ||
     354                            ToolSettings.isAutoSelectReplaceSelection())) {
    354355                    getLayerManager().getEditDataSet().setSelected(w);
    355356                }
  • applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/ToolSettings.java

    r35669 r35915  
    3131    private static boolean useAddr;
    3232    private static final Map<String, String> TAGS = new HashMap<>();
    33     private static boolean autoSelect;
    3433
    3534    public static Shape getShape() {
     
    120119
    121120    public static boolean isAutoSelect() {
    122         return autoSelect;
     121        return Config.getPref().getBoolean("buildings_tools.autoselect", false);
    123122    }
    124123
    125124    public static void setAutoSelect(boolean autoSelect) {
    126         ToolSettings.autoSelect = autoSelect;
     125        Config.getPref().putBoolean("buildings_tools.autoselect", autoSelect);
     126    }
     127
     128    public static boolean isAutoSelectReplaceSelection() {
     129        return Config.getPref().getBoolean("buildings_tools.autoselect_replace_selection", false);
     130    }
     131
     132    public static void setAutoSelectReplaceSelection(boolean autoSelectReplace) {
     133        Config.getPref().putBoolean("buildings_tools.autoselect_replace_selection", autoSelectReplace);
    127134    }
    128135
Note: See TracChangeset for help on using the changeset viewer.