private static final String REPORT_EMAIL = "openrocket-bugs@lists.sourceforge.net";
private static final Translator trans = Application.getTranslator();
-
- public BugReportDialog(Window parent, String labelText, String message) {
+
+ public BugReportDialog(Window parent, String labelText, final String message, final boolean sendIfUnchanged) {
//// Bug report
super(parent, trans.get("bugreport.dlg.title"), Dialog.ModalityType.APPLICATION_MODAL);
//// <html>If connected to the Internet, you can simply click
//// <em>Send bug report</em>.
- label = new JLabel("<html>If connected to the Internet, you can simply click " +
- "<em>Send bug report</em>.");
+ label = new JLabel(trans.get("bugreport.dlg.connectedInternet"));
d = label.getPreferredSize();
d.width = 100000;
label.setMaximumSize(d);
panel.add(label, "gapleft para, wrap");
//// Otherwise, send the text below to the address:
- panel.add(new JLabel("Otherwise, send the text below to the address: "),
+ panel.add(new JLabel(trans.get("bugreport.dlg.otherwise") + " "),
"gapleft para, split 2, gapright rel");
panel.add(new SelectableLabel(REPORT_EMAIL), "growx, wrap para");
panel.add(new JScrollPane(textArea), "grow, wrap");
- panel.add(new StyledLabel("The information above may be included in a public " +
- "bug report. Make sure it does not contain any sensitive information you " +
- "do not want to be made public.", -1), "wrap para");
+ panel.add(new StyledLabel(trans.get("bugreport.lbl.Theinformation"), -1), "wrap para");
@Override
public void actionPerformed(ActionEvent e) {
String text = textArea.getText();
+ if (text.equals(message) && !sendIfUnchanged) {
+ JOptionPane.showMessageDialog(BugReportDialog.this,
+ trans.get("bugreport.dlg.provideDescription"),
+ trans.get("bugreport.dlg.provideDescription.title"), JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+
try {
BugReporter.sendBugReport(text);
"Bug report sent", JOptionPane.INFORMATION_MESSAGE);*/
JOptionPane.showMessageDialog(BugReportDialog.this,
new Object[] { trans.get("bugreport.dlg.successmsg1"),
- trans.get("bugreport.dlg.successmsg2") },
+ trans.get("bugreport.dlg.successmsg2") },
trans.get("bugreport.dlg.successmsg3"), JOptionPane.INFORMATION_MESSAGE);
} catch (Exception ex) {
// Sending the message failed.
JOptionPane.showMessageDialog(BugReportDialog.this,
- new Object[] { "OpenRocket was unable to send the bug report:",
+ //// OpenRocket was unable to send the bug report:
+ new Object[] { trans.get("bugreport.dlg.failedmsg1"),
ex.getClass().getSimpleName() + ": " + ex.getMessage(), " ",
- "Please send the report manually to " + REPORT_EMAIL },
- "Error sending report", JOptionPane.ERROR_MESSAGE);
+ //// Please send the report manually to
+ trans.get("bugreport.dlg.failedmsg2") + " " + REPORT_EMAIL },
+ //// Error sending report
+ trans.get("bugreport.dlg.failedmsg3"), JOptionPane.ERROR_MESSAGE);
}
}
});
sb.append("---------- End of bug report ----------\n");
sb.append('\n');
- BugReportDialog reportDialog =
- new BugReportDialog(parent,
- "<html><b>You can report a bug in OpenRocket by filling in and submitting " +
- "the form below.</b><br>" +
- "You can also report bugs and include attachments on the project " +
- "web site.", sb.toString());
+ BugReportDialog reportDialog = new BugReportDialog(parent,
+ trans.get("bugreport.reportDialog.txt"), sb.toString(), false);
reportDialog.setVisible(true);
}
sb.append('\n');
BugReportDialog reportDialog =
- new BugReportDialog(parent, "<html><b>Please include a short description about " +
- "what you were doing when the exception occurred.</b>", sb.toString());
+ //// <html><b>Please include a short description about what you were doing when the exception occurred.</b>
+ new BugReportDialog(parent, trans.get("bugreport.reportDialog.txt2"), sb.toString(), true);
reportDialog.setVisible(true);
}