|
@@ -63,12 +63,14 @@ public final class FatalErrorDialog extends JDialog implements ActionListener,
|
63
|
63
|
|
64
|
64
|
/** Serialisation version ID. */
|
65
|
65
|
private static final long serialVersionUID = 3;
|
66
|
|
- /** Do we need to restart? Else we quit. */
|
67
|
|
- private boolean restart = true;
|
68
|
66
|
/** Fatal error to be shown in this dialog. */
|
69
|
67
|
private final ProgramError error;
|
70
|
68
|
/** Error manager to report the error to. */
|
71
|
69
|
private final ErrorManager errorManager;
|
|
70
|
+ /** Countdown latch. */
|
|
71
|
+ private final CountDownLatch countDownLatch;
|
|
72
|
+ /** Are we auto sending errors? */
|
|
73
|
+ private final boolean sendReports;
|
72
|
74
|
/** Restart client Button. */
|
73
|
75
|
private JButton restartButton;
|
74
|
76
|
/** Quit client button. */
|
|
@@ -83,8 +85,8 @@ public final class FatalErrorDialog extends JDialog implements ActionListener,
|
83
|
85
|
private ImageIcon icon;
|
84
|
86
|
/** Stack trace scroll pane. */
|
85
|
87
|
private JScrollPane scrollPane;
|
86
|
|
- /** Error status semaphore. */
|
87
|
|
- private final CountDownLatch errorSemaphore;
|
|
88
|
+ /** Do we need to restart? Else we quit. */
|
|
89
|
+ private boolean restart = true;
|
88
|
90
|
|
89
|
91
|
/**
|
90
|
92
|
* Creates a new fatal error dialog.
|
|
@@ -92,14 +94,15 @@ public final class FatalErrorDialog extends JDialog implements ActionListener,
|
92
|
94
|
* @param error Error
|
93
|
95
|
*/
|
94
|
96
|
public FatalErrorDialog(final ProgramError error, final ErrorManager errorManager,
|
95
|
|
- final CountDownLatch errorSemaphore) {
|
|
97
|
+ final CountDownLatch countDownLatch, final boolean sendReports) {
|
96
|
98
|
super(null, Dialog.ModalityType.TOOLKIT_MODAL);
|
97
|
99
|
|
98
|
100
|
setModal(true);
|
99
|
101
|
|
100
|
102
|
this.error = error;
|
101
|
103
|
this.errorManager = errorManager;
|
102
|
|
- this.errorSemaphore = errorSemaphore;
|
|
104
|
+ this.countDownLatch = countDownLatch;
|
|
105
|
+ this.sendReports = sendReports;
|
103
|
106
|
|
104
|
107
|
initComponents();
|
105
|
108
|
layoutComponents();
|
|
@@ -236,7 +239,12 @@ public final class FatalErrorDialog extends JDialog implements ActionListener,
|
236
|
239
|
} else {
|
237
|
240
|
dispose();
|
238
|
241
|
}
|
239
|
|
- errorSemaphore.countDown();
|
|
242
|
+ if (!sendReports) {
|
|
243
|
+ countDownLatch.countDown();
|
|
244
|
+ countDownLatch.countDown();
|
|
245
|
+ } else {
|
|
246
|
+ countDownLatch.countDown();
|
|
247
|
+ }
|
240
|
248
|
}
|
241
|
249
|
|
242
|
250
|
/**
|
|
@@ -305,7 +313,7 @@ public final class FatalErrorDialog extends JDialog implements ActionListener,
|
305
|
313
|
restartButton.setEnabled(status.isTerminal());
|
306
|
314
|
updateSendButtonText(status);
|
307
|
315
|
});
|
308
|
|
- errorSemaphore.countDown();
|
|
316
|
+ countDownLatch.countDown();
|
309
|
317
|
}
|
310
|
318
|
}
|
311
|
319
|
|