Changeset 35308 in osm for applications/editors/josm


Ignore:
Timestamp:
2020-01-27T03:34:26+01:00 (5 years ago)
Author:
donvip
Message:

fix #josm18625 - Option to merge cadastre layers in a single final one

Location:
applications/editors/josm/plugins/cadastre-fr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r35186 r35308  
    44    <property name="commit.message" value="Changed constructor for Plugin"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="15419"/>
     6    <property name="plugin.main.version" value="15786"/>
    77   
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/download/CadastreDownloadTask.java

    r35188 r35308  
    2626import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2727import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     28import org.openstreetmap.josm.gui.util.GuiHelper;
    2829import org.openstreetmap.josm.plugins.fr.cadastre.api.CadastreAPI;
     30import org.openstreetmap.josm.spi.preferences.Config;
    2931import org.openstreetmap.josm.tools.Logging;
    3032import org.openstreetmap.josm.tools.Utils;
     
    7678                    Logging.error(e);
    7779                }
     80            }
     81            List<CadastreDataLayer> layers = MainApplication.getLayerManager().getLayersOfType(CadastreDataLayer.class);
     82            if (layers.size() > 1 && Config.getPref().getBoolean("cadastrewms.merge.data.layers")) {
     83                GuiHelper.runInEDT(() -> MainApplication.getMenu().merge.merge(layers));
    7884            }
    7985        });
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/preferences/CadastrePreferenceSetting.java

    r34458 r35308  
    6565
    6666    private JCheckBox dontUseRelation = new JCheckBox(tr("Don''t use relation for addresses (but \"addr:street\" on elements)."));
     67
     68    private JCheckBox mergeDataLayers = new JCheckBox(tr("Merge downloaded cadastre data layers together."));
    6769
    6870    private JRadioButton grabMultiplier1 = new JRadioButton("", true);
     
    374376        dontUseRelation.setToolTipText(tr("Enable this to use the tag \"add:street\" on nodes."));
    375377        cadastrewms.add(dontUseRelation, GBC.eop().insets(0, 0, 0, 0));
     378
     379        // separator
     380        cadastrewms.add(new JSeparator(SwingConstants.HORIZONTAL), GBC.eol().fill(GBC.HORIZONTAL));
     381
     382        // option to merge downloaded data layers
     383        mergeDataLayers.setSelected(Config.getPref().getBoolean("cadastrewms.merge.data.layers", false));
     384        mergeDataLayers.setToolTipText(tr("Merge automatically all cadastre data layers in a single final layer."));
     385        cadastrewms.add(mergeDataLayers, GBC.eop().insets(0, 0, 0, 0));
    376386
    377387        // end of dialog, scroll bar
     
    454464        CacheControl.cacheEnabled = enableCache.isSelected();
    455465        Config.getPref().putBoolean("cadastrewms.addr.dontUseRelation", dontUseRelation.isSelected());
     466        Config.getPref().putBoolean("cadastrewms.merge.data.layers", mergeDataLayers.isSelected());
    456467        CadastrePlugin.refreshConfiguration();
    457468        CadastrePlugin.refreshMenu();
Note: See TracChangeset for help on using the changeset viewer.