|
@@ -28,6 +28,7 @@ import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
|
28
|
28
|
import com.dmdirc.interfaces.Connection;
|
29
|
29
|
import com.dmdirc.interfaces.WindowModel;
|
30
|
30
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
|
31
|
+import com.dmdirc.ui.WindowManager;
|
31
|
32
|
import com.dmdirc.ui.messages.BackBufferFactory;
|
32
|
33
|
|
33
|
34
|
import java.awt.Dialog.ModalityType;
|
|
@@ -44,6 +45,7 @@ public class PlaceholderContainer extends FrameContainer {
|
44
|
45
|
private final DCCManager plugin;
|
45
|
46
|
/** Window that will own new dialogs. */
|
46
|
47
|
private final Window parentWindow;
|
|
48
|
+ private final WindowManager windowManager;
|
47
|
49
|
|
48
|
50
|
/**
|
49
|
51
|
* Creates a placeholder DCC frame.
|
|
@@ -58,18 +60,20 @@ public class PlaceholderContainer extends FrameContainer {
|
58
|
60
|
final AggregateConfigProvider config,
|
59
|
61
|
final BackBufferFactory backBufferFactory,
|
60
|
62
|
final Window parentWindow,
|
|
63
|
+ final WindowManager windowManager,
|
61
|
64
|
final DMDircMBassador eventBus) {
|
62
|
65
|
super(null, "dcc", "DCCs", "DCCs", config, backBufferFactory, eventBus,
|
63
|
66
|
Collections.singletonList("com.dmdirc.addons.dcc.ui.PlaceholderPanel"));
|
64
|
67
|
this.plugin = plugin;
|
65
|
68
|
this.parentWindow = parentWindow;
|
|
69
|
+ this.windowManager = windowManager;
|
66
|
70
|
initBackBuffer();
|
67
|
71
|
}
|
68
|
72
|
|
69
|
73
|
@Override
|
70
|
74
|
public void close() {
|
71
|
75
|
int dccs = 0;
|
72
|
|
- for (WindowModel window : getChildren()) {
|
|
76
|
+ for (WindowModel window : windowManager.getChildren(this)) {
|
73
|
77
|
if (window instanceof TransferContainer
|
74
|
78
|
&& ((TransferContainer) window).getDCC().isActive()
|
75
|
79
|
|| window instanceof ChatContainer
|
|
@@ -99,7 +103,7 @@ public class PlaceholderContainer extends FrameContainer {
|
99
|
103
|
public void removeChild(final WindowModel child) {
|
100
|
104
|
super.removeChild(child);
|
101
|
105
|
|
102
|
|
- if (getChildren().isEmpty()) {
|
|
106
|
+ if (windowManager.getChildren(this).isEmpty()) {
|
103
|
107
|
close();
|
104
|
108
|
}
|
105
|
109
|
}
|