Explorar el Código

Switch to ConfigProvider in a few places.

Change-Id: Icf36b0475927f8e78a516e713674aa7517ca5b51
Depends-On: I7c3f01392083df4150e80a836c8cb94482b4e9dc
Reviewed-on: http://gerrit.dmdirc.com/2766
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.8
Chris Smith hace 10 años
padre
commit
2a45dc7ada

+ 4
- 4
src/com/dmdirc/addons/dcc/DCCPlugin.java Ver fichero

@@ -34,7 +34,6 @@ import com.dmdirc.addons.ui_swing.SwingController;
34 34
 import com.dmdirc.addons.ui_swing.SwingWindowFactory;
35 35
 import com.dmdirc.addons.ui_swing.components.frames.ComponentFrame;
36 36
 import com.dmdirc.config.ConfigManager;
37
-import com.dmdirc.config.Identity;
38 37
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
39 38
 import com.dmdirc.config.prefs.PreferencesCategory;
40 39
 import com.dmdirc.config.prefs.PreferencesDialogModel;
@@ -42,8 +41,9 @@ import com.dmdirc.config.prefs.PreferencesSetting;
42 41
 import com.dmdirc.config.prefs.PreferencesType;
43 42
 import com.dmdirc.interfaces.ActionListener;
44 43
 import com.dmdirc.interfaces.CommandController;
45
-import com.dmdirc.interfaces.config.IdentityController;
46 44
 import com.dmdirc.interfaces.actions.ActionType;
45
+import com.dmdirc.interfaces.config.ConfigProvider;
46
+import com.dmdirc.interfaces.config.IdentityController;
47 47
 import com.dmdirc.logger.ErrorLevel;
48 48
 import com.dmdirc.logger.Logger;
49 49
 import com.dmdirc.parser.interfaces.ClientInfo;
@@ -65,7 +65,7 @@ import javax.swing.JOptionPane;
65 65
 /**
66 66
  * This plugin adds DCC to DMDirc.
67 67
  */
