Changeset 693 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2008-07-09T11:40:18+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
r655 r693 20 20 } 21 21 22 protected static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple ) {22 protected static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title) { 23 23 String curDir = Main.pref.get("lastDirectory"); 24 24 if (curDir.equals("")) 25 25 curDir = "."; 26 26 JFileChooser fc = new JFileChooser(new File(curDir)); 27 if(title != null) 28 fc.setDialogTitle(title); 29 27 30 fc.setMultiSelectionEnabled(multiple); 28 31 for (int i = 0; i < ExtensionFileFilter.filters.length; ++i) -
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r627 r693 55 55 } 56 56 57 JFileChooser fc = createAndOpenFileChooser(false, false );57 JFileChooser fc = createAndOpenFileChooser(false, false, null); 58 58 if (fc == null) 59 59 return; -
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r655 r693 46 46 } 47 47 48 private JFrame helpBrowser = new JFrame( "JOSM Online Help");48 private JFrame helpBrowser = new JFrame(tr("JOSM Online Help")); 49 49 private String baseurl = Main.pref.get("help.baseurl", "http://josm.openstreetmap.de"); 50 50 private JEditorPane help = new JEditorPane(); … … 82 82 JPanel buttons = new JPanel(); 83 83 p.add(buttons, BorderLayout.SOUTH); 84 createButton(buttons, "Open in Browser");85 createButton(buttons, "Edit");86 createButton(buttons, "Reload");84 createButton(buttons, tr("Open in Browser")); 85 createButton(buttons, tr("Edit")); 86 createButton(buttons, tr("Reload")); 87 87 88 88 helpBrowser.addWindowListener(new WindowAdapter(){ … … 101 101 102 102 public void actionPerformed(ActionEvent e) { 103 if ( "Open in Browser".equals(e.getActionCommand())) {103 if (tr("Open in Browser").equals(e.getActionCommand())) { 104 104 OpenBrowser.displayUrl(url); 105 } else if ( "Edit".equals(e.getActionCommand())) {105 } else if (tr("Edit").equals(e.getActionCommand())) { 106 106 if (!url.startsWith(baseurl)) { 107 107 JOptionPane.showMessageDialog(Main.parent, tr("Can only edit help pages from JOSM Online Help")); … … 109 109 } 110 110 OpenBrowser.displayUrl(url+"?action=edit"); 111 } else if ( "Reload".equals(e.getActionCommand())) {111 } else if (tr("Reload").equals(e.getActionCommand())) { 112 112 setHelpUrl(url); 113 113 } else if (e.getActionCommand() == null) { … … 166 166 help.read(new StringReader(reader.read(url)), help.getEditorKit().createDefaultDocument()); 167 167 } catch (IOException e) { 168 help.setText( "Error while loading page "+url);168 help.setText(tr("Error while loading page {0}",url)); 169 169 } 170 170 helpBrowser.setVisible(true); -
trunk/src/org/openstreetmap/josm/actions/OpenAction.java
r655 r693 41 41 42 42 public void actionPerformed(ActionEvent e) { 43 JFileChooser fc = createAndOpenFileChooser(true, true );43 JFileChooser fc = createAndOpenFileChooser(true, true, null); 44 44 if (fc == null) 45 45 return; -
trunk/src/org/openstreetmap/josm/actions/SaveAction.java
r655 r693 40 40 } 41 41 } 42 return openFileDialog( );42 return openFileDialog(layer); 43 43 } 44 44 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r655 r693 87 87 } 88 88 89 public static File openFileDialog( ) {90 JFileChooser fc = createAndOpenFileChooser(false, false );89 public static File openFileDialog(Layer layer) { 90 JFileChooser fc = createAndOpenFileChooser(false, false, layer instanceof GpxLayer ? tr("Save GPX file") : tr("Save OSM file")); 91 91 if (fc == null) 92 92 return null; … … 99 99 if (ff instanceof ExtensionFileFilter) 100 100 fn += "." + ((ExtensionFileFilter)ff).defaultExtension; 101 else if (layer instanceof GpxLayer) 102 fn += ".gpx"; 101 103 else 102 104 fn += ".osm"; -
trunk/src/org/openstreetmap/josm/actions/SaveAsAction.java
r627 r693 26 26 27 27 @Override protected File getFile(Layer layer) { 28 return openFileDialog( );28 return openFileDialog(layer); 29 29 } 30 30 }
Note:
See TracChangeset
for help on using the changeset viewer.