Changeset 1865 in josm for trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
- Timestamp:
- 2009-07-28T19:48:39+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r1674 r1865 20 20 21 21 import org.openstreetmap.josm.Main; 22 import org.openstreetmap.josm.actions.AboutAction;23 22 import org.openstreetmap.josm.actions.ShowStatusReportAction; 23 import org.openstreetmap.josm.gui.OptionPaneUtil; 24 24 import org.openstreetmap.josm.plugins.PluginHandler; 25 25 … … 39 39 if (e instanceof OutOfMemoryError) { 40 40 // do not translate the string, as translation may raise an exception 41 JOptionPane.showMessageDialog(Main.parent, "JOSM is out of memory. " +41 OptionPaneUtil.showMessageDialog(Main.parent, "JOSM is out of memory. " + 42 42 "Strange things may happen.\nPlease restart JOSM with the -Xmx###M option,\n" + 43 43 "where ### is the the number of MB assigned to JOSM (e.g. 256).\n" + 44 "Currently, " + Runtime.getRuntime().maxMemory()/1024/1024 + " MB are available to JOSM."); 44 "Currently, " + Runtime.getRuntime().maxMemory()/1024/1024 + " MB are available to JOSM.", 45 tr("Error"), 46 JOptionPane.ERROR_MESSAGE 47 ); 45 48 return; 46 49 } … … 50 53 51 54 Object[] options = new String[]{tr("Do nothing"), tr("Report Bug")}; 52 int answer = JOptionPane.showOptionDialog(Main.parent, tr("An unexpected exception occurred.\n\n" +53 "This is always a coding error. If you are running the latest\n" + 55 int answer = OptionPaneUtil.showOptionDialog(Main.parent, tr("An unexpected exception occurred.\n\n" + 56 "This is always a coding error. If you are running the latest\n" + 54 57 "version of JOSM, please consider being kind and file a bug report."), 55 58 tr("Unexpected Exception"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, 56 null,options, options[0]);57 if (answer == 1) {59 options, options[0]); 60 if (answer == JOptionPane.YES_OPTION) { 58 61 try { 59 62 StringWriter stack = new StringWriter(); … … 65 68 JPanel p = new JPanel(new GridBagLayout()); 66 69 p.add(new JLabel("<html>" + tr("Please report a ticket at {0}","http://josm.openstreetmap.de/newticket") + 67 "<br>" + tr("Include your steps to get to the error (as detailed as possible)!") + 68 "<br>" + tr("Try updating to the newest version of JOSM and all plugins before reporting a bug.") + 69 "<br>" + tr("Be sure to include the following information:") + "</html>"), GBC.eol()); 70 "<br>" + tr("Include your steps to get to the error (as detailed as possible)!") + 71 "<br>" + tr("Try updating to the newest version of JOSM and all plugins before reporting a bug.") + 72 "<br>" + tr("Be sure to include the following information:") + "</html>"), GBC.eol()); 70 73 try { 71 74 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(text), new ClipboardOwner(){ … … 81 84 p.add(new JScrollPane(info), GBC.eop()); 82 85 83 JOptionPane.showMessageDialog(Main.parent, p);86 OptionPaneUtil.showMessageDialog(Main.parent, p, tr("Warning"), JOptionPane.WARNING_MESSAGE); 84 87 } catch (Exception e1) { 85 88 e1.printStackTrace();
Note:
See TracChangeset
for help on using the changeset viewer.
