|
@@ -25,8 +25,8 @@ package com.dmdirc.addons.osd;
|
25
|
25
|
import com.dmdirc.config.prefs.CategoryChangeListener;
|
26
|
26
|
import com.dmdirc.config.prefs.PluginPreferencesCategory;
|
27
|
27
|
import com.dmdirc.config.prefs.PreferencesCategory;
|
28
|
|
-import com.dmdirc.config.prefs.PreferencesInterface;
|
29
|
28
|
import com.dmdirc.config.prefs.PreferencesDialogModel;
|
|
29
|
+import com.dmdirc.config.prefs.PreferencesInterface;
|
30
|
30
|
import com.dmdirc.config.prefs.PreferencesSetting;
|
31
|
31
|
import com.dmdirc.config.prefs.PreferencesType;
|
32
|
32
|
import com.dmdirc.config.prefs.SettingChangeListener;
|
|
@@ -34,6 +34,7 @@ import com.dmdirc.interfaces.CommandController;
|
34
|
34
|
import com.dmdirc.interfaces.config.IdentityController;
|
35
|
35
|
import com.dmdirc.plugins.PluginInfo;
|
36
|
36
|
import com.dmdirc.plugins.implementations.BaseCommandPlugin;
|
|
37
|
+import com.dmdirc.ui.messages.ColourManager;
|
37
|
38
|
import com.dmdirc.util.validators.NumericalValidator;
|
38
|
39
|
import com.dmdirc.util.validators.OptionalValidator;
|
39
|
40
|
|
|
@@ -43,7 +44,7 @@ import java.util.Map;
|
43
|
44
|
/**
|
44
|
45
|
* Allows the user to display on-screen-display messages.
|
45
|
46
|
*/
|
46
|
|
-public final class OsdPlugin extends BaseCommandPlugin implements
|
|
47
|
+public class OsdPlugin extends BaseCommandPlugin implements
|
47
|
48
|
CategoryChangeListener, PreferencesInterface, SettingChangeListener {
|
48
|
49
|
|
49
|
50
|
/** Config OSD Window. */
|
|
@@ -61,21 +62,27 @@ public final class OsdPlugin extends BaseCommandPlugin implements
|
61
|
62
|
private final PluginInfo pluginInfo;
|
62
|
63
|
/** The controller to read/write settings with. */
|
63
|
64
|
private final IdentityController identityController;
|
|
65
|
+ /** The manager to use to parse colours. */
|
|
66
|
+ private final ColourManager colourManager;
|
64
|
67
|
|
65
|
68
|
/**
|
66
|
69
|
* Creates a new instance of this plugin.
|
67
|
70
|
*
|
68
|
71
|
* @param pluginInfo This plugin's plugin info
|
|
72
|
+ * @param identityController The controller to use to read and write settings.
|
69
|
73
|
* @param commandController Command controller to register commands
|
|
74
|
+ * @param colourManager The manager to use to parse colours.
|
70
|
75
|
*/
|
71
|
76
|
public OsdPlugin(
|
72
|
77
|
final PluginInfo pluginInfo,
|
73
|
78
|
final IdentityController identityController,
|
74
|
|
- final CommandController commandController) {
|
|
79
|
+ final CommandController commandController,
|
|
80
|
+ final ColourManager colourManager) {
|
75
|
81
|
super(commandController);
|
76
|
82
|
this.pluginInfo = pluginInfo;
|
77
|
83
|
this.identityController = identityController;
|
78
|
|
- osdManager = new OsdManager(identityController, this);
|
|
84
|
+ this.colourManager = colourManager;
|
|
85
|
+ osdManager = new OsdManager(identityController, this, colourManager);
|
79
|
86
|
registerCommand(new OsdCommand(commandController, osdManager), OsdCommand.INFO);
|
80
|
87
|
}
|
81
|
88
|
|
|
@@ -154,7 +161,8 @@ public final class OsdPlugin extends BaseCommandPlugin implements
|
154
|
161
|
/** {@inheritDoc} */
|
155
|
162
|
@Override
|
156
|
163
|
public void categorySelected(final PreferencesCategory category) {
|
157
|
|
- osdWindow = new OsdWindow(identityController, -1, "Please drag this OSD to position", true, x, y, this, osdManager);
|
|
164
|
+ osdWindow = new OsdWindow(identityController, this, osdManager, colourManager, -1,
|
|
165
|
+ "Please drag this OSD to position", true, x, y);
|
158
|
166
|
osdWindow.setBackgroundColour(backgroundSetting.getValue());
|
159
|
167
|
osdWindow.setForegroundColour(foregroundSetting.getValue());
|
160
|
168
|
osdWindow.setFontSize(Integer.parseInt(fontSizeSetting.getValue()));
|