mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
new StatisticsDialog now replaces previous opened ones - no weird bugs with several windows appearing simultaneously
git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@268 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
parent
aba7699eb6
commit
ff7644f7ed
@ -46,13 +46,12 @@ public abstract class AbstractModalDialog {
|
||||
|
||||
// create a separate event loop
|
||||
Display display = Display.getCurrent();
|
||||
while (!shell.isDisposed()) {
|
||||
while (shell != null && !shell.isDisposed()) {
|
||||
if (!display.readAndDispatch())
|
||||
display.sleep();
|
||||
}
|
||||
|
||||
// destroy the window
|
||||
shell.dispose();
|
||||
// forget the reference to the shell (this class is reused in the container)
|
||||
shell = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -54,6 +54,12 @@ public class StatisticsDialog extends AbstractModalDialog {
|
||||
* This method initializes shell
|
||||
*/
|
||||
private void createShell() {
|
||||
if (shell != null) {
|
||||
// close the same window if it is already open ('scanning incomplete')
|
||||
shell.close();
|
||||
shell.dispose();
|
||||
}
|
||||
|
||||
Display currentDisplay = Display.getCurrent();
|
||||
Shell parent = currentDisplay.getShells()[0];
|
||||
shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user