Changeset 1847 in josm for trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
- Timestamp:
- 2009-07-25T23:44:19+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r1820 r1847 23 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 24 import org.openstreetmap.josm.gui.ExtendedDialog; 25 import org.openstreetmap.josm.gui.OptionPaneUtil; 25 26 import org.openstreetmap.josm.gui.layer.GpxLayer; 26 27 import org.openstreetmap.josm.gui.layer.Layer; … … 90 91 } 91 92 if (Main.map == null) { 92 JOptionPane.showMessageDialog(Main.parent, tr("No document open so nothing to save.")); 93 JOptionPane.showMessageDialog( 94 Main.parent, 95 tr("No document open so nothing to save."), 96 tr("Warning"), 97 JOptionPane.WARNING_MESSAGE 98 ); 93 99 return false; 94 100 } … … 128 134 dstStream = new FileOutputStream(dst); 129 135 } catch (FileNotFoundException e) { 130 JOptionPane.showMessageDialog(Main.parent, tr("Could not back up file.")+"\n"+e.getMessage()); 136 OptionPaneUtil.showMessageDialog( 137 Main.parent, 138 tr("Could not back up file. Exception is: {0}", e.getMessage()), 139 tr("Error"), 140 JOptionPane.ERROR_MESSAGE 141 ); 131 142 return; 132 143 } … … 192 203 } 193 204 } else { 194 JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension.")); 205 OptionPaneUtil.showMessageDialog( 206 Main.parent, 207 tr("Unknown file extension for file ''{0}''", file.toString()), 208 tr("Error"), 209 JOptionPane.ERROR_MESSAGE 210 ); 195 211 return; 196 212 } … … 198 214 } catch (IOException e) { 199 215 e.printStackTrace(); 200 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while saving.")+"\n"+e.getMessage()); 216 OptionPaneUtil.showMessageDialog( 217 Main.parent, 218 tr("<html>An error occurred while saving. <br>Error is: <br>{0}</html>", e.getMessage()), 219 tr("Error"), 220 JOptionPane.ERROR_MESSAGE 221 ); 201 222 202 223 try { … … 208 229 } catch (IOException e2) { 209 230 e2.printStackTrace(); 210 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e2.getMessage()); 231 OptionPaneUtil.showMessageDialog( 232 Main.parent, 233 tr("<html>An error occurred while restoring backup file.<br> Error is: <br>{0}</html>", e2.getMessage()), 234 tr("Error"), 235 JOptionPane.ERROR_MESSAGE 236 ); 211 237 } 212 238 } … … 235 261 } 236 262 } else { 237 JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension.")); 263 OptionPaneUtil.showMessageDialog( 264 Main.parent, 265 tr("Unknown file extension."), 266 tr("Error"), 267 JOptionPane.ERROR_MESSAGE 268 ); 238 269 return; 239 270 } … … 250 281 } catch (IOException e) { 251 282 e.printStackTrace(); 252 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e.getMessage()); 283 OptionPaneUtil.showMessageDialog( 284 Main.parent, 285 tr("<html>An error occurred while restoring backup file.<br>Error is:<br>{0}</html>", e.getMessage()), 286 tr("Error"), 287 JOptionPane.ERROR_MESSAGE 288 );; 253 289 } 254 290 }
Note:
See TracChangeset
for help on using the changeset viewer.
