Ignore:
Timestamp:
2010-02-06T23:41:55+01:00 (14 years ago)
Author:
pieren
Message:

from Clément Ménier, new option allowing an auto-selection of the first cadastre layer for grab

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r19424 r19894  
    9797 *                 - cache management compatible with previous v2 format
    9898 *                 - raster image rotation using shift+ctrl key instead of ctrl
    99  *                 - raster image adjustment using default system menu modifier (ctrl for windows) for Mac support 
     99 *                 - raster image adjustment using default system menu modifier (ctrl for windows) for Mac support
     100 *                 - from Clément Ménier, new option allowing an auto-selection of the first cadastre layer for grab 
    100101 */
    101102public class CadastrePlugin extends Plugin {
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java

    r19288 r19894  
    99
    1010import org.openstreetmap.josm.Main;
    11 import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
    1211import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    1312import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     
    5554    private JRadioButton crosspiece4 = new JRadioButton("100m");
    5655
     56    private JCheckBox autoFirstLayer = new JCheckBox(tr("Automaticly select first WMS layer when grabing if multiple layers exist."));
     57   
    5758    static final int DEFAULT_SQUARE_SIZE = 100;
    5859    private JTextField grabMultiplier4Size = new JTextField(5);
     
    224225        cadastrewms.add(jLabelCacheSize, GBC.std().insets(20, 0, 0, 0));
    225226        cadastrewms.add(cacheSize, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 200, 5));
    226        
     227        // separator
     228        cadastrewms.add(new JSeparator(SwingConstants.HORIZONTAL), GBC.eol().fill(GBC.HORIZONTAL));
     229        autoFirstLayer.setSelected(Main.pref.getBoolean("cadastrewms.autoFirstLayer", false));
     230        autoFirstLayer.setToolTipText(tr("Automatically selects the first WMS layer if multiple layers exist when grabbing."));
     231        cadastrewms.add(autoFirstLayer, GBC.eop().insets(0, 0, 0, 0));
    227232        cadastrewms.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
    228233
     
    271276        } catch (NumberFormatException e) { // ignore the last input
    272277        }
     278        Main.pref.put("cadastrewms.autoFirstLayer", autoFirstLayer.isSelected());
    273279        CacheControl.cacheEnabled = enableCache.isSelected();
    274280        CadastrePlugin.refreshConfiguration();
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java

    r18544 r19894  
    4141            if (existingWMSlayers.size() == 0)
    4242                return new MenuActionNewLocation().addNewLayer(existingWMSlayers);
    43             JOptionPane.showMessageDialog(Main.parent,
    44                     tr("More than one WMS layer present\nSelect one of them first, then retry"));
     43            if (Main.pref.getBoolean("cadastrewms.autoFirstLayer", false)) {
     44                return existingWMSlayers.get(0);
     45            } else {
     46                JOptionPane.showMessageDialog(Main.parent,
     47                        tr("More than one WMS layer present\nSelect one of them first, then retry"));
     48            }
    4549        } else {
    4650            return new MenuActionNewLocation().addNewLayer(existingWMSlayers);
Note: See TracChangeset for help on using the changeset viewer.