Ignore:
Timestamp:
2009-07-28T19:48:39+02:00 (17 years ago)
Author:
Gubaer
Message:

replaced JOptionPane.show* by OptionPaneUtil.show*
ExtendeDialog now always on top, too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r1674 r1865  
    2020
    2121import org.openstreetmap.josm.Main;
    22 import org.openstreetmap.josm.actions.AboutAction;
    2322import org.openstreetmap.josm.actions.ShowStatusReportAction;
     23import org.openstreetmap.josm.gui.OptionPaneUtil;
    2424import org.openstreetmap.josm.plugins.PluginHandler;
    2525
     
    3939            if (e instanceof OutOfMemoryError) {
    4040                // 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. " +
    4242                        "Strange things may happen.\nPlease restart JOSM with the -Xmx###M option,\n" +
    4343                        "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                );
    4548                return;
    4649            }
     
    5053
    5154            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" +
    5457            "version of JOSM, please consider being kind and file a bug report."),
    5558            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) {
    5861                try {
    5962                    StringWriter stack = new StringWriter();
     
    6568                    JPanel p = new JPanel(new GridBagLayout());
    6669                    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());
    7073                    try {
    7174                        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(text), new ClipboardOwner(){
     
    8184                    p.add(new JScrollPane(info), GBC.eop());
    8285
    83                     JOptionPane.showMessageDialog(Main.parent, p);
     86                    OptionPaneUtil.showMessageDialog(Main.parent, p, tr("Warning"), JOptionPane.WARNING_MESSAGE);
    8487                } catch (Exception e1) {
    8588                    e1.printStackTrace();
Note: See TracChangeset for help on using the changeset viewer.