X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fdialogs%2FBugReportDialog.java;h=f9001bf2426edb9ee1b8a46784d42cf04ae1b497;hb=bf771f9d4b5215b0036435eb19fc8c813f87c79d;hp=9966dbe50ada1695b4d6f331f5e32d7d6794efcf;hpb=da7a9ff299f7b1529f8ff9cba08e4be3f369937c;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/gui/dialogs/BugReportDialog.java b/src/net/sf/openrocket/gui/dialogs/BugReportDialog.java index 9966dbe5..f9001bf2 100644 --- a/src/net/sf/openrocket/gui/dialogs/BugReportDialog.java +++ b/src/net/sf/openrocket/gui/dialogs/BugReportDialog.java @@ -43,9 +43,9 @@ public class BugReportDialog extends JDialog { 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); @@ -67,7 +67,7 @@ public class BugReportDialog extends JDialog { panel.add(label, "gapleft para, wrap"); //// Otherwise, send the text below to the address: - panel.add(new JLabel(trans.get("bugreport.dlg.otherwise") +" "), + panel.add(new JLabel(trans.get("bugreport.dlg.otherwise") + " "), "gapleft para, split 2, gapright rel"); panel.add(new SelectableLabel(REPORT_EMAIL), "growx, wrap para"); @@ -115,6 +115,13 @@ public class BugReportDialog extends JDialog { @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); @@ -127,7 +134,7 @@ public class BugReportDialog extends JDialog { "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) { @@ -137,9 +144,9 @@ public class BugReportDialog extends JDialog { new Object[] { trans.get("bugreport.dlg.failedmsg1"), ex.getClass().getSimpleName() + ": " + ex.getMessage(), " ", //// Please send the report manually to - trans.get("bugreport.dlg.failedmsg2") +" " + REPORT_EMAIL }, + trans.get("bugreport.dlg.failedmsg2") + " " + REPORT_EMAIL }, //// Error sending report - trans.get("bugreport.dlg.failedmsg3"), JOptionPane.ERROR_MESSAGE); + trans.get("bugreport.dlg.failedmsg3"), JOptionPane.ERROR_MESSAGE); } } }); @@ -197,10 +204,8 @@ public class BugReportDialog extends JDialog { sb.append("---------- End of bug report ----------\n"); sb.append('\n'); - BugReportDialog reportDialog = - new BugReportDialog(parent, - //// You can report a bug in OpenRocket by filling in and submitting the form below.
You can also report bugs and include attachments on the project web site. - trans.get("bugreport.reportDialog.txt"), sb.toString()); + BugReportDialog reportDialog = new BugReportDialog(parent, + trans.get("bugreport.reportDialog.txt"), sb.toString(), false); reportDialog.setVisible(true); } @@ -258,8 +263,8 @@ public class BugReportDialog extends JDialog { sb.append('\n'); BugReportDialog reportDialog = - //// Please include a short description about what you were doing when the exception occurred. - new BugReportDialog(parent, trans.get("bugreport.reportDialog.txt2"), sb.toString()); + //// Please include a short description about what you were doing when the exception occurred. + new BugReportDialog(parent, trans.get("bugreport.reportDialog.txt2"), sb.toString(), true); reportDialog.setVisible(true); }