From adb784d23771fa2b84bd8e168ec1caf57e7b06ad Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 4 May 2020 19:20:05 +0200 Subject: [PATCH] WaitingDialog: do not allow close and dispose when needed --- src/be/nikiroo/utils/ui/WaitingDialog.java | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.27.0