Ignore:
Timestamp:
2014-02-25T00:13:55+01:00 (11 years ago)
Author:
donvip
Message:

[josm_opendata] various stuff

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/OdPlugin.java

    r30211 r30303  
    145145                                JMenuItem handlerItem = null;
    146146                                if (dataURL != null) {
    147                                     handlerItem = endMenu.add(new DownloadDataAction(module.getDisplayedName()+"_"+handlerName, dataURL));
     147                                    handlerItem = endMenu.add(new DownloadDataAction(module, handlerName, dataURL));
    148148                                } else if (dataURLs != null) {
    149149                                        JMenu handlerMenu = new JMenu(handlerName);
     
    151151                                        for (Pair<String, URL> pair : dataURLs) {
    152152                                                if (pair != null && pair.a != null && pair.b != null) {
    153                                                         item = handlerMenu.add(new DownloadDataAction(pair.a, pair.b));
     153                                                        item = handlerMenu.add(new DownloadDataAction(module, pair.a, pair.b));
    154154                                                }
    155155                                        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/actions/DownloadDataAction.java

    r28050 r30303  
    2323import org.openstreetmap.josm.Main;
    2424import org.openstreetmap.josm.actions.JosmAction;
     25import org.openstreetmap.josm.plugins.opendata.core.modules.Module;
    2526import org.openstreetmap.josm.tools.CheckParameterUtil;
    2627
     
    2930        private final URL url;
    3031       
    31         public DownloadDataAction(String name, URL url) {
     32        public DownloadDataAction(Module module, String name, URL url) {
    3233                super(false);
    3334                CheckParameterUtil.ensureParameterNotNull(name, "name");
    3435                CheckParameterUtil.ensureParameterNotNull(url, "url");
    3536                putValue(Action.NAME, name);
    36                 putValue("toolbar", "opendata_download_"+name.toLowerCase().replace(" ", "_"));
     37                putValue("toolbar", ("opendata_download_"+module.getDisplayedName()+"_"+name).toLowerCase().replace(" ", "_"));
    3738                this.url = url;
    3839        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipImporter.java

    r28696 r30303  
    1616package org.openstreetmap.josm.plugins.opendata.core.io.archive;
    1717
     18import java.io.File;
    1819import java.io.InputStream;
    1920
     
    3839                }
    3940        }
     41
     42    @Override
     43    public boolean acceptFile(File pathname) {
     44        return super.acceptFile(pathname) && !pathname.getName().endsWith(".osm.zip");
     45    }
    4046}
Note: See TracChangeset for help on using the changeset viewer.