Changeset 1648 in josm


Ignore:
Timestamp:
Jun 7, 2009 10:10:06 AM (4 years ago)
Author:
stoecker
Message:

prevent overwriting of GPX files

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java

    r1646 r1648  
    4646            File file = fc.getSelectedFile(); 
    4747            if (file == null || (file.exists() && 1 != 
    48                 new ExtendedDialog(Main.parent,  
    49                         tr("Overwrite"),  
     48                new ExtendedDialog(Main.parent, 
     49                        tr("Overwrite"), 
    5050                        tr("File exists. Overwrite?"), 
    51                         new String[] {tr("Overwrite"), tr("Cancel")},  
     51                        new String[] {tr("Overwrite"), tr("Cancel")}, 
    5252                        new String[] {"save_as.png", "cancel.png"}).getValue())) 
    5353                return null; 
  • trunk/src/org/openstreetmap/josm/actions/SaveAction.java

    r1646 r1648  
    77import java.io.File; 
    88 
     9import org.openstreetmap.josm.Main; 
    910import org.openstreetmap.josm.gui.layer.Layer; 
     11import org.openstreetmap.josm.gui.layer.GpxLayer; 
     12import org.openstreetmap.josm.gui.ExtendedDialog; 
    1013import org.openstreetmap.josm.tools.Shortcut; 
    1114 
     
    2831    @Override public File getFile(Layer layer) { 
    2932        File f = layer.getAssociatedFile(); 
     33        if(f != null && layer instanceof GpxLayer && f.exists() && 1 != 
     34        new ExtendedDialog(Main.parent, tr("Overwrite"), 
     35        tr("File {0} exists. Overwrite?", f.getName()), 
     36        new String[] {tr("Overwrite"), tr("Cancel")}, 
     37        new String[] {"save_as.png", "cancel.png"}).getValue()) 
     38            f = null; 
    3039        return f == null ? openFileDialog(layer) : f; 
    3140    } 
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r1415 r1648  
    7070    private void configureSites() { 
    7171        JPanel p = new JPanel(new GridBagLayout()); 
    72         p.add(new JLabel(tr("Add either site-josm.xml or Wiki Pages.")), GBC.eol()); 
     72        p.add(new JLabel(tr("Add JOSM Plugin description URL.")), GBC.eol()); 
    7373        final DefaultListModel model = new DefaultListModel(); 
    7474        for (String s : PluginDownloader.getSites()) 
     
    7979        buttons.add(new JButton(new AbstractAction(tr("Add")){ 
    8080            public void actionPerformed(ActionEvent e) { 
    81                 String s = JOptionPane.showInputDialog(gui, tr("Add either site-josm.xml or Wiki Pages.")); 
     81                String s = JOptionPane.showInputDialog(gui, tr("Add JOSM Plugin description URL.")); 
    8282                if (s != null) 
    8383                    model.addElement(s); 
     
    9090                    return; 
    9191                } 
    92                 String s = JOptionPane.showInputDialog(gui, tr("Add either site-josm.xml or Wiki Pages."), list.getSelectedValue()); 
     92                String s = JOptionPane.showInputDialog(gui, tr("Edit JOSM Plugin description URL."), list.getSelectedValue()); 
    9393                model.setElementAt(s, list.getSelectedIndex()); 
    9494            } 
Note: See TracChangeset for help on using the changeset viewer.