Ignore:
Timestamp:
2018-05-18T19:25:09+02:00 (7 years ago)
Author:
nzara
Message:

Block uploading of imported layers

Location:
applications/editors/josm/plugins/pdfimport/src/pdfimport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java

    r34189 r34201  
    5050import org.openstreetmap.josm.data.osm.Node;
    5151import org.openstreetmap.josm.data.osm.OsmPrimitive;
     52import org.openstreetmap.josm.data.osm.UploadPolicy;
    5253import org.openstreetmap.josm.gui.MainApplication;
    5354import org.openstreetmap.josm.gui.SideButton;
     
    570571                        data = loadPDF(newFileName, monitor.createSubTaskMonitor(500, false));
    571572                        OsmBuilder.Mode mode = LoadPdfDialog.this.debugModeCheck.isSelected() ? OsmBuilder.Mode.Debug : OsmBuilder.Mode.Draft;
     573//                        OsmBuilder.Mode mode = Logging.isDebugEnabled() ? OsmBuilder.Mode.Debug : OsmBuilder.Mode.Draft;
    572574
    573575                        if (data != null) {
    574576                            LoadPdfDialog.this.newLayer = LoadPdfDialog.this.makeLayer(
    575                                     tr("PDF file preview"), new FilePlacement(), mode, monitor.createSubTaskMonitor(500, false));
     577                                    tr("PDF preview: ") + newFileName.getName(), new FilePlacement(), mode, monitor.createSubTaskMonitor(500, false));
    576578                        }
    577579
     
    632634                        SwingRenderingProgressMonitor monitor = new SwingRenderingProgressMonitor(progressRenderer);
    633635                        LoadPdfDialog.this.newLayer = LoadPdfDialog.this.makeLayer(
    634                                 tr("Imported PDF: ") + pdfFile, placement, OsmBuilder.Mode.Final, monitor);
     636                                tr("PDF: ") + pdfFile.getName(), placement, OsmBuilder.Mode.Final, monitor);
    635637                        progressRenderer.finish();
    636638                    }
     
    738740        //get PDF file to load
    739741        if (loadChooser == null) {
    740                 loadChooser = new JFileChooser(Config.getPref().get("plugins.pdfimport.loadDir"));
     742                loadChooser = new JFileChooser(Config.getPref().get("pdfimport.loadDir"));
    741743                loadChooser.setAcceptAllFileFilterUsed(false);
    742744                loadChooser.setMultiSelectionEnabled(false);
     
    10561058        monitor.setCustomText(tr("Postprocessing layer"));
    10571059        OsmDataLayer result = new OsmDataLayer(data, name, null);
     1060        data.setUploadPolicy(UploadPolicy.BLOCKED);
     1061        result.setUploadDiscouraged(true);
     1062        result.setBackgroundLayer(true);
    10581063        result.onPostLoadFromFile();
    10591064
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/PdfImportPlugin.java

    r33569 r34201  
    11// License: GPL. For details, see LICENSE file.
    22package pdfimport;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import org.openstreetmap.josm.gui.MainApplication;
     
    1412public class PdfImportPlugin extends Plugin {
    1513
    16     protected String name;
    17 
    1814    public PdfImportPlugin(PluginInformation info) {
    1915        super(info);
    20         name = tr("Import PDF file");
    2116        MainMenu.add(MainApplication.getMenu().imagerySubMenu, new PdfImportAction());
    2217    }
Note: See TracChangeset for help on using the changeset viewer.