|
@@ -22,6 +22,7 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.addons.osd;
|
24
|
24
|
|
|
25
|
+import com.dmdirc.DMDircMBassador;
|
25
|
26
|
import com.dmdirc.addons.ui_swing.UIUtilities;
|
26
|
27
|
import com.dmdirc.addons.ui_swing.injection.MainWindow;
|
27
|
28
|
import com.dmdirc.config.prefs.CategoryChangeListener;
|
|
@@ -82,6 +83,7 @@ public class OsdManager implements CategoryChangeListener, PreferencesInterface,
|
82
|
83
|
private PreferencesSetting maxWindowsSetting;
|
83
|
84
|
/** This plugin's plugin info. */
|
84
|
85
|
private final PluginInfo pluginInfo;
|
|
86
|
+ private final DMDircMBassador eventBus;
|
85
|
87
|
/** The controller to read/write settings with. */
|
86
|
88
|
private final IdentityController identityController;
|
87
|
89
|
/** The manager to use to parse colours. */
|
|
@@ -90,10 +92,12 @@ public class OsdManager implements CategoryChangeListener, PreferencesInterface,
|
90
|
92
|
@Inject
|
91
|
93
|
public OsdManager(
|
92
|
94
|
@MainWindow final Window mainFrame,
|
|
95
|
+ final DMDircMBassador eventBus,
|
93
|
96
|
final IdentityController identityController,
|
94
|
97
|
final ColourManagerFactory colourManagerFactory,
|
95
|
98
|
@PluginDomain(OsdPlugin.class) final PluginInfo pluginInfo) {
|
96
|
99
|
this.mainFrame = mainFrame;
|
|
100
|
+ this.eventBus = eventBus;
|
97
|
101
|
this.identityController = identityController;
|
98
|
102
|
this.colourManager = colourManagerFactory.getColourManager(identityController.getGlobalConfiguration());
|
99
|
103
|
this.pluginInfo = pluginInfo;
|
|
@@ -321,4 +325,11 @@ public class OsdManager implements CategoryChangeListener, PreferencesInterface,
|
321
|
325
|
}
|
322
|
326
|
}
|
323
|
327
|
|
|
328
|
+ public void onLoad() {
|
|
329
|
+ eventBus.subscribe(this);
|
|
330
|
+ }
|
|
331
|
+
|
|
332
|
+ public void onUnload() {
|
|
333
|
+ eventBus.unsubscribe(this);
|
|
334
|
+ }
|
324
|
335
|
}
|