|
@@ -56,6 +56,7 @@ import com.dmdirc.config.prefs.PreferencesDialogModel;
|
56
|
56
|
import com.dmdirc.config.prefs.PreferencesSetting;
|
57
|
57
|
import com.dmdirc.config.prefs.PreferencesType;
|
58
|
58
|
import com.dmdirc.interfaces.CommandController;
|
|
59
|
+import com.dmdirc.interfaces.LifecycleController;
|
59
|
60
|
import com.dmdirc.interfaces.ui.UIController;
|
60
|
61
|
import com.dmdirc.interfaces.ui.Window;
|
61
|
62
|
import com.dmdirc.logger.ErrorLevel;
|
|
@@ -159,6 +160,8 @@ public class SwingController extends BaseCommandPlugin implements UIController {
|
159
|
160
|
/** Plugin manager. */
|
160
|
161
|
@Getter
|
161
|
162
|
private final PluginManager pluginManager;
|
|
163
|
+ /** Controller to use to close the application. */
|
|
164
|
+ private final LifecycleController lifecycleController;
|
162
|
165
|
/** Apple handler, deals with Mac specific code. */
|
163
|
166
|
@Getter
|
164
|
167
|
private final Apple apple;
|
|
@@ -173,6 +176,7 @@ public class SwingController extends BaseCommandPlugin implements UIController {
|
173
|
176
|
* @param actionManager Action manager
|
174
|
177
|
* @param commandController Command controller to register commands
|
175
|
178
|
* @param serverManager Server manager to use for server information.
|
|
179
|
+ * @param lifecycleController Controller to use to close the application.
|
176
|
180
|
*/
|
177
|
181
|
public SwingController(
|
178
|
182
|
final PluginInfo pluginInfo,
|
|
@@ -181,7 +185,8 @@ public class SwingController extends BaseCommandPlugin implements UIController {
|
181
|
185
|
final Main main,
|
182
|
186
|
final ActionManager actionManager,
|
183
|
187
|
final CommandController commandController,
|
184
|
|
- final ServerManager serverManager) {
|
|
188
|
+ final ServerManager serverManager,
|
|
189
|
+ final LifecycleController lifecycleController) {
|
185
|
190
|
super(commandController);
|
186
|
191
|
this.main = main;
|
187
|
192
|
this.pluginInfo = pluginInfo;
|
|
@@ -189,6 +194,8 @@ public class SwingController extends BaseCommandPlugin implements UIController {
|
189
|
194
|
this.actionManager = actionManager;
|
190
|
195
|
this.pluginManager = pluginManager;
|
191
|
196
|
this.serverManager = serverManager;
|
|
197
|
+ this.lifecycleController = lifecycleController;
|
|
198
|
+
|
192
|
199
|
globalConfig = identityManager.getGlobalConfiguration();
|
193
|
200
|
globalIdentity = identityManager.getGlobalConfigIdentity();
|
194
|
201
|
addonIdentity = identityManager.getGlobalAddonIdentity();
|
|
@@ -487,7 +494,7 @@ public class SwingController extends BaseCommandPlugin implements UIController {
|
487
|
494
|
@Override
|
488
|
495
|
public void run() {
|
489
|
496
|
initUISettings();
|
490
|
|
- mainFrame = new MainFrame(SwingController.this);
|
|
497
|
+ mainFrame = new MainFrame(SwingController.this, lifecycleController);
|
491
|
498
|
getMainFrame().setVisible(true);
|
492
|
499
|
mainFrameCreated.set(true);
|
493
|
500
|
swingStatusBar = getMainFrame().getStatusBar();
|