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-Tag: fanfix-swing-1.2.0~19 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=adb784d23771fa2b84bd8e168ec1caf57e7b06ad;p=fanfix-swing.git WaitingDialog: do not allow close and dispose when needed --- diff --git a/src/be/nikiroo/utils/ui/WaitingDialog.java b/src/be/nikiroo/utils/ui/WaitingDialog.java index 15dca6cc..7df5a8b5 100644 --- a/src/be/nikiroo/utils/ui/WaitingDialog.java +++ b/src/be/nikiroo/utils/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; }