68
-public final class DCCPlugin extends BaseCommandPlugin implements ActionListener {
68
+public class DCCPlugin extends BaseCommandPlugin implements ActionListener {
69 69
 
70 70
     /** Our DCC Container window. */
71 71
     private PlaceholderContainer container;
@@ -636,7 +636,7 @@ public final class DCCPlugin extends BaseCommandPlugin implements ActionListener
636 636
     /** {@inheritDoc} */
637 637
     @Override
638 638
     public void domainUpdated() {
639
-        final Identity defaults = identityController.getGlobalAddonIdentity();
639
+        final ConfigProvider defaults = identityController.getGlobalAddonIdentity();
640 640
 
641 641
         defaults.setOption(getDomain(), "receive.savelocation",
642 642
                 identityController.getConfigDir() + "downloads"

+ 2
- 2
src/com/dmdirc/addons/debug/commands/ConfigInfo.java Ver fichero

@@ -28,7 +28,7 @@ import com.dmdirc.addons.debug.DebugCommand;
28 28
 import com.dmdirc.addons.debug.DebugPlugin;
29 29
 import com.dmdirc.commandparser.CommandArguments;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
-import com.dmdirc.config.Identity;
31
+import com.dmdirc.interfaces.config.ConfigProvider;
32 32
 
33 33
 /**
34 34
  * Outputs the config info related to the current context.
@@ -61,7 +61,7 @@ public class ConfigInfo extends DebugCommand {
61 61
     @Override
62 62
     public void execute(final FrameContainer origin,
63 63
             final CommandArguments args, final CommandContext context) {
64
-        for (Identity source : origin.getConfigManager().getSources()) {
64
+        for (ConfigProvider source : origin.getConfigManager().getSources()) {
65 65
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, source.getTarget()
66 66
                     + " - " + source + "(" + source.getTarget().getOrder()
67 67
                     + ")");

+ 2
- 2
src/com/dmdirc/addons/debug/commands/GlobalConfigInfo.java Ver fichero

@@ -28,7 +28,7 @@ import com.dmdirc.addons.debug.DebugCommand;
28 28
 import com.dmdirc.addons.debug.DebugPlugin;
29 29
 import com.dmdirc.commandparser.CommandArguments;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
-import com.dmdirc.config.Identity;
31
+import com.dmdirc.interfaces.config.ConfigProvider;
32 32
 
33 33
 /**
34 34
  * Outputs information about the global config sources.
@@ -61,7 +61,7 @@ public class GlobalConfigInfo extends DebugCommand {
61 61
     @Override
62 62
     public void execute(final FrameContainer origin,
63 63
             final CommandArguments args, final CommandContext context) {
64
-        for (Identity source : getPlugin().getIdentityController()
64
+        for (ConfigProvider source : getPlugin().getIdentityController()
65 65
                 .getGlobalConfiguration().getSources()) {
66 66
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, source.getTarget()
67 67
                     + " - " + source + "(" + source.getTarget().getOrder()

+ 2
- 1
src/com/dmdirc/addons/debug/commands/Identities.java Ver fichero

@@ -29,6 +29,7 @@ import com.dmdirc.addons.debug.DebugPlugin;
29 29
 import com.dmdirc.commandparser.CommandArguments;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31 31
 import com.dmdirc.config.Identity;
32
+import com.dmdirc.interfaces.config.ConfigProvider;
32 33
 
33 34
 import java.util.List;
34 35
 
@@ -76,7 +77,7 @@ public class Identities extends DebugCommand {
76 77
         final String[][] data = new String[identities.size()][4];
77 78
 
78 79
         int i = 0;
79
-        for (Identity source : identities) {
80
+        for (ConfigProvider source : identities) {
80 81
             data[i++] = new String[]{source.getName(),
81 82
             source.getTarget().getTypeName(), source.getTarget().getData(),
82 83
             String.valueOf(source.getTarget().getOrder())};

+ 2
- 2
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java Ver fichero

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.addons.freedesktop_notifications;
24 24
 
25 25
 import com.dmdirc.config.ConfigManager;
26
-import com.dmdirc.config.Identity;
27 26
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
28 27
 import com.dmdirc.config.prefs.PreferencesCategory;
29 28
 import com.dmdirc.config.prefs.PreferencesDialogModel;
@@ -31,6 +30,7 @@ import com.dmdirc.config.prefs.PreferencesSetting;
31 30
 import com.dmdirc.config.prefs.PreferencesType;
32 31
 import com.dmdirc.interfaces.CommandController;
33 32
 import com.dmdirc.interfaces.config.ConfigChangeListener;
33
+import com.dmdirc.interfaces.config.ConfigProvider;
34 34
 import com.dmdirc.interfaces.config.IdentityController;
35 35
 import com.dmdirc.logger.ErrorLevel;
36 36
 import com.dmdirc.logger.Logger;
@@ -66,7 +66,7 @@ public final class FreeDesktopNotificationsPlugin
66 66
     /** Global config. */
67 67
     private final ConfigManager config;
68 68
     /** Addon identity. */
69
-    private final Identity identity;
69
+    private final ConfigProvider identity;
70 70
     /** Plugin files helper. */
71 71
     private final PluginFilesHelper filesHelper;
72 72
 

+ 2
- 2
src/com/dmdirc/addons/logging/LoggingPlugin.java Ver fichero

@@ -30,7 +30,6 @@ import com.dmdirc.Server;
30 30
 import com.dmdirc.actions.CoreActionType;
31 31
 import com.dmdirc.interfaces.actions.ActionType;
32 32
 import com.dmdirc.config.ConfigManager;
33
-import com.dmdirc.config.Identity;
34 33
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
35 34
 import com.dmdirc.config.prefs.PreferencesCategory;
36 35
 import com.dmdirc.config.prefs.PreferencesDialogModel;
@@ -40,6 +39,7 @@ import com.dmdirc.interfaces.ActionController;
40 39
 import com.dmdirc.interfaces.ActionListener;
41 40
 import com.dmdirc.interfaces.CommandController;
42 41
 import com.dmdirc.interfaces.config.ConfigChangeListener;
42
+import com.dmdirc.interfaces.config.ConfigProvider;
43 43
 import com.dmdirc.interfaces.config.IdentityController;
44 44
 import com.dmdirc.logger.ErrorLevel;
45 45
 import com.dmdirc.logger.Logger;
@@ -92,7 +92,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
92 92
     /** Global config. */
93 93
     private final ConfigManager config;
94 94
     /** Addon identity. */
95
-    private final Identity identity;
95
+    private final ConfigProvider identity;
96 96
     /** Parent Identity Manager. */
97 97
     private final IdentityController identityController;
98 98
 

+ 2
- 2
src/com/dmdirc/addons/nickcolours/NickColourPanel.java Ver fichero

@@ -23,8 +23,8 @@
23 23
 package com.dmdirc.addons.nickcolours;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.SwingController;
26
-import com.dmdirc.config.Identity;
27 26
 import com.dmdirc.config.prefs.PreferencesInterface;
27
+import com.dmdirc.interfaces.config.ConfigProvider;
28 28
 
29 29
 import java.awt.Color;
30 30
 import java.awt.event.ActionEvent;
@@ -61,7 +61,7 @@ public class NickColourPanel extends JPanel implements ActionListener,
61 61
     /** The plugin we're associated with. */
62 62
     private final transient NickColourPlugin plugin;
63 63
     /** The identity to write settings to. */
64
-    private final Identity configIdentity;
64
+    private final ConfigProvider configIdentity;
65 65
     /** The table headings. */
66 66
     private static final String[] HEADERS = {"Network", "Nickname",
67 67
         "Text colour", "Nicklist colour"};

+ 6
- 10
src/com/dmdirc/addons/serverlistdialog/Profiles.java Ver fichero

@@ -22,13 +22,12 @@
22 22
 
23 23
 package com.dmdirc.addons.serverlistdialog;
24 24
 
25
+import com.dmdirc.addons.serverlists.ServerGroupItem;
25 26
 import com.dmdirc.addons.ui_swing.SwingController;
26 27
 import com.dmdirc.addons.ui_swing.components.vetoable.VetoableComboBoxModel;
27
-import com.dmdirc.config.Identity;
28
-import com.dmdirc.addons.serverlists.ServerGroupItem;
28
+import com.dmdirc.interfaces.config.ConfigProvider;
29 29
 
30 30
 import java.util.HashMap;
31
-import java.util.List;
32 31
 import java.util.Map;
33 32
 import java.util.Map.Entry;
34 33
 
@@ -51,8 +50,7 @@ public class Profiles extends JPanel implements ServerListListener {
51 50
     /** Server list model. */
52 51
     private final ServerListModel model;
53 52
     /** Combo boxes. */
54
-    private final Map<ServerGroupItem, JComboBox> combos =
55
-            new HashMap<ServerGroupItem, JComboBox>();
53
+    private final Map<ServerGroupItem, JComboBox> combos = new HashMap<>();
56 54
     /** Info label. */
57 55
     private final JLabel label;
58 56
     /** Swing controller. */
@@ -109,11 +107,9 @@ public class Profiles extends JPanel implements ServerListListener {
109 107
         if (!combos.containsKey(item)) {
110 108
             final DefaultComboBoxModel comboModel = new VetoableComboBoxModel();
111 109
 
112
-            final List<Identity> profiles = controller.getIdentityManager()
113
-                    .getIdentitiesByType("profile");
114
-            Identity selectedItem = null;
110
+            ConfigProvider selectedItem = null;
115 111
             comboModel.addElement(null);
116
-            for (Identity profile : profiles) {
112
+            for (ConfigProvider profile : controller.getIdentityManager().getIdentitiesByType("profile")) {
117 113
                 comboModel.addElement(profile);
118 114
                 if (item != null && profile.getName().equals(
119 115
                         item.getProfile())) {
@@ -135,7 +131,7 @@ public class Profiles extends JPanel implements ServerListListener {
135 131
                     if (entry.getValue().getSelectedItem() == null) {
136 132
                         entry.getKey().setProfile(null);
137 133
                     } else {
138
-                        entry.getKey().setProfile(((Identity) entry.getValue().
134
+                        entry.getKey().setProfile(((ConfigProvider) entry.getValue().
139 135
                                 getSelectedItem()).getName());
140 136
                     }
141 137
                 }

+ 6
- 5
src/com/dmdirc/addons/serverlistdialog/Settings.java Ver fichero

@@ -22,13 +22,13 @@
22 22
 
23 23
 package com.dmdirc.addons.serverlistdialog;
24 24
 
25
-import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel;
26 25
 import com.dmdirc.addons.serverlists.ServerGroup;
27 26
 import com.dmdirc.addons.serverlists.ServerGroupItem;
28 27
 import com.dmdirc.addons.ui_swing.SwingController;
28
+import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel;
29 29
 import com.dmdirc.config.ConfigManager;
30
-import com.dmdirc.config.Identity;
31 30
 import com.dmdirc.config.prefs.PreferencesManager;
31
+import com.dmdirc.interfaces.config.ConfigProvider;
32 32
 
33 33
 import java.util.HashMap;
34 34
 import java.util.Map;
@@ -51,8 +51,7 @@ public class Settings extends JPanel implements ServerListListener {
51 51
     /** Server list model. */
52 52
     private final ServerListModel model;
53 53
     /** Settings panel. */
54
-    private final Map<ServerGroupItem, SettingsPanel> panels =
55
-            new HashMap<ServerGroupItem, SettingsPanel>();
54
+    private final Map<ServerGroupItem, SettingsPanel> panels = new HashMap<>();
56 55
     /** Platform border. */
57 56
     private final Border border;
58 57
     /** Swing controller. */
@@ -152,9 +151,11 @@ public class Settings extends JPanel implements ServerListListener {
152 151
      * Adds the settings to the panel.
153 152
      *
154 153
      * @param settingsPanel Settings panel to add settings to
154
+     * @param manager The config manager to read current settings from.
155
+     * @param identity The provider to write settings to.
155 156
      */
156 157
     private void addSettings(final SettingsPanel settingsPanel,
157
-            final ConfigManager manager, final Identity identity) {
158
+            final ConfigManager manager, final ConfigProvider identity) {
158 159
         settingsPanel.addOption(PreferencesManager.getPreferencesManager()
159 160
                 .getServerSettings(manager, identity));
160 161
     }

+ 3
- 3
src/com/dmdirc/addons/serverlists/ServerGroupItemBase.java Ver fichero

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.serverlists;
24 24
 
25
-import com.dmdirc.config.Identity;
25
+import com.dmdirc.interfaces.config.ConfigProvider;
26 26
 import com.dmdirc.interfaces.config.IdentityController;
27 27
 
28 28
 import lombok.RequiredArgsConstructor;
@@ -108,9 +108,9 @@ public abstract class ServerGroupItemBase implements ServerGroupItem {
108 108
      *
109 109
      * @return This server's profile identity
110 110
      */
111
-    protected Identity getProfileIdentity() {
111
+    protected ConfigProvider getProfileIdentity() {
112 112
         if (profile != null) {
113
-            for (Identity identity : identityController.getIdentitiesByType("profile")) {
113
+            for (ConfigProvider identity : identityController.getIdentitiesByType("profile")) {
114 114
                 if (profile.equals(identity.getName())) {
115 115
                     return identity;
116 116
                 }

+ 1
- 1
src/com/dmdirc/addons/serverlists/ServerList.java Ver fichero

@@ -72,7 +72,7 @@ public class ServerList implements ConfigProviderListener {
72 72
 
73 73
         identityController.registerIdentityListener("servergroup", this);
74 74
 
75
-        for (Identity identity : identityController.getIdentitiesByType("servergroup")) {
75
+        for (ConfigProvider identity : identityController.getIdentitiesByType("servergroup")) {
76 76
             configProviderAdded(identity);
77 77
         }
78 78
 

+ 5
- 4
src/com/dmdirc/addons/ui_swing/SwingController.java Ver fichero

@@ -49,16 +49,16 @@ import com.dmdirc.addons.ui_swing.dialogs.url.URLDialog;
49 49
 import com.dmdirc.addons.ui_swing.wizard.WizardListener;
50 50
 import com.dmdirc.addons.ui_swing.wizard.firstrun.SwingFirstRunWizard;
51 51
 import com.dmdirc.config.ConfigManager;
52
-import com.dmdirc.config.Identity;
53 52
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
54 53
 import com.dmdirc.config.prefs.PreferencesCategory;
55 54
 import com.dmdirc.config.prefs.PreferencesDialogModel;
56 55
 import com.dmdirc.config.prefs.PreferencesSetting;
57 56
 import com.dmdirc.config.prefs.PreferencesType;
58 57
 import com.dmdirc.interfaces.CommandController;
58
+import com.dmdirc.interfaces.LifecycleController;
59
+import com.dmdirc.interfaces.config.ConfigProvider;
59 60
 import com.dmdirc.interfaces.config.IdentityController;
60 61
 import com.dmdirc.interfaces.config.IdentityFactory;
61
-import com.dmdirc.interfaces.LifecycleController;
62 62
 import com.dmdirc.interfaces.ui.UIController;
63 63
 import com.dmdirc.interfaces.ui.Window;
64 64
 import com.dmdirc.logger.ErrorLevel;
@@ -144,10 +144,10 @@ public class SwingController extends BaseCommandPlugin implements UIController {
144 144
     private final IdentityFactory identityFactory;
145 145
     /** Global config identity. */
146 146
     @Getter
147
-    private final Identity globalIdentity;
147
+    private final ConfigProvider globalIdentity;
148 148
     /** Addon config identity. */
149 149
     @Getter
150
-    private final Identity addonIdentity;
150
+    private final ConfigProvider addonIdentity;
151 151
     /** Global Swing UI Icon manager. */
152 152
     @Getter
153 153
     private final IconManager iconManager;
@@ -182,6 +182,7 @@ public class SwingController extends BaseCommandPlugin implements UIController {
182 182
      *
183 183
      * @param pluginInfo Plugin info
184 184
      * @param identityManager Identity Manager
185
+     * @param identityFactory Factory used to create identities.
185 186
      * @param pluginManager Plugin manager
186 187
      * @param actionManager Action manager
187 188
      * @param commandController Command controller to register commands

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/addonpanel/AddonToggle.java Ver fichero

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.addonpanel;
24 24
 
25
-import com.dmdirc.config.Identity;
25
+import com.dmdirc.interfaces.config.ConfigProvider;
26 26
 import com.dmdirc.plugins.PluginInfo;
27 27
 import com.dmdirc.ui.themes.Theme;
28 28
 import com.dmdirc.ui.themes.ThemeManager;
@@ -48,7 +48,7 @@ public final class AddonToggle {
48 48
     /** Listener list. */
49 49
     private final ListenerList listeners = new ListenerList();
50 50
     /** Identity to change update settings in. */
51
-    private final Identity identity;
51
+    private final ConfigProvider identity;
52 52
     /** The manager to update when toggling a theme. */
53 53
     private final ThemeManager themeManager;
54 54
 
@@ -59,7 +59,7 @@ public final class AddonToggle {
59 59
      * @param identity Identity to change update settings in.
60 60
      * @param pi The PluginInfo to be wrapped.
61 61
      */
62
-    public AddonToggle(final Identity identity, final PluginInfo pi) {
62
+    public AddonToggle(final ConfigProvider identity, final PluginInfo pi) {
63 63
         this.identity = identity;
64 64
         this.pi = pi;
65 65
         this.theme = null;
@@ -83,7 +83,7 @@ public final class AddonToggle {
83 83
      * @param themeManager The manager to update when toggling a theme.
84 84
      * @param theme The Theme to be wrapped
85 85
      */
86
-    public AddonToggle(final Identity identity, final ThemeManager themeManager, final Theme theme) {
86
+    public AddonToggle(final ConfigProvider identity, final ThemeManager themeManager, final Theme theme) {
87 87
         this.identity = identity;
88 88
         this.pi = null;
89 89
         this.theme = theme;

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java Ver fichero

@@ -33,8 +33,8 @@ import com.dmdirc.addons.ui_swing.components.NickList;
33 33
 import com.dmdirc.addons.ui_swing.components.SplitPane;
34 34
 import com.dmdirc.addons.ui_swing.components.TopicBar;
35 35
 import com.dmdirc.commandparser.PopupType;
36
-import com.dmdirc.config.Identity;
37 36
 import com.dmdirc.interfaces.actions.ActionType;
37
+import com.dmdirc.interfaces.config.ConfigProvider;
38 38
 
39 39
 import java.awt.Dimension;
40 40
 import java.awt.event.ActionEvent;
@@ -59,7 +59,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
59 59
      */
60 60
     private static final long serialVersionUID = 10;
61 61
     /** Identity. */
62
-    private final Identity identity;
62
+    private final ConfigProvider identity;
63 63
     /** split pane. */
64 64
     private SplitPane splitPane;
65 65
     /** popup menu item. */

+ 2
- 2
src/com/dmdirc/addons/ui_swing/dialogs/NewServerDialog.java Ver fichero

@@ -190,7 +190,7 @@ public final class NewServerDialog extends StandardDialog implements
190 190
         final List<Identity> profiles = getController().getIdentityManager()
191 191
                 .getIdentitiesByType("profile");
192 192
         ((DefaultComboBoxModel) identityField.getModel()).removeAllElements();
193
-        for (Identity profile : profiles) {
193
+        for (ConfigProvider profile : profiles) {
194 194
             ((DefaultComboBoxModel) identityField.getModel()).addElement(profile);
195 195
         }
196 196
     }
@@ -244,7 +244,7 @@ public final class NewServerDialog extends StandardDialog implements
244 244
         dispose();
245 245
         openingServer = true;
246 246
 
247
-        final Identity profile = (Identity) identityField.getSelectedItem();
247
+        final ConfigProvider profile = (ConfigProvider) identityField.getSelectedItem();
248 248
 
249 249
         try {
250 250
             final URI address = new URI("irc" + (sslCheck.isSelected() ? "s" :

+ 2
- 3
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java Ver fichero

@@ -29,8 +29,8 @@ import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel;
29 29
 import com.dmdirc.addons.ui_swing.components.frames.InputTextFrame;
30 30
 import com.dmdirc.addons.ui_swing.components.modes.ChannelModesPane;
31 31
 import com.dmdirc.addons.ui_swing.dialogs.StandardDialog;
32
-import com.dmdirc.config.Identity;
33 32
 import com.dmdirc.config.prefs.PreferencesManager;
33
+import com.dmdirc.interfaces.config.ConfigProvider;
34 34
 import com.dmdirc.interfaces.ui.InputWindow;
35 35
 
36 36
 import java.awt.Window;
@@ -55,7 +55,7 @@ public final class ChannelSettingsDialog extends StandardDialog implements
55 55
     /** The channel object that this dialog belongs to. */
56 56
     private final Channel channel;
57 57
     /** Channel identity file. */
58
-    private final Identity identity;
58
+    private final ConfigProvider identity;
59 59
     /** Channel window. */
60 60
     private final InputWindow channelWindow;
61 61
     /** Tabbed pane. */
@@ -75,7 +75,6 @@ public final class ChannelSettingsDialog extends StandardDialog implements
75 75
      * @param controller Swing controller
76 76
      * @param newChannel The channel object that we're editing settings for
77 77
      * @param parentWindow Parent window
78
-     * @param channelWindow Channel window
79 78
      */
80 79
     public ChannelSettingsDialog(final SwingController controller,
81 80
             final Channel newChannel, final Window parentWindow) {

+ 2
- 2
src/com/dmdirc/addons/ui_swing/dialogs/prefs/UpdateConfigPanel.java Ver fichero

@@ -25,9 +25,9 @@ package com.dmdirc.addons.ui_swing.dialogs.prefs;
25 25
 import com.dmdirc.addons.ui_swing.SwingController;
26 26
 import com.dmdirc.addons.ui_swing.components.PackingTable;
27 27
 import com.dmdirc.config.ConfigManager;
28
-import com.dmdirc.config.Identity;
29 28
 import com.dmdirc.config.prefs.PreferencesInterface;
30 29
 import com.dmdirc.interfaces.config.ConfigChangeListener;
30
+import com.dmdirc.interfaces.config.ConfigProvider;
31 31
 import com.dmdirc.logger.ErrorLevel;
32 32
 import com.dmdirc.logger.Logger;
33 33
 import com.dmdirc.updater.UpdateChannel;
@@ -89,7 +89,7 @@ public class UpdateConfigPanel extends JPanel implements ActionListener,
89 89
     /** {@inheritDoc} */
90 90
     @Override
91 91
     public void save() {
92
-        final Identity identity = controller.getGlobalIdentity();
92
+        final ConfigProvider identity = controller.getGlobalIdentity();
93 93
         identity.setOption("updater", "enable", enable.isSelected());
94 94
 
95 95
         identity.setOption("updater", "channel", updateChannel

+ 4
- 3
src/com/dmdirc/addons/ui_swing/dialogs/profiles/Profile.java Ver fichero

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.dialogs.profiles;
24 24
 
25 25
 import com.dmdirc.config.Identity;
26
+import com.dmdirc.interfaces.config.ConfigProvider;
26 27
 
27 28
 import java.io.IOException;
28 29
 import java.util.ArrayList;
@@ -42,7 +43,7 @@ import lombok.ToString;
42 43
 public class Profile {
43 44
 
44 45
     /** Identity backing this profile. */
45
-    private Identity identity;
46
+    private ConfigProvider identity;
46 47
     /** Profile Name, must be a sanitised filename. */
47 48
     @Getter @Setter
48 49
     private String name;
@@ -69,11 +70,11 @@ public class Profile {
69 70
      *
70 71
      * @param identity Identity to create profile from
71 72
      */
72
-    public Profile(final Identity identity) {
73
+    public Profile(final ConfigProvider identity) {
73 74
         this.identity = identity;
74 75
         if (identity == null) {
75 76
             name = "New Profile";
76
-            nicknames = new ArrayList<String>();
77
+            nicknames = new ArrayList<>();
77 78
             realname = "";
78 79
             ident = "";
79 80
         } else {

+ 2
- 1
src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileManagerModel.java Ver fichero

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.dialogs.profiles;
24 24
 
25 25
 import com.dmdirc.config.Identity;
26
+import com.dmdirc.interfaces.config.ConfigProvider;
26 27
 import com.dmdirc.interfaces.config.IdentityController;
27 28
 import com.dmdirc.util.validators.FileNameValidator;
28 29
 import com.dmdirc.util.validators.IdentValidator;
@@ -58,7 +59,7 @@ public class ProfileManagerModel extends DefaultBindableModel {
58 59
     public ProfileManagerModel(final IdentityController identityController) {
59 60
         final List<Identity> identities = identityController
60 61
                 .getIdentitiesByType("profile");
61
-        for (Identity identity : identities) {
62
+        for (ConfigProvider identity : identities) {
62 63
             profiles.add(new Profile(identity));
63 64
         }
64 65
         updateDisplayedProfiles();

+ 5
- 4
src/com/dmdirc/addons/ui_web/DynamicRequestHandler.java Ver fichero

@@ -27,7 +27,7 @@ import com.dmdirc.ServerManager;
27 27
 import com.dmdirc.addons.ui_web.uicomponents.WebInputHandler;
28 28
 import com.dmdirc.addons.ui_web.uicomponents.WebInputWindow;
29 29
 import com.dmdirc.addons.ui_web.uicomponents.WebWindow;
30
-import com.dmdirc.config.Identity;
30
+import com.dmdirc.interfaces.config.ConfigProvider;
31 31
 import com.dmdirc.interfaces.config.IdentityController;
32 32
 import com.dmdirc.parser.common.ChannelJoinRequest;
33 33
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
@@ -46,6 +46,7 @@ import javax.servlet.http.HttpServletRequest;
46 46
 import javax.servlet.http.HttpServletResponse;
47 47
 
48 48
 import lombok.extern.slf4j.Slf4j;
49
+
49 50
 import org.mortbay.jetty.HttpConnection;
50 51
 import org.mortbay.jetty.Request;
51 52
 import org.mortbay.jetty.handler.AbstractHandler;
@@ -340,7 +341,7 @@ public class DynamicRequestHandler extends AbstractHandler {
340 341
 
341 342
         profileEvents.add(new Event("clearprofiles", null));
342 343
 
343
-        for (Identity identity : identityController.getIdentitiesByType("profile")) {
344
+        for (ConfigProvider identity : identityController.getIdentitiesByType("profile")) {
344 345
             profileEvents.add(new Event("addprofile", identity.getName()));
345 346
         }
346 347
 
@@ -389,8 +390,8 @@ public class DynamicRequestHandler extends AbstractHandler {
389 390
                 "target"));
390 391
     }
391 392
 
392
-    private Identity findProfile(final String parameter) {
393
-        for (Identity identity : identityController.getIdentitiesByType("profile")) {
393
+    private ConfigProvider findProfile(final String parameter) {
394
+        for (ConfigProvider identity : identityController.getIdentitiesByType("profile")) {
394 395
             if (identity.getName().equals(parameter)) {
395 396
                 return identity;
396 397
             }

Loading…
Cancelar
Guardar