Changeset 1189 in josm


Ignore:
Timestamp:
2008-12-28T20:02:21+01:00 (16 years ago)
Author:
stoecker
Message:

added plugin information to bug report

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r1179 r1189  
    8686    }
    8787
     88    static public String getTextBlock() {
     89        return revision.getText();
     90    }
     91
    8892    /**
    8993     * Return the number part of the version string.
     
    105109     */
    106110    public static boolean isDevelopmentVersion() {
    107         return version.endsWith(" SVN");
     111        return version.endsWith(" SVN") || version.equals(tr("UNKNOWN"));
    108112    }
    109113
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r1169 r1189  
    159159            }
    160160            e.printStackTrace();
    161             throw new SAXException(tr("An error occoured: {0}",e.getMessage()));
     161            throw new SAXException(tr("An error occurred: {0}",e.getMessage()));
    162162        }
    163163        catch (OsmTransferException e) {
  • trunk/src/org/openstreetmap/josm/plugins/PluginException.java

    r1169 r1189  
    1616
    1717    public PluginException(PluginProxy plugin, String name, Throwable cause) {
    18         super(tr("An error occured in plugin {0}", name), cause);
     18        super(tr("An error occurred in plugin {0}", name), cause);
    1919        this.plugin = plugin;
    2020        this.name = name;
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r1169 r1189  
    2929
    3030import org.openstreetmap.josm.Main;
     31import org.openstreetmap.josm.actions.AboutAction;
    3132import org.openstreetmap.josm.plugins.PluginException;
    3233import org.openstreetmap.josm.plugins.PluginProxy;
     
    101102                    e.printStackTrace(new PrintWriter(stack));
    102103
    103                     URL revUrl = Main.class.getResource("/REVISION");
    104                     StringBuilder sb = new StringBuilder();
    105                     if (revUrl == null) {
    106                         sb.append(tr("Development version. Unknown revision."));
    107                         File f = new File("org/openstreetmap/josm/Main.class");
    108                         if (!f.exists())
    109                             f = new File("bin/org/openstreetmap/josm/Main.class");
    110                         if (!f.exists())
    111                             f = new File("build/org/openstreetmap/josm/Main.class");
    112                         if (f.exists()) {
    113                             DateFormat sdf = SimpleDateFormat.getDateTimeInstance();
    114                             sb.append("\nMain.class build on "+sdf.format(new Date(f.lastModified())));
    115                             sb.append("\n");
    116                         }
    117                     } else {
    118                         BufferedReader in = new BufferedReader(new InputStreamReader(revUrl.openStream()));
    119                         for (String line = in.readLine(); line != null; line = in.readLine()) {
    120                             sb.append(line);
    121                             sb.append('\n');
    122                         }
     104                    String text = AboutAction.getTextBlock();
     105                    String pl = Main.pref.get("plugins");
     106                    if(pl != null && pl.length() != 0)
     107                        text += "Plugins: "+pl+"\n";
     108                    for (final PluginProxy pp : Main.plugins) {
     109                        text += "Plugin " + pp.info.name + (pp.info.version != null && !pp.info.version.equals("") ? " Version: "+pp.info.version+"\n" : "\n");
    123110                    }
    124                     sb.append("\n"+stack.getBuffer().toString());
     111                    text += "\n" + stack.getBuffer().toString();
    125112
    126113                    JPanel p = new JPanel(new GridBagLayout());
    127                     p.add(new JLabel(tr("<html>Please report a ticket at {0}<br>" +
    128                     "Include your steps to get to the error (as detailed as possible)!<br>" +
    129                     "Be sure to include the following information:</html>", "http://josm.openstreetmap.de/newticket")), GBC.eol());
     114                    p.add(new JLabel("<html>" + tr("Please report a ticket at {0}","http://josm.openstreetmap.de/newticket") +
     115                    "<br>" + tr("Include your steps to get to the error (as detailed as possible)!") +
     116                    "<br>" + tr("Try updating to the newest version of JOSM and all plugin before reporting a bug.") +
     117                    "<br>" + tr("Be sure to include the following information:") + "</html>"), GBC.eol());
    130118                    try {
    131                         Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(sb.toString()), new ClipboardOwner(){
     119                        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(text), new ClipboardOwner(){
    132120                            public void lostOwnership(Clipboard clipboard, Transferable contents) {}
    133121                        });
     
    136124                    catch (RuntimeException x) {}
    137125
    138                     JTextArea info = new JTextArea(sb.toString(), 20, 60);
     126                    JTextArea info = new JTextArea(text, 20, 60);
    139127                    info.setCaretPosition(0);
    140128                    info.setEditable(false);
Note: See TracChangeset for help on using the changeset viewer.