git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'b459e462a5c3447d0693674253c40bc7385a4f66'
[nikiroo-utils.git]
/
ui
/
WaitingDialog.java
diff --git
a/ui/WaitingDialog.java
b/ui/WaitingDialog.java
index 2c02c092fa4152bf89566dd82c62bfbafbaeded9..0fd4574d893aa5e5650e4adc73e83ae9efba15ae 100644
(file)
--- a/
ui/WaitingDialog.java
+++ b/
ui/WaitingDialog.java
@@
-32,7
+32,7
@@
public class WaitingDialog extends JDialog {
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
- * dismiss (see {@link WaitingDialog#d
one
()})
+ * dismiss (see {@link WaitingDialog#d
ismiss
()})
*/
public WaitingDialog(Window parent, long delayMs) {
this(parent, delayMs, null, null);
*/
public WaitingDialog(Window parent, long delayMs) {
this(parent, delayMs, null, null);
@@
-45,12
+45,12
@@
public class WaitingDialog extends JDialog {
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
- * dismiss (see {@link WaitingDialog#d
one
()})
+ * dismiss (see {@link WaitingDialog#d
ismiss
()})
* @param pg
* the {@link Progress} to listen on -- when it is
* {@link Progress#done()}, this {@link WaitingDialog} will
* @param pg
* the {@link Progress} to listen on -- when it is
* {@link Progress#done()}, this {@link WaitingDialog} will
- * automatically be dismissed as if
{@link WaitingDialog#done()}
- * was called
+ * automatically be dismissed as if
+ *
{@link WaitingDialog#dismiss()}
was called
*/
public WaitingDialog(Window parent, long delayMs, Progress pg) {
this(parent, delayMs, pg, null);
*/
public WaitingDialog(Window parent, long delayMs, Progress pg) {
this(parent, delayMs, pg, null);
@@
-63,7
+63,7
@@
public class WaitingDialog extends JDialog {
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
- * dismiss (see {@link WaitingDialog#d
one
()})
+ * dismiss (see {@link WaitingDialog#d
ismiss
()})
* @param waitingText
* a waiting text to display (note: you may want to subclass it
* for nicer UI)
* @param waitingText
* a waiting text to display (note: you may want to subclass it
* for nicer UI)
@@
-79,12
+79,12
@@
public class WaitingDialog extends JDialog {
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
* the parent/owner of this {@link WaitingDialog}
* @param delayMs
* the delay after which to show the dialog if it is still not
- * dismiss (see {@link WaitingDialog#d
one
()})
+ * dismiss (see {@link WaitingDialog#d
ismiss
()})
* @param pg
* the {@link Progress} to listen on -- when it is
* {@link Progress#done()}, this {@link WaitingDialog} will
* @param pg
* the {@link Progress} to listen on -- when it is
* {@link Progress#done()}, this {@link WaitingDialog} will
- * automatically be dismissed as if
{@link WaitingDialog#done()}
- * was called
+ * automatically be dismissed as if
+ *
{@link WaitingDialog#dismiss()}
was called
* @param waitingText
* a waiting text to display (note: you may want to subclass it
* for nicer UI)
* @param waitingText
* a waiting text to display (note: you may want to subclass it
* for nicer UI)
@@
-93,6
+93,8
@@
public class WaitingDialog extends JDialog {
String waitingText) {
super(parent);
String waitingText) {
super(parent);
+ this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
+
this.pg = pg;
if (waitingText != null) {
this.pg = pg;
if (waitingText != null) {
@@
-117,7
+119,7
@@
public class WaitingDialog extends JDialog {
@Override
public void done() {
@Override
public void done() {
-
WaitingDialog.this.done
();
+
dismiss
();
}
}.execute();
}
}
}.execute();
}
@@
-127,7
+129,7
@@
public class WaitingDialog extends JDialog {
pg.addProgressListener(pgl);
if (pg.isDone()) {
pg.addProgressListener(pgl);
if (pg.isDone()) {
- d
one
();
+ d
ismiss
();
return;
}
}
return;
}
}
@@
-154,8
+156,10
@@
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).
/**
* 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).
+ * <p>
+ * Will also dispose the {@link WaitingDialog}.
*/
*/
- public void d
one
() {
+ public void d
ismiss
() {
synchronized (waitLock) {
if (waitScreen) {
setVisible(false);
synchronized (waitLock) {
if (waitScreen) {
setVisible(false);
@@
-166,5
+170,7
@@
public class WaitingDialog extends JDialog {
if (pg != null) {
pg.removeProgressListener(pgl);
}
if (pg != null) {
pg.removeProgressListener(pgl);
}
+
+ dispose();
}
}
}
}