From: Niki Roo Date: Mon, 4 May 2020 17:20:05 +0000 (+0200) Subject: WaitingDialog: do not allow close and dispose when needed X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=commitdiff_plain;h=044aead799cf703fe9fc347215a9cf235fc7cf0a WaitingDialog: do not allow close and dispose when needed --- diff --git a/ui/WaitingDialog.java b/ui/WaitingDialog.java index 15dca6c..7df5a8b 100644 --- a/ui/WaitingDialog.java +++ b/ui/WaitingDialog.java @@ -93,6 +93,8 @@ public class WaitingDialog extends JDialog { String waitingText) { super(parent); + this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + this.pg = pg; if (waitingText != null) { @@ -154,11 +156,14 @@ public class WaitingDialog extends JDialog { /** * Notify this {@link WaitingDialog} that the job is done, and dismiss it if * it was already showing on screen (or never show it if it was not). + *

+ * Will also dispose the {@link WaitingDialog}. */ public void dismiss() { synchronized (waitLock) { if (waitScreen) { setVisible(false); + dispose(); } waitScreen = true; }