Ignore:
Timestamp:
2012-08-20T01:11:45+02:00 (14 years ago)
Author:
Don-vip
Message:

fix #2961 - Improve usability of WMS Layer Saving/Loading

  • Replaced the unconventional method of creating a blank layer, then loading a .wms file to a standard File->Open approach
  • Fixed memory leaks with some actions registered as listeners but never destroyed
  • Layer interface modified to allow a generic approach of layer saving in SaveActionBase rather than the previous one restricted to OSM and GPX data
  • FileImporters and FileExporters can now be enabled/disabled at runtime, for example when the active layer changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r5450 r5459  
    6363import org.openstreetmap.josm.actions.DiskAccessAction;
    6464import org.openstreetmap.josm.actions.RenameLayerAction;
     65import org.openstreetmap.josm.actions.SaveActionBase;
    6566import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTaskList;
    6667import org.openstreetmap.josm.data.Bounds;
     
    9798import org.openstreetmap.josm.gui.widgets.JFileChooserManager;
    9899import org.openstreetmap.josm.gui.widgets.JosmComboBox;
     100import org.openstreetmap.josm.io.GpxImporter;
    99101import org.openstreetmap.josm.io.JpgImporter;
    100102import org.openstreetmap.josm.io.OsmTransferException;
     
    20422044        }
    20432045    }
     2046
     2047    @Override
     2048    public boolean isSavable() {
     2049        return true; // With GpxExporter
     2050    }
     2051
     2052    @Override
     2053    public boolean checkSaveConditions() {
     2054        return data != null;
     2055    }
     2056
     2057    @Override
     2058    public File createAndOpenSaveFileChooser() {
     2059        return SaveActionBase.createAndOpenSaveFileChooser(tr("Save GPX file"), GpxImporter.FILE_FILTER);
     2060    }
    20442061}
Note: See TracChangeset for help on using the changeset viewer.