Changeset 1189 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2008-12-28T20:02:21+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r1169 r1189 29 29 30 30 import org.openstreetmap.josm.Main; 31 import org.openstreetmap.josm.actions.AboutAction; 31 32 import org.openstreetmap.josm.plugins.PluginException; 32 33 import org.openstreetmap.josm.plugins.PluginProxy; … … 101 102 e.printStackTrace(new PrintWriter(stack)); 102 103 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"); 123 110 } 124 sb.append("\n"+stack.getBuffer().toString());111 text += "\n" + stack.getBuffer().toString(); 125 112 126 113 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()); 130 118 try { 131 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection( sb.toString()), new ClipboardOwner(){119 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(text), new ClipboardOwner(){ 132 120 public void lostOwnership(Clipboard clipboard, Transferable contents) {} 133 121 }); … … 136 124 catch (RuntimeException x) {} 137 125 138 JTextArea info = new JTextArea( sb.toString(), 20, 60);126 JTextArea info = new JTextArea(text, 20, 60); 139 127 info.setCaretPosition(0); 140 128 info.setEditable(false);
Note:
See TracChangeset
for help on using the changeset viewer.