Changeset 2047 in josm for trunk/src/org/openstreetmap/josm/Main.java
- Timestamp:
- 2009-09-04T08:31:03+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r2039 r2047 11 11 import java.awt.event.KeyEvent; 12 12 import java.io.File; 13 import java.io.IOException; 13 14 import java.net.URI; 14 15 import java.net.URISyntaxException; … … 30 31 import javax.swing.UIManager; 31 32 33 import org.openstreetmap.josm.actions.OpenFileAction; 32 34 import org.openstreetmap.josm.actions.SaveAction; 33 35 import org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask; … … 412 414 dialog.setVisible(true); 413 415 switch(dialog.getUserAction()) { 414 case CANCEL: return false;415 case PROCEED: return true;416 default: return false;416 case CANCEL: return false; 417 case PROCEED: return true; 418 default: return false; 417 419 } 418 420 } … … 455 457 456 458 switch(ed.getValue()) { 457 case 2: /* discard and exit */ return true;458 case 3: /* cancel */ return false;459 case 2: /* discard and exit */ return true; 460 case 3: /* cancel */ return false; 459 461 } 460 462 boolean savefailed = false; … … 486 488 487 489 if (s.startsWith("file:")) { 490 File f = null; 488 491 try { 489 main.menu.openFile.openFile(new File(new URI(s)));492 f = new File(new URI(s)); 490 493 } catch (URISyntaxException e) { 491 494 JOptionPane.showMessageDialog( … … 496 499 ); 497 500 } 501 try { 502 if (f!=null) { 503 OpenFileAction.openFile(f); 504 } 505 }catch(IOException e) { 506 e.printStackTrace(); 507 JOptionPane.showMessageDialog( 508 Main.parent, 509 tr("<html>Could not read file ''{0}\''.<br> Error is: <br>{1}</html>", f.getName(), e.getMessage()), 510 tr("Error"), 511 JOptionPane.ERROR_MESSAGE 512 ); 513 } 498 514 return; 499 515 } … … 508 524 } 509 525 } 510 511 main.menu.openFile.openFile(new File(s)); 526 File f = new File(s); 527 try { 528 OpenFileAction.openFile(f); 529 }catch(IOException e) { 530 e.printStackTrace(); 531 JOptionPane.showMessageDialog( 532 Main.parent, 533 tr("<html>Could not read file ''{0}\''.<br> Error is: <br>{1}</html>", f.getName(), e.getMessage()), 534 tr("Error"), 535 JOptionPane.ERROR_MESSAGE 536 ); 537 } 512 538 } 513 539
Note:
See TracChangeset
for help on using the changeset viewer.