Browse Source

Begin to remove deprecated IdentityManager methods.

Change-Id: I1fc7086057871a9b5f5f6d0ec790ec28b7ee067f
Depends-On: I7c24baa6f2e64302406e656a8931390aff9d3c9d
Reviewed-on: http://gerrit.dmdirc.com/2204
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.7rc1
Greg Holmes 12 years ago
parent
commit
14540d9688
69 changed files with 858 additions and 483 deletions
  1. 18
    10
      src/com/dmdirc/addons/dcc/DCCPlugin.java
  2. 10
    5
      src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java
  3. 20
    10
      src/com/dmdirc/addons/identd/IdentdPlugin.java
  4. 8
    4
      src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java
  5. 60
    16
      src/com/dmdirc/addons/logging/LoggingPlugin.java
  6. 3
    2
      src/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePlugin.java
  7. 13
    7
      src/com/dmdirc/addons/nickcolours/NickColourPlugin.java
  8. 16
    9
      src/com/dmdirc/addons/osd/OsdPlugin.java
  9. 42
    13
      src/com/dmdirc/addons/parser_twitter/TwitterPlugin.java
  10. 4
    2
      src/com/dmdirc/addons/relaybot/RelayBotPlugin.java
  11. 2
    1
      src/com/dmdirc/addons/systray/SystrayPlugin.java
  12. 22
    15
      src/com/dmdirc/addons/ui_swing/PrefsComponentFactory.java
  13. 72
    33
      src/com/dmdirc/addons/ui_swing/SwingController.java
  14. 6
    4
      src/com/dmdirc/addons/ui_swing/components/FileBrowser.java
  15. 2
    1
      src/com/dmdirc/addons/ui_swing/components/SwingSearchBar.java
  16. 14
    6
      src/com/dmdirc/addons/ui_swing/components/expandingsettings/SettingsPanel.java
  17. 4
    4
      src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java
  18. 8
    4
      src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java
  19. 14
    9
      src/com/dmdirc/addons/ui_swing/components/inputfields/ValidatingTextFieldInputField.java
  20. 1
    1
      src/com/dmdirc/addons/ui_swing/components/menubar/ChannelMenu.java
  21. 2
    2
      src/com/dmdirc/addons/ui_swing/components/menubar/ServerMenu.java
  22. 2
    2
      src/com/dmdirc/addons/ui_swing/components/menubar/SettingsMenu.java
  23. 9
    4
      src/com/dmdirc/addons/ui_swing/components/modes/ChannelModesPane.java
  24. 5
    5
      src/com/dmdirc/addons/ui_swing/components/modes/ModesPane.java
  25. 10
    10
      src/com/dmdirc/addons/ui_swing/components/modes/ParamModePanel.java
  26. 9
    4
      src/com/dmdirc/addons/ui_swing/components/modes/UserModesPane.java
  27. 5
    5
      src/com/dmdirc/addons/ui_swing/components/statusbar/ErrorPanel.java
  28. 1
    1
      src/com/dmdirc/addons/ui_swing/components/statusbar/GappedEtchedBorder.java
  29. 12
    13
      src/com/dmdirc/addons/ui_swing/components/statusbar/InviteLabel.java
  30. 9
    7
      src/com/dmdirc/addons/ui_swing/components/statusbar/MessageLabel.java
  31. 10
    5
      src/com/dmdirc/addons/ui_swing/components/statusbar/MessagePopup.java
  32. 4
    3
      src/com/dmdirc/addons/ui_swing/components/statusbar/SwingStatusBar.java
  33. 23
    17
      src/com/dmdirc/addons/ui_swing/components/statusbar/UpdaterLabel.java
  34. 8
    7
      src/com/dmdirc/addons/ui_swing/components/validating/ValidatingJTextField.java
  35. 7
    5
      src/com/dmdirc/addons/ui_swing/dialogs/ChannelJoinDialog.java
  36. 30
    26
      src/com/dmdirc/addons/ui_swing/dialogs/NewServerDialog.java
  37. 12
    4
      src/com/dmdirc/addons/ui_swing/dialogs/StandardInputDialog.java
  38. 15
    5
      src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionsPanel.java
  39. 8
    2
      src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionsTreePanel.java
  40. 29
    16
      src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionEditorDialog.java
  41. 12
    4
      src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionNamePanel.java
  42. 11
    5
      src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionGroupSettingsPanel.java
  43. 11
    4
      src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanel.java
  44. 16
    11
      src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsManagerDialog.java
  45. 16
    7
      src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasManagerDialog.java
  46. 10
    4
      src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasPanel.java
  47. 15
    9
      src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelListModesPane.java
  48. 25
    16
      src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java
  49. 12
    4
      src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryPanel.java
  50. 9
    4
      src/com/dmdirc/addons/ui_swing/dialogs/prefs/PrefsCategoryLoader.java
  51. 4
    2
      src/com/dmdirc/addons/ui_swing/dialogs/prefs/SwingPreferencesDialog.java
  52. 10
    4
      src/com/dmdirc/addons/ui_swing/dialogs/prefs/URLConfigPanel.java
  53. 15
    11
      src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileDetailPanel.java
  54. 15
    15
      src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileManagerDialog.java
  55. 9
    3
      src/com/dmdirc/addons/ui_swing/dialogs/serverlist/AddEntryInputDialog.java
  56. 8
    2
      src/com/dmdirc/addons/ui_swing/dialogs/serverlist/AddGroupInputDialog.java
  57. 17
    10
      src/com/dmdirc/addons/ui_swing/dialogs/serverlist/ServerListDialog.java
  58. 9
    4
      src/com/dmdirc/addons/ui_swing/dialogs/serverlist/Settings.java
  59. 9
    3
      src/com/dmdirc/addons/ui_swing/dialogs/serverlist/Tree.java
  60. 14
    7
      src/com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListPanel.java
  61. 21
    11
      src/com/dmdirc/addons/ui_swing/dialogs/serversetting/ServerSettingsDialog.java
  62. 1
    1
      src/com/dmdirc/addons/ui_swing/framemanager/ctrltab/CtrlTabWindowManager.java
  63. 1
    2
      src/com/dmdirc/addons/ui_swing/framemanager/tree/NodeLabel.java
  64. 9
    9
      src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeFrameManager.java
  65. 10
    18
      src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeViewModel.java
  66. 5
    6
      src/com/dmdirc/addons/ui_swing/wizard/firstrun/SwingFirstRunWizard.java
  67. 8
    4
      src/com/dmdirc/addons/windowflashing/WindowFlashing.java
  68. 6
    3
      src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java
  69. 1
    1
      test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanelTest.java

+ 18
- 10
src/com/dmdirc/addons/dcc/DCCPlugin.java View File

@@ -745,42 +745,50 @@ public final class DCCPlugin extends BasePlugin implements ActionListener {
745 745
 
746 746
         firewall.addSetting(new PreferencesSetting(PreferencesType.TEXT,
747 747
                 getDomain(), "firewall.ip", "Forced IP",
748
-                "What IP should be sent as our IP (Blank = work it out)"));
748
+                "What IP should be sent as our IP (Blank = work it out)",
749
+                manager.getConfigManager(), manager.getIdentity()));
749 750
         firewall.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
750 751
                 getDomain(), "firewall.ports.usePortRange", "Use Port Range",
751 752
                 "Useful if you have a firewall that only forwards specific "
752
-                + "ports"));
753
+                + "ports", manager.getConfigManager(), manager.getIdentity()));
753 754
         firewall.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
754 755
                 getDomain(), "firewall.ports.startPort", "Start Port",
755
-                "Port to try to listen on first"));
756
+                "Port to try to listen on first", manager.getConfigManager(),
757
+                manager.getIdentity()));
756 758
         firewall.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
757 759
                 getDomain(), "firewall.ports.endPort", "End Port",
758
-                "Port to try to listen on last"));
760
+                "Port to try to listen on last", manager.getConfigManager(),
761
+                manager.getIdentity()));
759 762
         receiving.addSetting(new PreferencesSetting(PreferencesType.DIRECTORY,
760 763
                 getDomain(), "receive.savelocation", "Default save location",
761
-                "Where the save as window defaults to?"));
764
+                "Where the save as window defaults to?",
765
+                manager.getConfigManager(), manager.getIdentity()));
762 766
         sending.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
763 767
                 getDomain(), "send.reverse", "Reverse DCC",
764 768
                 "With reverse DCC, the sender connects rather than "
765
-                + "listens like normal dcc"));
769
+                + "listens like normal dcc", manager.getConfigManager(),
770
+                manager.getIdentity()));
766 771
         sending.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
767 772
                 getDomain(), "send.forceturbo", "Use Turbo DCC",
768 773
                 "Turbo DCC doesn't wait for ack packets. this is "
769
-                + "faster but not always supported."));
774
+                + "faster but not always supported.",
775
+                manager.getConfigManager(), manager.getIdentity()));
770 776
         receiving.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
771 777
                 getDomain(), "receive.reverse.sendtoken",
772 778
                 "Send token in reverse receive",
773 779
                 "If you have problems with reverse dcc receive resume,"
774
-                + " try toggling this."));
780
+                + " try toggling this.", manager.getConfigManager(),
781
+                manager.getIdentity()));
775 782
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
776 783
                 getDomain(), "send.blocksize", "Blocksize to use for DCC",
777 784
                 "Change the block size for send/receive, this can "
778
-                + "sometimes speed up transfers."));
785
+                + "sometimes speed up transfers.", manager.getConfigManager(),
786
+                manager.getIdentity()));
779 787
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
780 788
                 getDomain(), "general.percentageInTitle",
781 789
                 "Show percentage of transfers in the window title",
782 790
                 "Show the current percentage of transfers in the DCC window "
783
-                + "title"));
791
+                + "title", manager.getConfigManager(), manager.getIdentity()));
784 792
     }
785 793
 
786 794
 }

+ 10
- 5
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java View File

@@ -195,19 +195,24 @@ public final class FreeDesktopNotificationsPlugin
195 195
 
196 196
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
197 197
                 getDomain(), "general.timeout", "Timeout",
198
-                "Length of time in seconds before the notification popup closes."));
198
+                "Length of time in seconds before the notification popup closes.",
199
+                manager.getConfigManager(), manager.getIdentity()));
199 200
         general.addSetting(new PreferencesSetting(PreferencesType.FILE,
200 201
                 getDomain(), "general.icon", "icon",
201
-                "Path to icon to use on the notification."));
202
+                "Path to icon to use on the notification.",
203
+                manager.getConfigManager(), manager.getIdentity()));
202 204
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
203 205
                 getDomain(), "advanced.escapehtml", "Escape HTML",
204
-                "Some Implementations randomly parse HTML, escape it before showing?"));
206
+                "Some Implementations randomly parse HTML, escape it before showing?",
207
+                manager.getConfigManager(), manager.getIdentity()));
205 208
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
206 209
                 getDomain(), "advanced.strictescape", "Strict Escape HTML",
207
-                "Strictly escape HTML or just the basic characters? (&, < and >)"));
210
+                "Strictly escape HTML or just the basic characters? (&, < and >)",
211
+                manager.getConfigManager(), manager.getIdentity()));
208 212
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
209 213
                 getDomain(), "advanced.stripcodes", "Strip Control Codes",
210
-                "Strip IRC Control codes from messages?"));
214
+                "Strip IRC Control codes from messages?",
215
+                manager.getConfigManager(), manager.getIdentity()));
211 216
 
212 217
         manager.getCategory("Plugins").addSubCategory(general);
213 218
     }

+ 20
- 10
src/com/dmdirc/addons/identd/IdentdPlugin.java View File

@@ -144,46 +144,56 @@ public class IdentdPlugin extends BasePlugin implements ActionListener {
144 144
                 getDomain(), "general.useUsername", "Use connection " +
145 145
                 "username rather than system username", "If this is enabled," +
146 146
                 " the username for the connection will be used rather than " +
147
-                "'" + System.getProperty("user.name") + "'"));
147
+                "'" + System.getProperty("user.name") + "'",
148
+                manager.getConfigManager(), manager.getIdentity()));
148 149
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
149 150
                 getDomain(), "general.useNickname", "Use connection " +
150 151
                 "nickname rather than system username", "If this is enabled, " +
151 152
                 "the nickname for the connection will be used rather than " +
152
-                "'" + System.getProperty("user.name") + "'"));
153
+                "'" + System.getProperty("user.name") + "'",
154
+                manager.getConfigManager(), manager.getIdentity()));
153 155
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
154 156
                 getDomain(), "general.useCustomName", "Use custom name" +
155 157
                 " all the time", "If this is enabled, the name specified below" +
156
-                " will be used all the time"));
158
+                " will be used all the time", manager.getConfigManager(),
159
+                manager.getIdentity()));
157 160
         general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
158 161
                 getDomain(), "general.customName", "Custom Name to use",
159
-                "The custom name to use when 'Use Custom Name' is enabled"));
162
+                "The custom name to use when 'Use Custom Name' is enabled",
163
+                manager.getConfigManager(), manager.getIdentity()));
160 164
 
161 165
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
162 166
                 getDomain(), "advanced.alwaysOn", "Always have ident " +
163 167
                 "port open", "By default the identd only runs when there are " +
164
-                "active connection attempts. This overrides that."));
168
+                "active connection attempts. This overrides that.",
169
+                manager.getConfigManager(), manager.getIdentity()));
165 170
         advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
166 171
                 new PortValidator(), getDomain(), "advanced.port",
167 172
                 "What port should the identd listen on", "Default port is 113," +
168 173
                 " this is probably useless if changed unless you port forward" +
169
-                " ident to a different port"));
174
+                " ident to a different port", manager.getConfigManager(),
175
+                manager.getIdentity()));
170 176
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
171 177
                 getDomain(), "advanced.useCustomSystem", "Use custom OS",
172 178
                 "By default the plugin uses 'UNIX' or 'WIN32' as the system " +
173
-                "type, this can be overriden by enabling this."));
179
+                "type, this can be overriden by enabling this.",
180
+                manager.getConfigManager(), manager.getIdentity()));
174 181
         advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT,
175 182
                 getDomain(), "advanced.customSystem", "Custom OS to use",
176
-                "The custom system to use when 'Use Custom System' is enabled"));
183
+                "The custom system to use when 'Use Custom System' is enabled",
184
+                manager.getConfigManager(), manager.getIdentity()));
177 185
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
178 186
                 getDomain(), "advanced.isHiddenUser", "Respond to ident" +
179 187
                 " requests with HIDDEN-USER error", "By default the plugin will" +
180 188
                 " give a USERID response, this can force an 'ERROR :" +
181
-                " HIDDEN-USER' response instead."));
189
+                " HIDDEN-USER' response instead.", manager.getConfigManager(),
190
+                manager.getIdentity()));
182 191
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
183 192
                 getDomain(), "advanced.isNoUser", "Respond to ident" +
184 193
                 " requests with NO-USER error", "By default the plugin will" +
185 194
                 " give a USERID response, this can force an 'ERROR : NO-USER'" +
186
-                " response instead. (Overrides HIDDEN-USER)"));
195
+                " response instead. (Overrides HIDDEN-USER)",
196
+                manager.getConfigManager(), manager.getIdentity()));
187 197
 
188 198
         manager.getCategory("Plugins").addSubCategory(general);
189 199
         general.addSubCategory(advanced);

+ 8
- 4
src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java View File

@@ -275,16 +275,20 @@ public final class LagDisplayPlugin extends BasePlugin implements
275 275
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
276 276
                 getDomain(), "usealternate",
277 277
                 "Alternate method", "Use an alternate method of determining "
278
-                + "lag which bypasses bouncers or proxies that may reply?"));
278
+                + "lag which bypasses bouncers or proxies that may reply?",
279
+                manager.getConfigManager(), manager.getIdentity()));
279 280
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
280 281
                 getDomain(), "graph", "Show graph", "Show a graph of ping times " +
281
-                "for the current server in the information popup?"));
282
+                "for the current server in the information popup?",
283
+                manager.getConfigManager(), manager.getIdentity()));
282 284
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
283 285
                 getDomain(), "labels", "Show labels", "Show labels on selected " +
284
-                "points on the ping graph?"));
286
+                "points on the ping graph?",
287
+                manager.getConfigManager(), manager.getIdentity()));
285 288
         cat.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
286 289
                 getDomain(), "history", "Graph points", "Number of data points " +
287
-                "to plot on the graph, if enabled."));
290
+                "to plot on the graph, if enabled.",
291
+                manager.getConfigManager(), manager.getIdentity()));
288 292
         manager.getCategory("Plugins").addSubCategory(cat);
289 293
     }
290 294
 

+ 60
- 16
src/com/dmdirc/addons/logging/LoggingPlugin.java View File

@@ -229,22 +229,66 @@ public class LoggingPlugin extends BasePlugin implements ActionListener,
229 229
         final PreferencesCategory advanced = new PluginPreferencesCategory(
230 230
                 pluginInfo, "Advanced", "Advanced configuration for Logging plugin. You shouldn't need to edit this unless you know what you are doing.");
231 231
 
232
-        general.addSetting(new PreferencesSetting(PreferencesType.DIRECTORY, getDomain(), "general.directory", "Directory", "Directory for log files"));
233
-        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "general.networkfolders", "Separate logs by network", "Should the files be stored in a sub-dir with the networks name?"));
234
-        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "general.addtime", "Timestamp logs", "Should a timestamp be added to the log files?"));
235
-        general.addSetting(new PreferencesSetting(PreferencesType.TEXT, getDomain(), "general.timestamp", "Timestamp format", "The String to pass to 'SimpleDateFormat' to format the timestamp"));
236
-        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "general.stripcodes", "Strip Control Codes", "Remove known irc control codes from lines before saving?"));
237
-        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "general.channelmodeprefix", "Show channel mode prefix", "Show the @,+ etc next to nicknames"));
238
-
239
-        backbuffer.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "backbuffer.autobackbuffer", "Automatically display", "Automatically display the backbuffer when a channel is joined"));
240
-        backbuffer.addSetting(new PreferencesSetting(PreferencesType.COLOUR, getDomain(), "backbuffer.colour", "Colour to use for display", "Colour used when displaying the backbuffer"));
241
-        backbuffer.addSetting(new PreferencesSetting(PreferencesType.INTEGER, getDomain(), "backbuffer.lines", "Number of lines to show", "Number of lines used when displaying backbuffer"));
242
-        backbuffer.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "backbuffer.timestamp", "Show Formatter-Timestamp", "Should the line be added to the frame with the timestamp from the formatter aswell as the file contents"));
243
-
244
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.filenamehash", "Add Filename hash", "Add the MD5 hash of the channel/client name to the filename. (This is used to allow channels with similar names (ie a _ not a  -) to be logged separately)"));
245
-
246
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.usedate", "Use Date directories", "Should the log files be in separate directories based on the date?"));
247
-        advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT, getDomain(), "advanced.usedateformat", "Archive format", "The String to pass to 'SimpleDateFormat' to format the directory name(s) for archiving"));
232
+        general.addSetting(new PreferencesSetting(PreferencesType.DIRECTORY,
233
+                getDomain(), "general.directory", "Directory",
234
+                "Directory for log files", manager.getConfigManager(),
235
+                manager.getIdentity()));
236
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
237
+                getDomain(), "general.networkfolders",
238
+                "Separate logs by network",
239
+                "Should the files be stored in a sub-dir with the networks name?",
240
+                manager.getConfigManager(), manager.getIdentity()));
241
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
242
+                getDomain(), "general.addtime", "Timestamp logs",
243
+                "Should a timestamp be added to the log files?",
244
+                manager.getConfigManager(), manager.getIdentity()));
245
+        general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
246
+                getDomain(), "general.timestamp", "Timestamp format",
247
+                "The String to pass to 'SimpleDateFormat' to format the timestamp",
248
+                manager.getConfigManager(), manager.getIdentity()));
249
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
250
+                getDomain(), "general.stripcodes", "Strip Control Codes",
251
+                "Remove known irc control codes from lines before saving?",
252
+                manager.getConfigManager(), manager.getIdentity()));
253
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
254
+                getDomain(), "general.channelmodeprefix",
255
+                "Show channel mode prefix", "Show the @,+ etc next to nicknames",
256
+                manager.getConfigManager(), manager.getIdentity()));
257
+
258
+        backbuffer.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
259
+                getDomain(), "backbuffer.autobackbuffer", "Automatically display",
260
+                "Automatically display the backbuffer when a channel is joined",
261
+                manager.getConfigManager(), manager.getIdentity()));
262
+        backbuffer.addSetting(new PreferencesSetting(PreferencesType.COLOUR,
263
+                getDomain(), "backbuffer.colour", "Colour to use for display",
264
+                "Colour used when displaying the backbuffer",
265
+                manager.getConfigManager(), manager.getIdentity()));
266
+        backbuffer.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
267
+                getDomain(), "backbuffer.lines", "Number of lines to show",
268
+                "Number of lines used when displaying backbuffer",
269
+                manager.getConfigManager(), manager.getIdentity()));
270
+        backbuffer.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
271
+                getDomain(), "backbuffer.timestamp", "Show Formatter-Timestamp",
272
+                "Should the line be added to the frame with the timestamp from "
273
+                + "the formatter aswell as the file contents",
274
+                manager.getConfigManager(), manager.getIdentity()));
275
+
276
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
277
+                getDomain(), "advanced.filenamehash", "Add Filename hash",
278
+                "Add the MD5 hash of the channel/client name to the filename. "
279
+                + "(This is used to allow channels with similar names "
280
+                + "(ie a _ not a  -) to be logged separately)",
281
+                manager.getConfigManager(), manager.getIdentity()));
282
+
283
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
284
+                getDomain(), "advanced.usedate", "Use Date directories",
285
+                "Should the log files be in separate directories based on the date?",
286
+                manager.getConfigManager(), manager.getIdentity()));
287
+        advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT,
288
+                getDomain(), "advanced.usedateformat", "Archive format",
289
+                "The String to pass to 'SimpleDateFormat' to format the "
290
+                + "directory name(s) for archiving",
291
+                manager.getConfigManager(), manager.getIdentity()));
248 292
 
249 293
         general.addSubCategory(backbuffer.setInline());
250 294
         general.addSubCategory(advanced.setInline());

+ 3
- 2
src/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePlugin.java View File

@@ -211,7 +211,7 @@ public class VlcMediaSourcePlugin extends BasePlugin implements MediaSource {
211 211
 
212 212
         final PreferencesSetting setting = new PreferencesSetting(
213 213
                 PreferencesType.LABEL, getDomain(), "", "Instructions",
214
-                "Instructions");
214
+                "Instructions", manager.getConfigManager(), manager.getIdentity());
215 215
         setting.setValue("<html><p>"
216 216
                 + "The VLC media source requires that VLC's web interface is"
217 217
                 + " enabled. To do this, follow the steps below:</p>"
@@ -237,7 +237,8 @@ public class VlcMediaSourcePlugin extends BasePlugin implements MediaSource {
237 237
         general.addSetting(setting);
238 238
         general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
239 239
                 getDomain(), "host", "Hostname and port",
240
-                "The host and port that VLC listens on for web connections"));
240
+                "The host and port that VLC listens on for web connections",
241
+                manager.getConfigManager(), manager.getIdentity()));
241 242
 
242 243
         manager.getCategory("Plugins").addSubCategory(general);
243 244
     }

+ 13
- 7
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java View File

@@ -277,27 +277,33 @@ public final class NickColourPlugin extends BasePlugin implements ActionListener
277 277
 
278 278
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
279 279
                 "ui", "shownickcoloursintext", "Show colours in text area",
280
-                "Colour nicknames in main text area?"));
280
+                "Colour nicknames in main text area?",
281
+                manager.getConfigManager(), manager.getIdentity()));
281 282
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
282 283
                 "ui", "shownickcoloursinnicklist", "Show colours in"
283
-                + " nick list", "Colour nicknames in channel nick lists?"));
284
+                + " nick list", "Colour nicknames in channel nick lists?",
285
+                manager.getConfigManager(), manager.getIdentity()));
284 286
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
285 287
                 getDomain(), "settext", "Set colours in textarea",
286
-                "Should the plugin set the textarea colour of nicks?"));
288
+                "Should the plugin set the textarea colour of nicks?",
289
+                manager.getConfigManager(), manager.getIdentity()));
287 290
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
288 291
                 getDomain(), "setnicklist", "Set colours in nick list",
289
-                "Should the plugin set the nick list colour of nicks?"));
292
+                "Should the plugin set the nick list colour of nicks?",
293
+                manager.getConfigManager(), manager.getIdentity()));
290 294
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
291 295
                 getDomain(), "userandomcolour", "Use random colour",
292
-                "Use a pseudo-random colour for each person?"));
296
+                "Use a pseudo-random colour for each person?",
297
+                manager.getConfigManager(), manager.getIdentity()));
293 298
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
294 299
                 getDomain(), "useowncolour", "Use colour for own nick",
295
-                "Always use the same colour for our own nickname?"));
300
+                "Always use the same colour for our own nickname?",
301
+                manager.getConfigManager(), manager.getIdentity()));
296 302
         general.addSetting(
297 303
                 new PreferencesSetting(PreferencesType.COLOUR, getDomain(),
298 304
                 "owncolour", "Colour to use for own nick",
299 305
                 "Colour used for our own nickname, if above setting is "
300
-                + "enabled."));
306
+                + "enabled.", manager.getConfigManager(), manager.getIdentity()));
301 307
 
302 308
         general.addSubCategory(colours);
303 309
         manager.getCategory("Plugins").addSubCategory(general);

+ 16
- 9
src/com/dmdirc/addons/osd/OsdPlugin.java View File

@@ -83,24 +83,30 @@ public final class OsdPlugin extends BasePlugin implements
83 83
 
84 84
         fontSizeSetting = new PreferencesSetting(PreferencesType.INTEGER,
85 85
                 getDomain(), "fontSize", "Font size", "Changes the font " +
86
-                "size of the OSD").registerChangeListener(this);
86
+                "size of the OSD", manager.getConfigManager(),
87
+                manager.getIdentity()).registerChangeListener(this);
87 88
         backgroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
88 89
                 getDomain(), "bgcolour", "Background colour",
89
-                "Background colour for the OSD").registerChangeListener(this);
90
+                "Background colour for the OSD", manager.getConfigManager(),
91
+                manager.getIdentity()).registerChangeListener(this);
90 92
         foregroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
91 93
                 getDomain(), "fgcolour", "Foreground colour",
92
-                "Foreground colour for the OSD").registerChangeListener(this);
94
+                "Foreground colour for the OSD", manager.getConfigManager(),
95
+                manager.getIdentity()).registerChangeListener(this);
93 96
         widthSetting = new PreferencesSetting(PreferencesType.INTEGER,
94
-                getDomain(), "width", "OSD Width", "Width of the OSD Window").
95
-                registerChangeListener(this);
97
+                getDomain(), "width", "OSD Width", "Width of the OSD Window",
98
+                manager.getConfigManager(), manager.getIdentity())
99
+                .registerChangeListener(this);
96 100
         timeoutSetting = new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
97 101
                 new OptionalValidator(new NumericalValidator(1, Integer.MAX_VALUE)),
98 102
                 getDomain(), "timeout", "Timeout", "Length of time in " +
99
-                "seconds before the OSD window closes");
103
+                "seconds before the OSD window closes", manager.getConfigManager(),
104
+                manager.getIdentity());
100 105
         maxWindowsSetting = new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
101 106
                 new OptionalValidator(new NumericalValidator(1, Integer.MAX_VALUE)),
102
-                getDomain(), "maxWindows", "Maximum open windows", "Maximum number of OSD " +
103
-                "windows that will be displayed at any given time");
107
+                getDomain(), "maxWindows", "Maximum open windows",
108
+                "Maximum number of OSD windows that will be displayed at any given time",
109
+                manager.getConfigManager(), manager.getIdentity());
104 110
 
105 111
         category.addSetting(fontSizeSetting);
106 112
         category.addSetting(backgroundSetting);
@@ -118,7 +124,8 @@ public final class OsdPlugin extends BasePlugin implements
118 124
 
119 125
         category.addSetting(new PreferencesSetting(getDomain(), "newbehaviour",
120 126
                 "New window policy", "What to do when an OSD Window "
121
-                + "is opened when there are other, existing windows open", posOptions));
127
+                + "is opened when there are other, existing windows open",
128
+                posOptions, manager.getConfigManager(), manager.getIdentity()));
122 129
 
123 130
         category.addChangeListener(this);
124 131
         manager.getCategory("Plugins").addSubCategory(category);

+ 42
- 13
src/com/dmdirc/addons/parser_twitter/TwitterPlugin.java View File

@@ -98,19 +98,48 @@ public class TwitterPlugin extends BasePlugin {
98 98
     /** {@inheritDoc} */
99 99
     @Override
100 100
     public void showConfig(final PreferencesDialogModel manager) {
101
-        final PreferencesCategory category = new PluginPreferencesCategory(pluginInfo, "Twitter Plugin", "Settings related to the twitter plugin", "category-twitter");
102
-        final PreferencesCategory advanced = new PluginPreferencesCategory(pluginInfo, "Advanced", "Advanced Settings related to the twitter plugin", "category-twitter");
103
-
104
-        category.addSetting(new PreferencesSetting(PreferencesType.INTEGER, getDomain(), "statuscount", "Statuses to request", "How many statuses to request at a time?"));
105
-        category.addSetting(new PreferencesSetting(PreferencesType.INTEGER, getDomain(), "apicalls", "API Calls", "Aim to only use how many API Calls per hour? (Twitter has a max of 350)"));
106
-        category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "saveLastIDs", "Remember shown items", "Should previously shown items not be shown again next time?"));
107
-        category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "getSentMessages", "Show own Direct Messages", "Should we try to show our own direct messages to people not just ones to us?"));
108
-
109
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "autoAt", "Prepend nicknames with @", "Should all nicknmaes be shown with an @ infront of them? (Makes tab competion easier)"));
110
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "replaceOpeningNickname", "Replace opening nickame?", "Should nicknames at the start of the message be replaced? (eg Replace foo: with @foo)"));
111
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "debugEnabled", "Debugging Enabled?", "Should more debugging be enabled on the twitter plugin?"));
112
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "hide500Errors", "Hide HTTP 50x Errors", "At times twitter gives a lot of 502/503 errors. Should this be hidden from you?"));
113
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "autoLeaveMessageChannel", "Leave & channels automatically?", "Should you automatically be parted from & channels after sending a message?"));
101
+        final PreferencesCategory category = new PluginPreferencesCategory(pluginInfo,
102
+                "Twitter Plugin", "Settings related to the twitter plugin", "category-twitter");
103
+        final PreferencesCategory advanced = new PluginPreferencesCategory(pluginInfo,
104
+                "Advanced", "Advanced Settings related to the twitter plugin", "category-twitter");
105
+
106
+        category.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
107
+                getDomain(), "statuscount", "Statuses to request",
108
+                "How many statuses to request at a time?",
109
+                manager.getConfigManager(), manager.getIdentity()));
110
+        category.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
111
+                getDomain(), "apicalls", "API Calls",
112
+                "Aim to only use how many API Calls per hour? (Twitter has a max of 350)",
113
+                manager.getConfigManager(), manager.getIdentity()));
114
+        category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
115
+                getDomain(), "saveLastIDs", "Remember shown items",
116
+                "Should previously shown items not be shown again next time?",
117
+                manager.getConfigManager(), manager.getIdentity()));
118
+        category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
119
+                getDomain(), "getSentMessages", "Show own Direct Messages",
120
+                "Should we try to show our own direct messages to people not just ones to us?",
121
+                manager.getConfigManager(), manager.getIdentity()));
122
+
123
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
124
+                getDomain(), "autoAt", "Prepend nicknames with @",
125
+                "Should all nicknmaes be shown with an @ infront of them? (Makes tab competion easier)",
126
+                manager.getConfigManager(), manager.getIdentity()));
127
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
128
+                getDomain(), "replaceOpeningNickname", "Replace opening nickame?",
129
+                "Should nicknames at the start of the message be replaced? (eg Replace foo: with @foo)",
130
+                manager.getConfigManager(), manager.getIdentity()));
131
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
132
+                getDomain(), "debugEnabled", "Debugging Enabled?",
133
+                "Should more debugging be enabled on the twitter plugin?",
134
+                manager.getConfigManager(), manager.getIdentity()));
135
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
136
+                getDomain(), "hide500Errors", "Hide HTTP 50x Errors",
137
+                "At times twitter gives a lot of 502/503 errors. Should this be hidden from you?",
138
+                manager.getConfigManager(), manager.getIdentity()));
139
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
140
+                getDomain(), "autoLeaveMessageChannel", "Leave & channels automatically?",
141
+                "Should you automatically be parted from & channels after sending a message?",
142
+                manager.getConfigManager(), manager.getIdentity()));
114 143
 
115 144
         category.addSubCategory(advanced);
116 145
 

+ 4
- 2
src/com/dmdirc/addons/relaybot/RelayBotPlugin.java View File

@@ -296,10 +296,12 @@ public class RelayBotPlugin extends BasePlugin implements ActionListener, Config
296 296
         colours.setInline().setInlineAfter();
297 297
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
298 298
                 getDomain(), "joinOnDiscover", "Join on discover",
299
-                "Do you want fake clients to join the channel?"));
299
+                "Do you want fake clients to join the channel?",
300
+                manager.getConfigManager(), manager.getIdentity()));
300 301
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
301 302
                 getDomain(), "colourFullName", "Colour full name",
302
-                "Do you want to colour the full name?"));
303
+                "Do you want to colour the full name?",
304
+                manager.getConfigManager(), manager.getIdentity()));
303 305
         manager.getCategory("Plugins").addSubCategory(general);
304 306
         general.addSubCategory(colours);
305 307
     }

+ 2
- 1
src/com/dmdirc/addons/systray/SystrayPlugin.java View File

@@ -190,7 +190,8 @@ public final class SystrayPlugin extends BasePlugin implements ActionListener,
190 190
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
191 191
                 getDomain(), "autominimise", "Auto-hide DMDirc when minimised",
192 192
                 "If this option is enabled, the systray plugin will hide DMDirc"
193
-                + " to the system tray whenever DMDirc is minimised"));
193
+                + " to the system tray whenever DMDirc is minimised",
194
+                manager.getConfigManager(), manager.getIdentity()));
194 195
 
195 196
         manager.getCategory("Plugins").addSubCategory(category);
196 197
     }

+ 22
- 15
src/com/dmdirc/addons/ui_swing/PrefsComponentFactory.java View File

@@ -65,11 +65,17 @@ import org.jdesktop.jxlayer.JXLayer;
65 65
  */
66 66
 public final class PrefsComponentFactory {
67 67
 
68
+    /** Swing Controller. */
69
+    private final SwingController controller;
70
+
68 71
     /**
69 72
      * Creates a new instance of PrefsComponentFactory.
73
+     *
74
+     * @param controller Swing Controller
70 75
      */
71
-    private PrefsComponentFactory() {
72
-        // Shouldn't be initialised
76
+    protected PrefsComponentFactory(final SwingController controller) {
77
+        this.controller = controller;
78
+
73 79
     }
74 80
 
75 81
     /**
@@ -80,7 +86,7 @@ public final class PrefsComponentFactory {
80 86
      * @param setting The setting whose component is being requested
81 87
      * @return An appropriate JComponent descendant
82 88
      */
83
-    public static JComponent getComponent(final PreferencesSetting setting) {
89
+    public JComponent getComponent(final PreferencesSetting setting) {
84 90
         JComponent option;
85 91
 
86 92
         switch (setting.getType()) {
@@ -142,9 +148,9 @@ public final class PrefsComponentFactory {
142 148
      * @param setting The setting to create the component for
143 149
      * @return A JComponent descendent for the specified setting
144 150
      */
145
-    private static JComponent getTextOption(final PreferencesSetting setting) {
151
+    private JComponent getTextOption(final PreferencesSetting setting) {
146 152
         final ValidatingJTextField option = new ValidatingJTextField(
147
-                setting.getValidator());
153
+                controller.getIconManager(), setting.getValidator());
148 154
         option.setText(setting.getValue());
149 155
 
150 156
         option.addKeyListener(new KeyAdapter() {
@@ -163,7 +169,7 @@ public final class PrefsComponentFactory {
163 169
      * @param setting The setting to create the component for
164 170
      * @return A JComponent descendent for the specified setting
165 171
      */
166
-    private static JComponent getBooleanOption(
172
+    private JComponent getBooleanOption(
167 173
             final PreferencesSetting setting) {
168 174
         final JCheckBox option = new JCheckBox();
169 175
         option.setSelected(Boolean.parseBoolean(setting.getValue()));
@@ -187,7 +193,7 @@ public final class PrefsComponentFactory {
187 193
      * @param setting The setting to create the component for
188 194
      * @return A JComponent descendent for the specified setting
189 195
      */
190
-    private static JComponent getComboOption(final PreferencesSetting setting) {
196
+    private JComponent getComboOption(final PreferencesSetting setting) {
191 197
         final JComboBox option = new JComboBox(setting.getComboOptions()
192 198
                 .entrySet().toArray());
193 199
         option.setRenderer(new MapEntryRenderer());
@@ -223,7 +229,7 @@ public final class PrefsComponentFactory {
223 229
      * @param setting The setting to create the component for
224 230
      * @return A JComponent descendent for the specified setting
225 231
      */
226
-    private static JComponent getIntegerOption(
232
+    private JComponent getIntegerOption(
227 233
             final PreferencesSetting setting) {
228 234
         JSpinner option;
229 235
 
@@ -269,7 +275,7 @@ public final class PrefsComponentFactory {
269 275
      * @param setting The setting to create the component for
270 276
      * @return A JComponent descendent for the specified setting
271 277
      */
272
-    private static JComponent getOptionalIntegerOption(
278
+    private JComponent getOptionalIntegerOption(
273 279
             final PreferencesSetting setting) {
274 280
         final boolean state = setting.getValue() != null
275 281
                 && !setting.getValue().startsWith("false:");
@@ -323,7 +329,7 @@ public final class PrefsComponentFactory {
323 329
      * @param setting The setting to create the component for
324 330
      * @return A JComponent descendent for the specified setting
325 331
      */
326
-    private static JComponent getDurationOption(
332
+    private JComponent getDurationOption(
327 333
             final PreferencesSetting setting) {
328 334
         DurationDisplay option;
329 335
 
@@ -351,7 +357,7 @@ public final class PrefsComponentFactory {
351 357
      * @param setting The setting to create the component for
352 358
      * @return A JComponent descendent for the specified setting
353 359
      */
354
-    private static JComponent getColourOption(
360
+    private JComponent getColourOption(
355 361
             final PreferencesSetting setting) {
356 362
         final OptionalColourChooser option = new OptionalColourChooser(
357 363
                 setting.getValue(), true, true, true);
@@ -378,7 +384,7 @@ public final class PrefsComponentFactory {
378 384
      * @param setting The setting to create the component for
379 385
      * @return A JComponent descendent for the specified setting
380 386
      */
381
-    private static JComponent getOptionalColourOption(
387
+    private JComponent getOptionalColourOption(
382 388
             final PreferencesSetting setting) {
383 389
         final boolean state = setting.getValue() != null
384 390
                 && !setting.getValue().startsWith("false:");
@@ -408,7 +414,7 @@ public final class PrefsComponentFactory {
408 414
      * @param setting The setting to create the component for
409 415
      * @return A JComponent descendent for the specified setting
410 416
      */
411
-    private static JComponent getFontOption(final PreferencesSetting setting) {
417
+    private JComponent getFontOption(final PreferencesSetting setting) {
412 418
         final String value = setting.getValue();
413 419
 
414 420
         final FontPicker option = new FontPicker(value);
@@ -439,9 +445,10 @@ public final class PrefsComponentFactory {
439 445
      *
440 446
      * @return A JComponent descendent for the specified setting
441 447
      */
442
-    private static JComponent getFileBrowseOption(
448
+    private JComponent getFileBrowseOption(
443 449
             final PreferencesSetting setting, final int type) {
444
-        final FileBrowser option = new FileBrowser(setting, type);
450
+        final FileBrowser option = new FileBrowser(controller.getIconManager(),
451
+                setting, type);
445 452
 
446 453
         option.addActionListener(new ActionListener() {
447 454
             /** {@inheritDoc} */

+ 72
- 33
src/com/dmdirc/addons/ui_swing/SwingController.java View File

@@ -56,6 +56,7 @@ import com.dmdirc.ui.core.util.URLHandler;
56 56
 import com.dmdirc.interfaces.ui.InputWindow;
57 57
 import com.dmdirc.interfaces.ui.UIController;
58 58
 import com.dmdirc.interfaces.ui.Window;
59
+import com.dmdirc.ui.IconManager;
59 60
 import com.dmdirc.updater.Version;
60 61
 import com.dmdirc.util.ReturnableThread;
61 62
 import com.dmdirc.util.validators.NumericalValidator;
@@ -80,6 +81,7 @@ import javax.swing.UnsupportedLookAndFeelException;
80 81
 import javax.swing.UIManager.LookAndFeelInfo;
81 82
 
82 83
 import lombok.Getter;
84
+
83 85
 import net.miginfocom.layout.PlatformDefaults;
84 86
 
85 87
 /**
@@ -129,6 +131,12 @@ public class SwingController extends BasePlugin implements UIController {
129 131
     /** Addon config identity. */
130 132
     @Getter
131 133
     private final Identity addonIdentity;
134
+    /** Global Swing UI Icon manager. */
135
+    @Getter
136
+    private final IconManager iconManager;
137
+    /** Prefs component factory instance. */
138
+    @Getter
139
+    private final PrefsComponentFactory prefsComponentFactory;
132 140
 
133 141
     /**
134 142
      * Instantiates a new SwingController.
@@ -144,6 +152,8 @@ public class SwingController extends BasePlugin implements UIController {
144 152
                 .getGlobalConfigIdentity();
145 153
         addonIdentity = IdentityManager.getIdentityManager()
146 154
                 .getGlobalAddonIdentity();
155
+        iconManager = new IconManager(globalConfig);
156
+        prefsComponentFactory = new PrefsComponentFactory(this);
147 157
         setAntiAlias();
148 158
         windows = new ArrayList<java.awt.Window>();
149 159
         registerCommand(new ServerSettings(), ServerSettings.INFO);
@@ -214,9 +224,9 @@ public class SwingController extends BasePlugin implements UIController {
214 224
             /** {@inheritDoc} */
215 225
             @Override
216 226
             public void run() {
217
-                ChannelSettingsDialog.showChannelSettingsDialog(channel,
218
-                        getMainFrame(), (InputWindow) getWindowFactory()
219
-                        .getSwingWindow(channel));
227
+                ChannelSettingsDialog.showChannelSettingsDialog(
228
+                        SwingController.this, channel, getMainFrame(),
229
+                        (InputWindow) getWindowFactory().getSwingWindow(channel));
220 230
             }
221 231
         });
222 232
     }
@@ -230,7 +240,7 @@ public class SwingController extends BasePlugin implements UIController {
230 240
             @Override
231 241
             public void run() {
232 242
                 ServerSettingsDialog.showServerSettingsDialog(
233
-                        server, getMainFrame());
243
+                        SwingController.this, server, getMainFrame());
234 244
             }
235 245
         });
236 246
     }
@@ -523,25 +533,32 @@ public class SwingController extends BasePlugin implements UIController {
523 533
         }
524 534
 
525 535
         general.addSetting(new PreferencesSetting("ui", "lookandfeel",
526
-                "Look and feel", "The Java look and feel to use", lafs));
536
+                "Look and feel", "The Java look and feel to use", lafs,
537
+                globalConfig, globalIdentity));
527 538
         general.addSetting(new PreferencesSetting("ui", "framemanager",
528 539
                 "Window manager", "Which window manager should be used?",
529
-                framemanagers));
540
+                framemanagers,
541
+                globalConfig, globalIdentity));
530 542
         general.addSetting(new PreferencesSetting("ui", "framemanagerPosition",
531 543
                 "Window manager position", "Where should the window "
532
-                + "manager be positioned?", fmpositions));
544
+                + "manager be positioned?", fmpositions,
545
+                globalConfig, globalIdentity));
533 546
         general.addSetting(new PreferencesSetting(PreferencesType.FONT,
534 547
                 "ui", "textPaneFontName", "Textpane font",
535
-                "Font for the textpane"));
548
+                "Font for the textpane",
549
+                globalConfig, globalIdentity));
536 550
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
537 551
                 "ui", "textPaneFontSize", "Textpane font size",
538
-                "Font size for the textpane"));
552
+                "Font size for the textpane",
553
+                globalConfig, globalIdentity));
539 554
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
540 555
                 "ui", "sortrootwindows", "Sort root windows",
541
-                "Sort child windows in the frame managers?"));
556
+                "Sort child windows in the frame managers?",
557
+                globalConfig, globalIdentity));
542 558
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
543 559
                 "ui", "sortchildwindows", "Sort child windows",
544
-                "Sort root windows in the frame managers?"));
560
+                "Sort root windows in the frame managers?",
561
+                globalConfig, globalIdentity));
545 562
 
546 563
         general.addSubCategory(createNicklistCategory());
547 564
         general.addSubCategory(createTreeViewCategory());
@@ -563,42 +580,52 @@ public class SwingController extends BasePlugin implements UIController {
563 580
                 PreferencesType.OPTIONALINTEGER,
564 581
                 new NumericalValidator(10, -1), "ui", "frameBufferSize",
565 582
                 "Window buffer size", "The maximum number of lines in a window"
566
-                + " buffer"));
583
+                + " buffer",
584
+                globalConfig, globalIdentity));
567 585
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
568 586
                 getDomain(), "mdiBarVisibility", "MDI Bar Visibility",
569
-                "Controls the visibility of the MDI bar"));
587
+                "Controls the visibility of the MDI bar",
588
+                globalConfig, globalIdentity));
570 589
         advanced.addSetting(
571 590
                 new PreferencesSetting(PreferencesType.BOOLEAN, "ui",
572 591
                 "useOneTouchExpandable", "Use one touch expandable split "
573 592
                 + "panes?", "Use one touch expandable arrows for "
574
-                + "collapsing/expanding the split panes"));
593
+                + "collapsing/expanding the split panes",
594
+                globalConfig, globalIdentity));
575 595
         advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
576 596
                 getDomain(), "windowMenuItems", "Window menu item count",
577
-                "Number of items to show in the window menu"));
597
+                "Number of items to show in the window menu",
598
+                globalConfig, globalIdentity));
578 599
         advanced.addSetting(
579 600
                 new PreferencesSetting(PreferencesType.INTEGER, getDomain(),
580 601
                 "windowMenuScrollInterval", "Window menu scroll interval",
581 602
                 "Number of milliseconds to pause when autoscrolling in the "
582
-                + "window menu"));
603
+                + "window menu",
604
+                globalConfig, globalIdentity));
583 605
         advanced.addSetting(
584 606
                 new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(),
585 607
                 "showtopicbar", "Show topic bar",
586
-                "Shows a graphical topic bar in channels."));
608
+                "Shows a graphical topic bar in channels.",
609
+                globalConfig, globalIdentity));
587 610
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
588 611
                 getDomain(),
589 612
                 "shownicklist", "Show nicklist?",
590
-                "Do you want the nicklist visible"));
613
+                "Do you want the nicklist visible",
614
+                globalConfig, globalIdentity));
591 615
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
592 616
                 getDomain(), "showfulltopic", "Show full topic in topic bar?",
593 617
                "Do you want to show the full topic in the topic bar or just"
594
-               + "first line?"));
618
+               + "first line?",
619
+                globalConfig, globalIdentity));
595 620
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
596 621
                 getDomain(), "hideEmptyTopicBar", "Hide empty topic bar?",
597
-                "Do you want to hide the topic bar when there is no topic"));
622
+                "Do you want to hide the topic bar when there is no topic",
623
+                globalConfig, globalIdentity));
598 624
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
599 625
                 getDomain(), "textpanelinenotification",
600 626
                 "New line notification", "Do you want to be notified about new "
601
-                + "lines whilst scrolled up?"));
627
+                + "lines whilst scrolled up?",
628
+                globalConfig, globalIdentity));
602 629
 
603 630
         return advanced;
604 631
     }
@@ -615,30 +642,37 @@ public class SwingController extends BasePlugin implements UIController {
615 642
         treeview.addSetting(new PreferencesSetting(
616 643
                 PreferencesType.OPTIONALCOLOUR,
617 644
                 "treeview", "backgroundcolour", "Treeview background colour",
618
-                "Background colour to use for the treeview"));
645
+                "Background colour to use for the treeview",
646
+                globalConfig, globalIdentity));
619 647
         treeview.addSetting(new PreferencesSetting(
620 648
                 PreferencesType.OPTIONALCOLOUR,
621 649
                 "treeview", "foregroundcolour", "Treeview foreground colour",
622
-                "Foreground colour to use for the treeview"));
650
+                "Foreground colour to use for the treeview",
651
+                globalConfig, globalIdentity));
623 652
         treeview.addSetting(new PreferencesSetting(
624 653
                 PreferencesType.OPTIONALCOLOUR,
625 654
                 "ui", "treeviewRolloverColour", "Treeview rollover colour",
626 655
                 "Background colour to use when the mouse cursor is over a "
627
-                + "node"));
656
+                + "node",
657
+                globalConfig, globalIdentity));
628 658
         treeview.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
629 659
                 "ui", "treeviewActiveBold", "Active node bold",
630
-                "Make the active node bold?"));
660
+                "Make the active node bold?",
661
+                globalConfig, globalIdentity));
631 662
         treeview.addSetting(new PreferencesSetting(
632 663
                 PreferencesType.OPTIONALCOLOUR,
633 664
                 "ui", "treeviewActiveBackground", "Active node background",
634
-                "Background colour to use for active treeview node"));
665
+                "Background colour to use for active treeview node",
666
+                globalConfig, globalIdentity));
635 667
         treeview.addSetting(new PreferencesSetting(
636 668
                 PreferencesType.OPTIONALCOLOUR,
637 669
                 "ui", "treeviewActiveForeground", "Active node foreground",
638
-                "Foreground colour to use for active treeview node"));
670
+                "Foreground colour to use for active treeview node",
671
+                globalConfig, globalIdentity));
639 672
         treeview.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
640 673
                 getDomain(), "showtreeexpands", "Show expand/collapse handles",
641
-                "Do you want to show tree view collapse/expand handles"));
674
+                "Do you want to show tree view collapse/expand handles",
675
+                globalConfig, globalIdentity));
642 676
 
643 677
         return treeview;
644 678
     }
@@ -655,22 +689,27 @@ public class SwingController extends BasePlugin implements UIController {
655 689
         nicklist.addSetting(new PreferencesSetting(
656 690
                 PreferencesType.OPTIONALCOLOUR,
657 691
                 "ui", "nicklistbackgroundcolour", "Nicklist background colour",
658
-                "Background colour to use for the nicklist"));
692
+                "Background colour to use for the nicklist",
693
+                globalConfig, globalIdentity));
659 694
         nicklist.addSetting(new PreferencesSetting(
660 695
                 PreferencesType.OPTIONALCOLOUR,
661 696
                 "ui", "nicklistforegroundcolour", "Nicklist foreground colour",
662
-                "Foreground colour to use for the nicklist"));
697
+                "Foreground colour to use for the nicklist",
698
+                globalConfig, globalIdentity));
663 699
         nicklist.addSetting(new PreferencesSetting(
664 700
                 PreferencesType.OPTIONALCOLOUR,
665 701
                 "ui", "nickListAltBackgroundColour",
666 702
                 "Alternate background colour",
667
-                "Background colour to use for every other nicklist entry"));
703
+                "Background colour to use for every other nicklist entry",
704
+                globalConfig, globalIdentity));
668 705
         nicklist.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
669 706
                 "nicklist", "sortByMode", "Sort nicklist by user mode",
670
-                "Sort nicknames by the modes that they have?"));
707
+                "Sort nicknames by the modes that they have?",
708
+                globalConfig, globalIdentity));
671 709
         nicklist.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
672 710
                 "nicklist", "sortByCase", "Sort nicklist by case",
673
-                "Sort nicknames in a case-sensitive manner?"));
711
+                "Sort nicknames in a case-sensitive manner?",
712
+                globalConfig, globalIdentity));
674 713
 
675 714
         return nicklist;
676 715
     }

+ 6
- 4
src/com/dmdirc/addons/ui_swing/components/FileBrowser.java View File

@@ -24,6 +24,7 @@ package com.dmdirc.addons.ui_swing.components;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
26 26
 import com.dmdirc.config.prefs.PreferencesSetting;
27
+import com.dmdirc.ui.IconManager;
27 28
 import com.dmdirc.util.ListenerList;
28 29
 
29 30
 import java.awt.event.ActionEvent;
@@ -40,7 +41,6 @@ import net.miginfocom.swing.MigLayout;
40 41
 /**
41 42
  * File browser component.
42 43
  *
43
- * @author Simon Mott
44 44
  * @since 0.6.3
45 45
  */
46 46
 public class FileBrowser extends JPanel implements ActionListener {
@@ -61,10 +61,12 @@ public class FileBrowser extends JPanel implements ActionListener {
61 61
     /**
62 62
      * Creates a new File Browser.
63 63
      *
64
+     * @param iconManager Icon Manager to get icons from
64 65
      * @param setting The setting to create the component for
65 66
      * @param type The type of filechooser we want (Files/Directories/Both)
66 67
      */
67
-    public FileBrowser(final PreferencesSetting setting, final int type) {
68
+    public FileBrowser(final IconManager iconManager,
69
+            final PreferencesSetting setting, final int type) {
68 70
         super();
69 71
 
70 72
         fileChooser.setFileSelectionMode(type);
@@ -72,8 +74,8 @@ public class FileBrowser extends JPanel implements ActionListener {
72 74
         final JButton browseButton = new JButton("Browse");
73 75
         browseButton.addActionListener(this);
74 76
 
75
-        pathField = new ValidatingJTextField(new JTextField(setting.getValue()),
76
-                setting.getValidator());
77
+        pathField = new ValidatingJTextField(iconManager,
78
+                new JTextField(setting.getValue()), setting.getValidator());
77 79
 
78 80
         setLayout(new MigLayout("ins 0, fill"));
79 81
         add(pathField, "growx, pushx, sgy all");

+ 2
- 1
src/com/dmdirc/addons/ui_swing/components/SwingSearchBar.java View File

@@ -118,7 +118,8 @@ public final class SwingSearchBar extends JPanel implements ActionListener,
118 118
         prevButton = new JButton();
119 119
         caseCheck = new JCheckBox();
120 120
         validator = new SearchValidator();
121
-        searchBox = new ValidatingJTextField(validator);
121
+        searchBox = new ValidatingJTextField(parent.getController()
122
+                .getIconManager(), validator);
122 123
         wrapIndicator = new JLabel("Search wrapped",
123 124
                 parent.getContainer().getIconManager().getIcon("linewrap"),
124 125
                 JLabel.LEFT);

+ 14
- 6
src/com/dmdirc/addons/ui_swing/components/expandingsettings/SettingsPanel.java View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.expandingsettings;
24 24
 
25
-import com.dmdirc.addons.ui_swing.PrefsComponentFactory;
25
+import com.dmdirc.addons.ui_swing.SwingController;
26 26
 import com.dmdirc.addons.ui_swing.UIUtilities;
27 27
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
28 28
 import com.dmdirc.config.prefs.PreferencesCategory;
@@ -63,25 +63,33 @@ public class SettingsPanel extends JPanel {
63 63
     private final boolean padding;
64 64
     /** Preferences Category. */
65 65
     private PreferencesCategory category;
66
+    /** Swing controller. */
67
+    private final SwingController controller;
66 68
 
67 69
     /**
68 70
      * Creates a new instance of SettingsPanel.
69 71
      *
72
+     * @param controller Swing controller
70 73
      * @param infoText Info blurb.
71 74
      */
72
-    public SettingsPanel(final String infoText) {
73
-        this(infoText, true);
75
+    public SettingsPanel(final SwingController controller,
76
+            final String infoText) {
77
+        this(controller, infoText, true);
74 78
     }
75 79
 
76 80
     /**
77 81
      * Creates a new instance of SettingsPanel.
78 82
      *
83
+     * @param controller Swing controller
79 84
      * @param infoText Info blurb.
80 85
      * @param padding Should we add padding to the panel?
81 86
      */
82
-    public SettingsPanel(final String infoText, final boolean padding) {
87
+    public SettingsPanel(final SwingController controller,
88
+            final String infoText, final boolean padding) {
83 89
         super();
84 90
 
91
+        this.controller = controller;
92
+
85 93
         settings = new DoubleMap<PreferencesSetting, JComponent>();
86 94
 
87 95
         this.setOpaque(UIUtilities.getTabbedPaneOpaque());
@@ -135,8 +143,8 @@ public class SettingsPanel extends JPanel {
135 143
 
136 144
         for (PreferencesSetting setting : category.getSettings()) {
137 145
             if (settings.get(setting) == null) {
138
-                final JComponent component = PrefsComponentFactory
139
-                        .getComponent(setting);
146
+                final JComponent component = controller
147
+                        .getPrefsComponentFactory().getComponent(setting);
140 148
                 component.setName(setting.getTitle());
141 149
                 settings.put(setting, component);
142 150
             }

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java View File

@@ -87,11 +87,11 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
87 87
 
88 88
         initComponents();
89 89
 
90
-        IdentityManager.getGlobalConfig().addChangeListener("ui",
90
+        controller.getGlobalConfig().addChangeListener("ui",
91 91
                 "channelSplitPanePosition", this);
92
-        IdentityManager.getGlobalConfig().addChangeListener(
92
+        controller.getGlobalConfig().addChangeListener(
93 93
                 controller.getDomain(), "showtopicbar", this);
94
-        IdentityManager.getGlobalConfig().addChangeListener(
94
+        controller.getGlobalConfig().addChangeListener(
95 95
                 controller.getDomain(), "shownicklist", this);
96 96
         ActionManager.getActionManager().registerListener(this,
97 97
                 CoreActionType.CLIENT_CLOSING);
@@ -159,7 +159,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
159 159
     @Override
160 160
     public void actionPerformed(final ActionEvent actionEvent) {
161 161
         if (actionEvent.getSource() == settingsMI) {
162
-            ChannelSettingsDialog.showChannelSettingsDialog(
162
+            ChannelSettingsDialog.showChannelSettingsDialog(controller,
163 163
                     (Channel) getContainer(), getController().getMainFrame(),
164 164
                     (InputWindow) getController().getWindowFactory()
165 165
                     .getSwingWindow(frameParent));

+ 8
- 4
src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java View File

@@ -56,6 +56,8 @@ public final class ServerFrame extends InputTextFrame implements
56 56
      * objects being unserialized with the new class).
57 57
      */
58 58
     private static final long serialVersionUID = 9;
59
+    /** Swing controller. */
60
+    private final SwingController controller;
59 61
     /** popup menu item. */
60 62
     private JMenuItem settingsMI;
61 63
     /** The SSL certificate dialog we're displaying for this server, if any. */
@@ -70,6 +72,7 @@ public final class ServerFrame extends InputTextFrame implements
70 72
     public ServerFrame(final SwingController controller, final Server owner) {
71 73
         super(controller, owner);
72 74
 
75
+        this.controller = controller;
73 76
         initComponents();
74 77
 
75 78
         owner.addCertificateProblemListener(this);
@@ -96,8 +99,8 @@ public final class ServerFrame extends InputTextFrame implements
96 99
     @Override
97 100
     public void actionPerformed(final ActionEvent actionEvent) {
98 101
         if (actionEvent.getSource() == settingsMI) {
99
-            ServerSettingsDialog.showServerSettingsDialog(getContainer().
100
-                    getServer(), getController().getMainFrame());
102
+            ServerSettingsDialog.showServerSettingsDialog(controller,
103
+                    getContainer().getServer(), getController().getMainFrame());
101 104
         }
102 105
     }
103 106
 
@@ -163,8 +166,9 @@ public final class ServerFrame extends InputTextFrame implements
163 166
     @Override
164 167
     public void windowClosing(final FrameContainer window) {
165 168
         if (ServerSettingsDialog.hasServerSettingsDialog()) {
166
-            ServerSettingsDialog.getServerSettingsDialog(getContainer()
167
-                    .getServer(), getController().getMainFrame()).dispose();
169
+            ServerSettingsDialog.getServerSettingsDialog(controller,
170
+                    getContainer().getServer(),
171
+                    getController().getMainFrame()).dispose();
168 172
         }
169 173
 
170 174
         super.windowClosing(window);

+ 14
- 9
src/com/dmdirc/addons/ui_swing/components/inputfields/ValidatingTextFieldInputField.java View File

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.inputfields;
24 24
 
25
+import com.dmdirc.addons.ui_swing.SwingController;
25 26
 import com.dmdirc.addons.ui_swing.components.colours.ColourPickerDialog;
26 27
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
27
-import com.dmdirc.config.IdentityManager;
28 28
 import com.dmdirc.interfaces.ui.InputField;
29 29
 import com.dmdirc.util.validators.Validator;
30 30
 
@@ -46,28 +46,33 @@ public class ValidatingTextFieldInputField extends ValidatingJTextField
46 46
      * objects being unserialized with the new class).
47 47
      */
48 48
     private static final long serialVersionUID = 2;
49
-
50 49
     /** Colour picker. */
51
-    protected ColourPickerDialog colourPicker;
50
+    private ColourPickerDialog colourPicker;
51
+    /** Swing controller. */
52
+    private final SwingController controller;
52 53
 
53 54
     /**
54 55
      * Creates a new text field with the specified validator.
55 56
      *
57
+     * @param controller Swing controller
56 58
      * @param validator Validator for this textfield
57 59
      */
58
-    public ValidatingTextFieldInputField(final Validator<String> validator) {
59
-        super(validator);
60
+    public ValidatingTextFieldInputField(final SwingController controller,
61
+            final Validator<String> validator) {
62
+        this(controller, new JTextField(), validator);
60 63
     }
61 64
 
62 65
     /**
63 66
      * Creates a new text field with the specified validator.
64 67
      *
68
+     * @param controller Swing controller
65 69
      * @param validator Validator for this textfield
66 70
      * @param textField Textfield to use as a base
67 71
      */
68
-    public ValidatingTextFieldInputField(final JTextField textField,
69
-            final Validator<String> validator) {
70
-        super(textField, validator);
72
+    public ValidatingTextFieldInputField(final SwingController controller,
73
+            final JTextField textField, final Validator<String> validator) {
74
+        super(controller.getIconManager(), textField, validator);
75
+        this.controller = controller;
71 76
     }
72 77
 
73 78
     /** {@inheritDoc} */
@@ -85,7 +90,7 @@ public class ValidatingTextFieldInputField extends ValidatingJTextField
85 90
     /** {@inheritDoc} */
86 91
     @Override
87 92
     public void showColourPicker(final boolean irc, final boolean hex) {
88
-        if (IdentityManager.getGlobalConfig().getOptionBool("general",
93
+        if (controller.getGlobalConfig().getOptionBool("general",
89 94
                 "showcolourdialog")) {
90 95
             colourPicker = new ColourPickerDialog(irc, hex);
91 96
             colourPicker.addActionListener(new ActionListener() {

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/menubar/ChannelMenu.java View File

@@ -98,7 +98,7 @@ public class ChannelMenu extends JMenu implements ActionListener,
98 98
     @Override
99 99
     public void actionPerformed(final ActionEvent e) {
100 100
         if (e.getActionCommand().equals("JoinChannel")) {
101
-            new ChannelJoinDialog(mainFrame, ModalityType.MODELESS,
101
+            new ChannelJoinDialog(controller, ModalityType.MODELESS,
102 102
                     "Join channel", "Enter the name of the channel to join.")
103 103
                     .display();
104 104
         } else if (e.getActionCommand().equals("ChannelSettings")) {

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/menubar/ServerMenu.java View File

@@ -122,9 +122,9 @@ public class ServerMenu extends JMenu implements ActionListener,
122 122
     @Override
123 123
     public void actionPerformed(final ActionEvent e) {
124 124
         if ("NewServer".equals(e.getActionCommand())) {
125
-            NewServerDialog.showNewServerDialog(mainFrame);
125
+            NewServerDialog.showNewServerDialog(controller);
126 126
         } else if (e.getActionCommand().equals("ServerList")) {
127
-            ServerListDialog.showServerListDialog(mainFrame,
127
+            ServerListDialog.showServerListDialog(controller, mainFrame,
128 128
                     controller.getURLHandler());
129 129
         } else if (e.getActionCommand().equals("Exit")) {
130 130
             mainFrame.quit();

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/menubar/SettingsMenu.java View File

@@ -104,12 +104,12 @@ public class SettingsMenu extends JMenu implements ActionListener {
104 104
         if ("Preferences".equals(e.getActionCommand())) {
105 105
             SwingPreferencesDialog.showSwingPreferencesDialog(controller);
106 106
         } else if (e.getActionCommand().equals("Profile")) {
107
-            ProfileManagerDialog.showProfileManagerDialog(mainFrame);
107
+            ProfileManagerDialog.showProfileManagerDialog(controller);
108 108
         }  else if (e.getActionCommand().equals("Actions")) {
109 109
             ActionsManagerDialog.showActionsManagerDialog(mainFrame,
110 110
                     controller);
111 111
         } else if (e.getActionCommand().equals("Aliases")) {
112
-            AliasManagerDialog.showAliasManagerDialog(mainFrame);
112
+            AliasManagerDialog.showAliasManagerDialog(controller, mainFrame);
113 113
         }
114 114
     }
115 115
 }

+ 9
- 4
src/com/dmdirc/addons/ui_swing/components/modes/ChannelModesPane.java View File

@@ -23,7 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.components.modes;
24 24
 
25 25
 import com.dmdirc.Channel;
26
-import com.dmdirc.config.ConfigManager;
26
+import com.dmdirc.addons.ui_swing.SwingController;
27 27
 import com.dmdirc.parser.interfaces.Parser;
28 28
 
29 29
 /** Non list mode panel. */
@@ -37,15 +37,20 @@ public final class ChannelModesPane extends ModesPane {
37 37
     private static final long serialVersionUID = 1;
38 38
     /** Parent channel. */
39 39
     private final Channel channel;
40
+    /** Swing controller. */
41
+    private final SwingController controller;
40 42
 
41 43
     /**
42 44
      * Creates a new instance of ChannelModesPane.
43 45
      *
46
+     * @param controller Swing controller
44 47
      * @param channel Parent channel
45 48
      */
46
-    public ChannelModesPane(final Channel channel) {
49
+    public ChannelModesPane(final SwingController controller,
50
+            final Channel channel) {
47 51
         super();
48 52
 
53
+        this.controller = controller;
49 54
         this.channel = channel;
50 55
         initModesPanel();
51 56
     }
@@ -120,7 +125,7 @@ public final class ChannelModesPane extends ModesPane {
120 125
 
121 126
     /** {@inheritDoc} */
122 127
     @Override
123
-    public ConfigManager getConfigManager() {
124
-        return channel.getConfigManager();
128
+    public SwingController getSwingController() {
129
+        return controller;
125 130
     }
126 131
 }

+ 5
- 5
src/com/dmdirc/addons/ui_swing/components/modes/ModesPane.java View File

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.modes;
24 24
 
25
+import com.dmdirc.addons.ui_swing.SwingController;
25 26
 import com.dmdirc.addons.ui_swing.UIUtilities;
26 27
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
27
-import com.dmdirc.config.ConfigManager;
28 28
 
29 29
 import java.awt.Insets;
30 30
 import java.util.HashMap;
@@ -111,7 +111,7 @@ public abstract class ModesPane extends JPanel {
111 111
                     mode.subSequence(0, 1));
112 112
 
113 113
             final ParamModePanel panel = new ParamModePanel(mode, state, value,
114
-                    getConfigManager());
114
+                    getSwingController());
115 115
 
116 116
             getParamModes().put(mode, panel);
117 117
         }
@@ -235,11 +235,11 @@ public abstract class ModesPane extends JPanel {
235 235
     }
236 236
 
237 237
     /**
238
-     * Returns the config manager to retrieve values from
238
+     * Returns the Swing controller to grab various objects from.
239 239
      *
240
-     * @return Config manager
240
+     * @return Swing controller
241 241
      */
242
-    public abstract ConfigManager getConfigManager();
242
+    public abstract SwingController getSwingController();
243 243
 
244 244
     /**
245 245
      * Checks whether there is a plain text description for this mode.

+ 10
- 10
src/com/dmdirc/addons/ui_swing/components/modes/ParamModePanel.java View File

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.modes;
24 24
 
25
+import com.dmdirc.addons.ui_swing.SwingController;
25 26
 import com.dmdirc.addons.ui_swing.UIUtilities;
26 27
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
27
-import com.dmdirc.config.ConfigManager;
28 28
 import com.dmdirc.util.validators.RegexStringValidator;
29 29
 
30 30
 import java.awt.Component;
@@ -62,18 +62,18 @@ public final class ParamModePanel extends JPanel implements ActionListener {
62 62
      * @param thisMode The mode that this panel should deal with
63 63
      * @param state The current state of the mode
64 64
      * @param value The current value of the mode
65
-     * @param configManager The config manager to use to get mode names
65
+     * @param controller  Swing controller to gain access to settings/icons
66 66
      */
67 67
     public ParamModePanel(final String thisMode, final boolean state,
68
-            final String value, final ConfigManager configManager) {
68
+            final String value, final SwingController controller) {
69 69
         super();
70 70
         this.mode = thisMode;
71 71
         this.originalValue = value;
72 72
         String text;
73 73
         String tooltip;
74
-        if (configManager.hasOptionString("server", "mode" + mode)) {
75
-            tooltip = "Mode " + mode + ": " + configManager.getOption(
76
-                    "server", "mode" + mode);
74
+        if (controller.getGlobalConfig().hasOptionString("server", "mode" + mode)) {
75
+            tooltip = "Mode " + mode + ": " + controller.getGlobalConfig()
76
+                    .getOption("server", "mode" + mode);
77 77
         } else {
78 78
             tooltip = "Mode " + mode + ": Unknown";
79 79
         }
@@ -82,8 +82,8 @@ public final class ParamModePanel extends JPanel implements ActionListener {
82 82
 
83 83
         text = "Mode " + mode + ": ";
84 84
 
85
-        if (configManager.hasOptionString("server", "mode" + mode)) {
86
-            text = configManager.getOption("server", "mode" + mode)
85
+        if (controller.getGlobalConfig().hasOptionString("server", "mode" + mode)) {
86
+            text = controller.getGlobalConfig().getOption("server", "mode" + mode)
87 87
                     + " [+" + mode + "]: ";
88 88
         }
89 89
 
@@ -92,8 +92,8 @@ public final class ParamModePanel extends JPanel implements ActionListener {
92 92
         checkBox.setOpaque(UIUtilities.getTabbedPaneOpaque());
93 93
         add(checkBox);
94 94
 
95
-        textField = new ValidatingJTextField(new RegexStringValidator("^[^ ]*$",
96
-                "Cannot contain spaces"));
95
+        textField = new ValidatingJTextField(controller.getIconManager(),
96
+                new RegexStringValidator("^[^ ]*$", "Cannot contain spaces"));
97 97
         textField.setText(value);
98 98
         add(textField, "growx, pushx");
99 99
 

+ 9
- 4
src/com/dmdirc/addons/ui_swing/components/modes/UserModesPane.java View File

@@ -23,7 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.components.modes;
24 24
 
25 25
 import com.dmdirc.Server;
26
-import com.dmdirc.config.ConfigManager;
26
+import com.dmdirc.addons.ui_swing.SwingController;
27 27
 
28 28
 /** User mode panel. */
29 29
 public final class UserModesPane extends ModesPane {
@@ -36,15 +36,20 @@ public final class UserModesPane extends ModesPane {
36 36
     private static final long serialVersionUID = 1;
37 37
     /** Parent server. */
38 38
     private final Server server;
39
+    /** Swing controller. */
40
+    private final SwingController controller;
39 41
 
40 42
     /**
41 43
      * Creates a new instance of UserModesPane.
42 44
      *
45
+     * @param controller Swing controller
43 46
      * @param server Parent server
44 47
      */
45
-    public UserModesPane(final Server server) {
48
+    public UserModesPane(final SwingController controller,
49
+            final Server server) {
46 50
         super();
47 51
 
52
+        this.controller = controller;
48 53
         this.server = server;
49 54
         initModesPanel();
50 55
     }
@@ -113,7 +118,7 @@ public final class UserModesPane extends ModesPane {
113 118
 
114 119
     /** {@inheritDoc} */
115 120
     @Override
116
-    public ConfigManager getConfigManager() {
117
-        return server.getConfigManager();
121
+    public SwingController getSwingController() {
122
+        return controller;
118 123
     }
119 124
 }

+ 5
- 5
src/com/dmdirc/addons/ui_swing/components/statusbar/ErrorPanel.java View File

@@ -24,7 +24,6 @@ package com.dmdirc.addons.ui_swing.components.statusbar;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.MainFrame;
26 26
 import com.dmdirc.addons.ui_swing.SwingController;
27
-import com.dmdirc.config.IdentityManager;
28 27
 import com.dmdirc.logger.ErrorLevel;
29 28
 import com.dmdirc.logger.ErrorListener;
30 29
 import com.dmdirc.logger.ErrorManager;
@@ -58,8 +57,7 @@ public class ErrorPanel extends StatusbarPopupPanel<JLabel> implements
58 57
      */
59 58
     private static final long serialVersionUID = 2;
60 59
     /** non error state image icon. */
61
-    private static final Icon DEFAULT_ICON = new IconManager(IdentityManager
62
-            .getGlobalConfig()).getIcon("normal");
60
+    private final Icon DEFAULT_ICON;
63 61
     /** Status controller. */
64 62
     private final MainFrame mainFrame;
65 63
     /** Swing status bar. */
@@ -79,7 +77,7 @@ public class ErrorPanel extends StatusbarPopupPanel<JLabel> implements
79 77
     private ErrorLevel errorLevel;
80 78
 
81 79
     /**
82
-     * Creates a new ErrorPanel for the speicified status bar.
80
+     * Creates a new ErrorPanel for the specified status bar.
83 81
      *
84 82
      * @param controller Swing controller
85 83
      * @param mainFrame Main frame
@@ -92,6 +90,8 @@ public class ErrorPanel extends StatusbarPopupPanel<JLabel> implements
92 90
         this.controller = controller;
93 91
         this.mainFrame = mainFrame;
94 92
         this.statusBar = statusBar;
93
+        DEFAULT_ICON = new IconManager(controller.getGlobalConfig())
94
+                .getIcon("normal");
95 95
 
96 96
         menu = new JPopupMenu();
97 97
         dismiss = new JMenuItem("Clear All");
@@ -153,7 +153,7 @@ public class ErrorPanel extends StatusbarPopupPanel<JLabel> implements
153 153
                         if (errorLevel == null ||
154 154
                                 !error.getLevel().moreImportant(errorLevel)) {
155 155
                             errorLevel = error.getLevel();
156
-                            label.setIcon(new IconManager(IdentityManager
156
+                            label.setIcon(new IconManager(controller
157 157
                                     .getGlobalConfig()).getIcon(errorLevel
158 158
                                     .getIcon()));
159 159
                         }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/statusbar/GappedEtchedBorder.java View File

@@ -36,7 +36,7 @@ public class GappedEtchedBorder extends EtchedBorder {
36 36
     /** Java serialisation version ID. */
37 37
     private static final long serialVersionUID = 1;
38 38
     /** Parent popup window. */
39
-    private final StatusbarPopupWindow outer;
39
+    private transient final StatusbarPopupWindow outer;
40 40
 
41 41
     /**
42 42
      * Creates a new etched border leaving a gap where the specified window is.

+ 12
- 13
src/com/dmdirc/addons/ui_swing/components/statusbar/InviteLabel.java View File

@@ -27,16 +27,15 @@ import com.dmdirc.Server;
27 27
 import com.dmdirc.ServerManager;
28 28
 import com.dmdirc.actions.ActionManager;
29 29
 import com.dmdirc.actions.CoreActionType;
30
-import com.dmdirc.interfaces.actions.ActionType;
31
-import com.dmdirc.addons.ui_swing.MainFrame;
32 30
 import com.dmdirc.addons.ui_swing.SelectionListener;
31
+import com.dmdirc.addons.ui_swing.SwingController;
33 32
 import com.dmdirc.addons.ui_swing.UIUtilities;
34 33
 import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
35
-import com.dmdirc.config.IdentityManager;
36 34
 import com.dmdirc.interfaces.ActionListener;
37 35
 import com.dmdirc.interfaces.InviteListener;
38
-import com.dmdirc.ui.IconManager;
36
+import com.dmdirc.interfaces.actions.ActionType;
39 37
 import com.dmdirc.interfaces.ui.StatusBarComponent;
38
+import com.dmdirc.ui.IconManager;
40 39
 
41 40
 import java.awt.event.ActionEvent;
42 41
 import java.awt.event.MouseEvent;
@@ -68,23 +67,23 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
68 67
     private final JMenuItem dismiss;
69 68
     /** Accept invites menu item. */
70 69
     private final JMenuItem accept;
71
-    /** Parent window. */
72
-    private final MainFrame mainFrame;
70
+    /** Swing controller. */
71
+    private final SwingController controller;
73 72
     /** Active server. */
74 73
     private Server activeServer;
75 74
 
76 75
     /**
77 76
      * Instantiates a new invite label.
78 77
      *
79
-     * @param mainFrame Parent window
78
+     * @param controller Swing controller
80 79
      */
81
-    public InviteLabel(final MainFrame mainFrame) {
80
+    public InviteLabel(final SwingController controller) {
82 81
         super(new JLabel());
83 82
 
84
-        this.mainFrame = mainFrame;
83
+        this.controller = controller;
85 84
 
86 85
         setBorder(BorderFactory.createEtchedBorder());
87
-        label.setIcon(new IconManager(IdentityManager.getGlobalConfig())
86
+        label.setIcon(new IconManager(controller.getGlobalConfig())
88 87
                 .getIcon("invite"));
89 88
 
90 89
         menu = new JPopupMenu();
@@ -99,7 +98,7 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
99 98
             server.addInviteListener(this);
100 99
         }
101 100
 
102
-        mainFrame.addSelectionListener(this);
101
+        controller.getMainFrame().addSelectionListener(this);
103 102
         ActionManager.getActionManager().registerListener(this,
104 103
                 CoreActionType.SERVER_CONNECTED);
105 104
         ActionManager.getActionManager().registerListener(this,
@@ -113,11 +112,11 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
113 112
     /** {@inheritDoc} */
114 113
     @Override
115 114
     protected StatusbarPopupWindow getWindow() {
116
-        return new InvitePopup(this, activeServer, mainFrame);
115
+        return new InvitePopup(this, activeServer, controller.getMainFrame());
117 116
     }
118 117
 
119 118
     /**
120
-     * Popuplates the menu.
119
+     * Populates the menu.
121 120
      */
122 121
     private void popuplateMenu() {
123 122
         menu.removeAll();

+ 9
- 7
src/com/dmdirc/addons/ui_swing/components/statusbar/MessageLabel.java View File

@@ -23,7 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.components.statusbar;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
-import com.dmdirc.config.IdentityManager;
26
+import com.dmdirc.config.ConfigManager;
27 27
 import com.dmdirc.ui.IconManager;
28 28
 import com.dmdirc.ui.StatusMessage;
29 29
 import com.dmdirc.interfaces.ui.StatusBarComponent;
@@ -67,20 +67,23 @@ public class MessageLabel extends JPanel implements StatusBarComponent,
67 67
     private StatusMessage currentMessage;
68 68
     /** Timer to clear the message. */
69 69
     private transient TimerTask messageTimer;
70
+    /** Config manager to read settings from. */
71
+    private ConfigManager config;
70 72
 
71 73
     /**
72 74
      * Instantiates a new message label.
73 75
      *
74 76
      * @param parentWindow Parent window
77
+     * @param config Config manager to read settings from
75 78
      */
76
-    public MessageLabel(final Window parentWindow) {
79
+    public MessageLabel(final Window parentWindow, final ConfigManager config) {
77 80
         super(new MigLayout("fill, ins 0, gap 0  0"));
81
+        this.config = config;
78 82
         queue = new ConcurrentLinkedQueue<StatusMessage>();
79
-        defaultMessage = new StatusMessage(null, "Ready.", null, -1,
80
-                IdentityManager.getGlobalConfig());
83
+        defaultMessage = new StatusMessage(null, "Ready.", null, -1, config);
81 84
         currentMessage = defaultMessage;
82 85
         label = new JLabel();
83
-        historyLabel = new MessagePopup(this, parentWindow);
86
+        historyLabel = new MessagePopup(this, parentWindow, config);
84 87
         label.setText("Ready.");
85 88
         label.setBorder(new SidelessEtchedBorder(
86 89
                 SidelessEtchedBorder.Side.RIGHT));
@@ -114,8 +117,7 @@ public class MessageLabel extends JPanel implements StatusBarComponent,
114 117
                 if (currentMessage.getIconType() == null) {
115 118
                     label.setIcon(null);
116 119
                 } else {
117
-                    label.setIcon(new IconManager(IdentityManager
118
-                            .getGlobalConfig()).getIcon(
120
+                    label.setIcon(new IconManager(config).getIcon(
119 121
                             currentMessage.getIconType()));
120 122
                 }
121 123
                 label.setText(UIUtilities.clipStringifNeeded(MessageLabel.this,

+ 10
- 5
src/com/dmdirc/addons/ui_swing/components/statusbar/MessagePopup.java View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.statusbar;
24 24
 
25
-import com.dmdirc.config.IdentityManager;
25
+import com.dmdirc.config.ConfigManager;
26 26
 import com.dmdirc.ui.IconManager;
27 27
 import com.dmdirc.ui.StatusMessage;
28 28
 
@@ -57,19 +57,24 @@ class MessagePopup extends StatusbarTogglePanel<JLabel> {
57 57
     private final List<StatusMessage> messages;
58 58
     /** Parent panel. */
59 59
     private final JPanel parent;
60
+    /** Config manager. */
61
+    private final ConfigManager configManager;
60 62
 
61 63
     /**
62 64
      * Creates a new message history popup.
63 65
      *
64 66
      * @param parent Parent to size against
65 67
      * @param parentWindow Parent window
68
+     * @param configManager Config manager
66 69
      */
67
-    public MessagePopup(final JPanel parent, final Window parentWindow) {
70
+    public MessagePopup(final JPanel parent, final Window parentWindow,
71
+            final ConfigManager configManager) {
68 72
         super(new JLabel("^"),
69 73
                 new SidelessEtchedBorder(SidelessEtchedBorder.Side.LEFT),
70 74
                 new SidelessEtchedBorder(SidelessEtchedBorder.Side.TOP));
71 75
         this.parentWindow = parentWindow;
72 76
         this.parent = parent;
77
+        this.configManager = configManager;
73 78
         messages = new ArrayList<StatusMessage>();
74 79
     }
75 80
 
@@ -164,9 +169,9 @@ class MessagePopup extends StatusbarTogglePanel<JLabel> {
164 169
 
165 170
             for (StatusMessage message : messages) {
166 171
                 panel.add(new JLabel(message.getMessage(), message.getIconType()
167
-                        == null ? null : new IconManager(IdentityManager
168
-                        .getGlobalConfig()).getIcon(message.getIconType()),
169
-                        SwingConstants.LEFT), "grow, push, wrap");
172
+                        == null ? null : new IconManager(configManager)
173
+                        .getIcon(message.getIconType()), SwingConstants.LEFT),
174
+                        "grow, push, wrap");
170 175
             }
171 176
         }
172 177
 

+ 4
- 3
src/com/dmdirc/addons/ui_swing/components/statusbar/SwingStatusBar.java View File

@@ -69,10 +69,11 @@ public final class SwingStatusBar extends JPanel implements StatusBar {
69 69
             final MainFrame mainFrame) {
70 70
         super();
71 71
 
72
-        messageLabel = new MessageLabel(mainFrame);
72
+        messageLabel = new MessageLabel(mainFrame,
73
+                controller.getGlobalConfig());
73 74
         errorPanel = new ErrorPanel(controller, mainFrame, this);
74
-        updateLabel = new UpdaterLabel(mainFrame);
75
-        inviteLabel = new InviteLabel(mainFrame);
75
+        updateLabel = new UpdaterLabel(controller);
76
+        inviteLabel = new InviteLabel(controller);
76 77
 
77 78
         setLayout(new MigLayout("fill, ins 0, hidemode 3"));
78 79
 

+ 23
- 17
src/com/dmdirc/addons/ui_swing/components/statusbar/UpdaterLabel.java View File

@@ -22,12 +22,11 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.statusbar;
24 24
 
25
-import com.dmdirc.addons.ui_swing.MainFrame;
25
+import com.dmdirc.addons.ui_swing.SwingController;
26 26
 import com.dmdirc.addons.ui_swing.dialogs.updater.SwingRestartDialog;
27 27
 import com.dmdirc.addons.ui_swing.dialogs.updater.SwingUpdaterDialog;
28
-import com.dmdirc.config.IdentityManager;
29
-import com.dmdirc.ui.IconManager;
30 28
 import com.dmdirc.interfaces.ui.StatusBarComponent;
29
+import com.dmdirc.ui.IconManager;
31 30
 import com.dmdirc.updater.UpdateChecker;
32 31
 import com.dmdirc.updater.UpdateChecker.STATE;
33 32
 import com.dmdirc.updater.UpdateCheckerListener;
@@ -38,6 +37,8 @@ import java.awt.event.MouseEvent;
38 37
 import javax.swing.BorderFactory;
39 38
 import javax.swing.JLabel;
40 39
 
40
+import lombok.Getter;
41
+
41 42
 /**
42 43
  * Updater label is responsible for handling the display of updates in the
43 44
  * status bar.
@@ -52,17 +53,19 @@ public class UpdaterLabel extends StatusbarPopupPanel<JLabel> implements
52 53
      */
53 54
     private static final long serialVersionUID = 1;
54 55
     /** Swing controller. */
55
-    private final MainFrame mainFrame;
56
+    @Getter
57
+    private final SwingController controller;
56 58
 
57 59
     /**
58
-     * Instantiates a new updater label, handles showing updates on the status bar.
60
+     * Instantiates a new updater label, handles showing updates on the status
61
+     * bar.
59 62
      *
60
-     * @param mainFrame Main frame
63
+     * @param controller Swing controller
61 64
      */
62
-    public UpdaterLabel(final MainFrame mainFrame) {
65
+    public UpdaterLabel(final SwingController controller) {
63 66
         super(new JLabel());
64 67
 
65
-        this.mainFrame = mainFrame;
68
+        this.controller = controller;
66 69
         setBorder(BorderFactory.createEtchedBorder());
67 70
         UpdateChecker.addListener(this);
68 71
         setVisible(false);
@@ -79,11 +82,14 @@ public class UpdaterLabel extends StatusbarPopupPanel<JLabel> implements
79 82
         super.mouseClicked(mouseEvent);
80 83
 
81 84
         if (mouseEvent.getButton() == MouseEvent.BUTTON1) {
82
-            if (UpdateChecker.getStatus().equals(UpdateChecker.STATE.RESTART_REQUIRED)) {
83
-                SwingRestartDialog.showSwingRestartDialog(mainFrame, ModalityType.MODELESS);
84
-            } else if (!UpdateChecker.getStatus().equals(UpdateChecker.STATE.CHECKING)) {
85
-                SwingUpdaterDialog.showSwingUpdaterDialog(
86
-                        UpdateChecker.getAvailableUpdates(), mainFrame);
85
+            if (UpdateChecker.getStatus().equals(
86
+                    UpdateChecker.STATE.RESTART_REQUIRED)) {
87
+                SwingRestartDialog.showSwingRestartDialog(controller
88
+                        .getMainFrame(), ModalityType.MODELESS);
89
+            } else if (!UpdateChecker.getStatus().equals(
90
+                    UpdateChecker.STATE.CHECKING)) {
91
+                SwingUpdaterDialog.showSwingUpdaterDialog(UpdateChecker
92
+                        .getAvailableUpdates(), controller.getMainFrame());
87 93
             }
88 94
         }
89 95
     }
@@ -98,13 +104,13 @@ public class UpdaterLabel extends StatusbarPopupPanel<JLabel> implements
98 104
         }
99 105
 
100 106
         if (newStatus.equals(STATE.CHECKING)) {
101
-            label.setIcon(new IconManager(IdentityManager.getGlobalConfig())
107
+            label.setIcon(new IconManager(controller.getGlobalConfig())
102 108
                     .getIcon("hourglass"));
103 109
         } else if (newStatus.equals(STATE.UPDATES_AVAILABLE)) {
104
-            label.setIcon(new IconManager(IdentityManager.getGlobalConfig())
110
+            label.setIcon(new IconManager(controller.getGlobalConfig())
105 111
                     .getIcon("update"));
106 112
         } else if (newStatus.equals(STATE.RESTART_REQUIRED)) {
107
-            label.setIcon(new IconManager(IdentityManager.getGlobalConfig())
113
+            label.setIcon(new IconManager(controller.getGlobalConfig())
108 114
                     .getIcon("restart-needed"));
109 115
         }
110 116
     }
@@ -112,6 +118,6 @@ public class UpdaterLabel extends StatusbarPopupPanel<JLabel> implements
112 118
     /** {@inheritDoc} */
113 119
     @Override
114 120
     protected StatusbarPopupWindow getWindow() {
115
-        return new UpdaterPopup(this, mainFrame);
121
+        return new UpdaterPopup(this, controller.getMainFrame());
116 122
     }
117 123
 }

+ 8
- 7
src/com/dmdirc/addons/ui_swing/components/validating/ValidatingJTextField.java View File

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.addons.ui_swing.components.validating;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
-import com.dmdirc.config.IdentityManager;
27 26
 import com.dmdirc.ui.IconManager;
28 27
 import com.dmdirc.util.validators.ValidationResponse;
29 28
 import com.dmdirc.util.validators.Validator;
@@ -65,25 +64,27 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
65 64
     /**
66 65
      * Instantiates a new Validating text field.
67 66
      *
67
+     * @param iconManager Icon manager
68 68
      * @param validator Validator instance
69 69
      */
70
-    public ValidatingJTextField(final Validator<String> validator) {
71
-        this(new JTextField(), validator);
70
+    public ValidatingJTextField(final IconManager iconManager,
71
+            final Validator<String> validator) {
72
+        this(iconManager, new JTextField(), validator);
72 73
     }
73 74
 
74 75
     /**
75 76
      * Instantiates a new Validating text field.
76 77
      *
78
+     * @param iconManager Icon manager
77 79
      * @param textField JTextField to wrap
78 80
      * @param validator Validator instance
79 81
      */
80
-    public ValidatingJTextField(final JTextField textField,
81
-            final Validator<String> validator) {
82
+    public ValidatingJTextField(final IconManager iconManager,
83
+            final JTextField textField, final Validator<String> validator) {
82 84
         super();
83 85
         this.textField = textField;
84 86
         this.validator = validator;
85
-        errorIcon = new JLabel(new IconManager(IdentityManager
86
-                .getGlobalConfig()).getIcon("input-error"));
87
+        errorIcon = new JLabel(iconManager.getIcon("input-error"));
87 88
 
88 89
         setLayout(new MigLayout("fill, ins 0, hidemode 3, gap 0"));
89 90
         add(textField, "grow, pushx");

+ 7
- 5
src/com/dmdirc/addons/ui_swing/dialogs/ChannelJoinDialog.java View File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.dialogs;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.MainFrame;
26
+import com.dmdirc.addons.ui_swing.SwingController;
26 27
 import com.dmdirc.parser.common.ChannelJoinRequest;
27 28
 
28 29
 import java.awt.Dialog.ModalityType;
@@ -42,16 +43,17 @@ public class ChannelJoinDialog extends StandardInputDialog {
42 43
      * Creates a new dialog which prompts a user and then joins the channel
43 44
      * they specify.
44 45
      *
45
-     * @param owner Parent window
46
+     * @param controller Swing controller
46 47
      * @param modality Window modality
47 48
      * @param title Window title
48 49
      * @param message Window message
49 50
      */
50
-    public ChannelJoinDialog(final MainFrame owner, final ModalityType modality,
51
-            final String title, final String message) {
52
-        super(owner, modality, title, message);
51
+    public ChannelJoinDialog(final SwingController controller,
52
+            final ModalityType modality, final String title,
53
+            final String message) {
54
+        super(controller, controller.getMainFrame(), modality, title, message);
53 55
 
54
-        this.mainFrame = owner;
56
+        this.mainFrame = controller.getMainFrame();
55 57
     }
56 58
 
57 59
     /** {@inheritDoc} */

+ 30
- 26
src/com/dmdirc/addons/ui_swing/dialogs/NewServerDialog.java View File

@@ -24,7 +24,7 @@ package com.dmdirc.addons.ui_swing.dialogs;
24 24
 
25 25
 import com.dmdirc.Server;
26 26
 import com.dmdirc.ServerManager;
27
-import com.dmdirc.addons.ui_swing.MainFrame;
27
+import com.dmdirc.addons.ui_swing.SwingController;
28 28
 import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
29 29
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
30 30
 import com.dmdirc.addons.ui_swing.components.vetoable.VetoableChangeEvent;
@@ -85,8 +85,8 @@ public final class NewServerDialog extends StandardDialog implements
85 85
     private JComboBox identityField;
86 86
     /** button. */
87 87
     private JButton editProfileButton;
88
-    /** Main frame. */
89
-    private final MainFrame mainFrame;
88
+    /** Swing controller. */
89
+    private final SwingController controller;
90 90
     /**  Opening new server? */
91 91
     private boolean openingServer = false;
92 92
 
@@ -95,10 +95,10 @@ public final class NewServerDialog extends StandardDialog implements
95 95
      *
96 96
      * @param mainFrame Main frame
97 97
      */
98
-    private NewServerDialog(final MainFrame mainFrame) {
99
-        super(mainFrame, ModalityType.MODELESS);
98
+    private NewServerDialog(final SwingController controller) {
99
+        super(controller.getMainFrame(), ModalityType.MODELESS);
100 100
 
101
-        this.mainFrame = mainFrame;
101
+        this.controller = controller;
102 102
 
103 103
         initComponents();
104 104
         layoutComponents();
@@ -120,10 +120,10 @@ public final class NewServerDialog extends StandardDialog implements
120 120
     /**
121 121
      * Creates the new server dialog if one doesn't exist, and displays it.
122 122
      *
123
-     * @param mainFrame Main frame
123
+     * @param controller Swing controller
124 124
      */
125
-    public static void showNewServerDialog(final MainFrame mainFrame) {
126
-        me = getNewServerDialog(mainFrame);
125
+    public static void showNewServerDialog(final SwingController controller) {
126
+        me = getNewServerDialog(controller);
127 127
 
128 128
         me.display();
129 129
     }
@@ -131,15 +131,15 @@ public final class NewServerDialog extends StandardDialog implements
131 131
     /**
132 132
      * Returns the current instance of the NewServerDialog.
133 133
      *
134
-     * @param mainFrame Main frame
134
+     * @param controller Swing controller
135 135
      *
136 136
      * @return The current NewServerDialog instance
137 137
      */
138 138
     public static NewServerDialog getNewServerDialog(
139
-            final MainFrame mainFrame) {
139
+            final SwingController controller) {
140 140
         synchronized (NewServerDialog.class) {
141 141
             if (me == null) {
142
-                me = new NewServerDialog(mainFrame);
142
+                me = new NewServerDialog(controller);
143 143
             }
144 144
         }
145 145
 
@@ -157,11 +157,11 @@ public final class NewServerDialog extends StandardDialog implements
157 157
 
158 158
     /** Updates the values to defaults. */
159 159
     private void update() {
160
-        serverField.setText(IdentityManager.getGlobalConfig().getOption("general",
160
+        serverField.setText(controller.getGlobalConfig().getOption("general",
161 161
                 "server"));
162
-        portField.setText(IdentityManager.getGlobalConfig().getOption("general",
162
+        portField.setText(controller.getGlobalConfig().getOption("general",
163 163
                 "port"));
164
-        passwordField.setText(IdentityManager.getGlobalConfig().getOption("general",
164
+        passwordField.setText(controller.getGlobalConfig().getOption("general",
165 165
                 "password"));
166 166
         sslCheck.setSelected(false);
167 167
         newServerWindowCheck.setEnabled(false);
@@ -169,7 +169,7 @@ public final class NewServerDialog extends StandardDialog implements
169 169
         serverField.requestFocusInWindow();
170 170
 
171 171
         if (ServerManager.getServerManager().numServers() == 0 ||
172
-                mainFrame.getActiveFrame() == null) {
172
+                controller.getMainFrame().getActiveFrame() == null) {
173 173
             newServerWindowCheck.setSelected(true);
174 174
             newServerWindowCheck.setEnabled(false);
175 175
         } else {
@@ -194,8 +194,10 @@ public final class NewServerDialog extends StandardDialog implements
194 194
      * Initialises the components in this dialog.
195 195
      */
196 196
     private void initComponents() {
197
-        serverField = new ValidatingJTextField(new ServerNameValidator());
198
-        portField = new ValidatingJTextField(new PortValidator());
197
+        serverField = new ValidatingJTextField(controller.getIconManager(),
198
+                new ServerNameValidator());
199
+        portField = new ValidatingJTextField(controller.getIconManager(),
200
+                new PortValidator());
199 201
         passwordField = new JPasswordField();
200 202
         newServerWindowCheck = new JCheckBox();
201 203
         newServerWindowCheck.setSelected(true);
@@ -287,25 +289,27 @@ public final class NewServerDialog extends StandardDialog implements
287 289
                 ""), pass, host, port, null, null, null);
288 290
 
289 291
             // Open in a new window?
290
-            if (newServerWindowCheck.isSelected() || ServerManager.getServerManager()
291
-                    .numServers() == 0 || mainFrame.getActiveFrame() == null) {
292
+            if (newServerWindowCheck.isSelected()
293
+                    || ServerManager.getServerManager().numServers() == 0
294
+                    || controller.getMainFrame().getActiveFrame() == null) {
292 295
 
293
-                new LoggingSwingWorker() {
296
+                new LoggingSwingWorker<Void, Void>() {
294 297
                     @Override
295
-                    protected Object doInBackground() {
298
+                    protected Void doInBackground() {
296 299
                         final Server server = new Server(address, profile);
297 300
                         server.connect();
298 301
                         return null;
299 302
                     }
300 303
                 }.executeInExecutor();
301 304
             } else {
302
-                final Server server = mainFrame.getActiveFrame().getContainer().getServer();
305
+                final Server server = controller.getMainFrame()
306
+                        .getActiveFrame().getContainer().getServer();
303 307
 
304
-                new LoggingSwingWorker() {
308
+                new LoggingSwingWorker<Void, Void>() {
305 309
 
306 310
                     /** {@inheritDoc} */
307 311
                     @Override
308
-                    protected Object doInBackground() {
312
+                    protected Void doInBackground() {
309 313
                         if (server == null) {
310 314
                             final Server newServer = new Server(address, profile);
311 315
                             newServer.connect();
@@ -331,7 +335,7 @@ public final class NewServerDialog extends StandardDialog implements
331 335
         if (e.getSource() == getOkButton()) {
332 336
             save();
333 337
         } else if (e.getSource() == editProfileButton) {
334
-            ProfileManagerDialog.showProfileManagerDialog(mainFrame);
338
+            ProfileManagerDialog.showProfileManagerDialog(controller);
335 339
         } else if (e.getSource() == getCancelButton()) {
336 340
             dispose();
337 341
         }

+ 12
- 4
src/com/dmdirc/addons/ui_swing/dialogs/StandardInputDialog.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs;
24 24
 
25
+import com.dmdirc.addons.ui_swing.SwingController;
25 26
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
26 27
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
27 28
 import com.dmdirc.util.validators.ValidationResponse;
@@ -55,18 +56,22 @@ public abstract class StandardInputDialog extends StandardDialog {
55 56
     private String message;
56 57
     /** Are we saving? */
57 58
     protected final AtomicBoolean saving = new AtomicBoolean(false);
59
+    /** Swing controller. */
60
+    private final SwingController controller;
58 61
 
59 62
     /**
60 63
      * Instantiates a new standard input dialog.
61 64
      *
65
+     * @param controller Swing controller
62 66
      * @param owner Dialog owner
63 67
      * @param modal modality type
64 68
      * @param title Dialog title
65 69
      * @param message Dialog message
66 70
      */
67
-    public StandardInputDialog(final Window owner, final ModalityType modal,
71
+    public StandardInputDialog(final SwingController controller,
72
+            final Window owner, final ModalityType modal,
68 73
             final String title, final String message) {
69
-        this(owner, modal, title, message, new Validator<String>() {
74
+        this(controller, owner, modal, title, message, new Validator<String>() {
70 75
 
71 76
             /** {@inheritDoc} */
72 77
             @Override
@@ -79,17 +84,20 @@ public abstract class StandardInputDialog extends StandardDialog {
79 84
     /**
80 85
      * Instantiates a new standard input dialog.
81 86
      *
87
+     * @param controller Swing controller
82 88
      * @param owner Dialog owner
83 89
      * @param modal modality type
84 90
      * @param validator Textfield validator
85 91
      * @param title Dialog title
86 92
      * @param message Dialog message
87 93
      */
88
-    public StandardInputDialog(final Window owner, final ModalityType modal,
94
+    public StandardInputDialog(final SwingController controller,
95
+            final Window owner, final ModalityType modal,
89 96
             final String title, final String message,
90 97
             final Validator<String> validator) {
91 98
         super(owner, modal);
92 99
 
100
+        this.controller = controller;
93 101
         this.validator = validator;
94 102
         this.message = message;
95 103
 
@@ -118,7 +126,7 @@ public abstract class StandardInputDialog extends StandardDialog {
118 126
      */
119 127
     private void initComponents() {
120 128
         orderButtons(new JButton(), new JButton());
121
-        textField = new ValidatingJTextField(validator);
129
+        textField = new ValidatingJTextField(controller.getIconManager(), validator);
122 130
         blurb = new TextLabel(message);
123 131
         validateText();
124 132
     }

+ 15
- 5
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionsPanel.java View File

@@ -27,6 +27,7 @@ import com.dmdirc.actions.ConditionTree;
27 27
 import com.dmdirc.actions.ConditionTreeFactory.ConditionTreeFactoryType;
28 28
 import com.dmdirc.interfaces.actions.ActionType;
29 29
 
30
+import com.dmdirc.ui.IconManager;
30 31
 import java.awt.event.ActionEvent;
31 32
 import java.awt.event.ActionListener;
32 33
 import java.beans.PropertyChangeEvent;
@@ -64,20 +65,29 @@ public class ActionConditionsPanel extends JPanel implements ActionListener,
64 65
     private boolean treeValidates = true;
65 66
     /** list validates? */
66 67
     private boolean listValidates = true;
68
+    /** Icon manager. */
69
+    private IconManager iconManager;
67 70
 
68
-    /** Instantiates the panel. */
69
-    public ActionConditionsPanel() {
70
-        this(null);
71
+    /**
72
+     * Instantiates the panel.
73
+     *
74
+     * @param iconManager Icon manager
75
+     */
76
+    public ActionConditionsPanel(final IconManager iconManager) {
77
+        this(iconManager, null);
71 78
     }
72 79
 
73 80
     /**
74 81
      * Instantiates the panel.
75 82
      *
83
+     * @param iconManager Icon manager
76 84
      * @param trigger Action trigger
77 85
      */
78
-    public ActionConditionsPanel(final ActionType trigger) {
86
+    public ActionConditionsPanel(final IconManager iconManager,
87
+            final ActionType trigger) {
79 88
         super();
80 89
 
90
+        this.iconManager = iconManager;
81 91
         initComponents();
82 92
         addListeners();
83 93
         layoutComponents();
@@ -95,7 +105,7 @@ public class ActionConditionsPanel extends JPanel implements ActionListener,
95 105
 
96 106
     /** Initialises the components. */
97 107
     private void initComponents() {
98
-        tree = new ActionConditionsTreePanel();
108
+        tree = new ActionConditionsTreePanel(iconManager);
99 109
         list = new ActionConditionsListPanel(tree);
100 110
         add = new JButton("Add");
101 111
     }

+ 8
- 2
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionsTreePanel.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.addons.ui_swing.components.text.TextLabel;
29 29
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
30 30
 import com.dmdirc.actions.validators.ConditionRuleValidator;
31 31
 
32
+import com.dmdirc.ui.IconManager;
32 33
 import java.awt.event.ActionEvent;
33 34
 import java.awt.event.ActionListener;
34 35
 import java.beans.PropertyChangeEvent;
@@ -72,13 +73,18 @@ public class ActionConditionsTreePanel extends JPanel implements ActionListener,
72 73
     private ConditionRuleValidator treeValidator;
73 74
     /** validates. */
74 75
     private boolean validates = true;
76
+    /** Icon manager. */
77
+    private IconManager iconManager;
75 78
 
76 79
     /**
77 80
      * Instantiates the panel.
81
+     *
82
+     * @param iconManager Icon manager
78 83
      */
79
-    public ActionConditionsTreePanel() {
84
+    public ActionConditionsTreePanel(final IconManager iconManager) {
80 85
         super();
81 86
 
87
+        this.iconManager = iconManager;
82 88
         initComponents();
83 89
         addListeners();
84 90
         layoutComponents();
@@ -94,7 +100,7 @@ public class ActionConditionsTreePanel extends JPanel implements ActionListener,
94 100
         customButton = new JRadioButton("The conditions match a custom rule");
95 101
         treeValidator = new ConditionRuleValidator(conditionCount);
96 102
 
97
-        rule = new ValidatingJTextField(treeValidator);
103
+        rule = new ValidatingJTextField(iconManager, treeValidator);
98 104
 
99 105
         group.add(allButton);
100 106
         group.add(oneButton);

+ 29
- 16
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionEditorDialog.java View File

@@ -25,6 +25,7 @@ package com.dmdirc.addons.ui_swing.dialogs.actioneditor;
25 25
 import com.dmdirc.actions.Action;
26 26
 import com.dmdirc.actions.ActionStatus;
27 27
 import com.dmdirc.addons.ui_swing.dialogs.StandardDialog;
28
+import com.dmdirc.ui.IconManager;
28 29
 
29 30
 import java.awt.Dimension;
30 31
 import java.awt.Window;
@@ -78,30 +79,36 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
78 79
     private Action action;
79 80
     /** Action group. */
80 81
     private String group;
82
+    /** Icon manager. */
83
+    private IconManager iconManager;
81 84
 
82 85
     /**
83 86
      * Instantiates the panel.
84 87
      *
88
+     * @param iconManager Icon manager
85 89
      * @param window Parent window
86 90
      * @param group Action's group
87 91
      */
88
-    private ActionEditorDialog(final Window window, final String group) {
89
-        this(window, group, null);
92
+    private ActionEditorDialog(final IconManager iconManager,
93
+            final Window window, final String group) {
94
+        this(iconManager, window, group, null);
90 95
     }
91 96
 
92 97
     /**
93 98
      * Instantiates the panel.
94 99
      *
100
+     * @param iconManager Icon manager
95 101
      * @param window Parent window
96 102
      * @param action Action to be edited
97 103
      * @param group Action's group
98 104
      */
99
-    private ActionEditorDialog(final Window window, final String group,
100
-            final Action action) {
105
+    private ActionEditorDialog(final IconManager iconManager,
106
+            final Window window, final String group, final Action action) {
101 107
         super(window, ModalityType.DOCUMENT_MODAL);
102 108
         setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
103 109
         setTitle("Action Editor");
104 110
 
111
+        this.iconManager = iconManager;
105 112
         this.group = group;
106 113
         this.action = action;
107 114
 
@@ -127,24 +134,26 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
127 134
     /**
128 135
      * Creates the dialog if one doesn't exist, and displays it.
129 136
      *
137
+     * @param iconManager Icon manager
130 138
      * @param window Parent window
131 139
      * @param group Action's group
132 140
      */
133
-    public static void showActionEditorDialog(final Window window,
134
-            final String group) {
135
-        showActionEditorDialog(window, group, null);
141
+    public static void showActionEditorDialog(final IconManager iconManager,
142
+            final Window window, final String group) {
143
+        showActionEditorDialog(iconManager, window, group, null);
136 144
     }
137 145
 
138 146
     /**
139 147
      * Creates the dialog if one doesn't exist, and displays it.
140 148
      *
149
+     * @param iconManager Icon manager
141 150
      * @param window Parent window
142 151
      * @param group Action's group
143 152
      * @param action Action to be edited
144 153
      */
145
-    public static void showActionEditorDialog(final Window window,
146
-            final String group, final Action action) {
147
-        getActionEditorDialog(window, group, action);
154
+    public static void showActionEditorDialog(final IconManager iconManager,
155
+            final Window window, final String group, final Action action) {
156
+        getActionEditorDialog(iconManager, window, group, action);
148 157
 
149 158
         me.display();
150 159
     }
@@ -152,30 +161,34 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
152 161
     /**
153 162
      * Returns the current instance of the ActionEditorDialog.
154 163
      *
164
+     * @param iconManager Icon manager
155 165
      * @param window Parent window
156 166
      * @param group Action's group
157 167
      *
158 168
      * @return The current ActionEditorDialog instance
159 169
      */
160
-    public static ActionEditorDialog getActionEditorDialog(final Window window,
170
+    public static ActionEditorDialog getActionEditorDialog(
171
+            final IconManager iconManager, final Window window,
161 172
             final String group) {
162
-        return getActionEditorDialog(window, group, null);
173
+        return getActionEditorDialog(iconManager, window, group, null);
163 174
     }
164 175
 
165 176
     /**
166 177
      * Returns the current instance of the ActionEditorDialog.
167 178
      *
179
+     * @param iconManager Icon manager
168 180
      * @param window Parent window
169 181
      * @param group Action's group
170 182
      * @param action Action to be edited
171 183
      *
172 184
      * @return The current ActionEditorDialog instance
173 185
      */
174
-    public static ActionEditorDialog getActionEditorDialog(final Window window,
186
+    public static ActionEditorDialog getActionEditorDialog(
187
+            final IconManager iconManager, final Window window,
175 188
             final String group, final Action action) {
176 189
         synchronized (ActionEditorDialog.class) {
177 190
             if (me == null) {
178
-                me = new ActionEditorDialog(window, group, action);
191
+                me = new ActionEditorDialog(iconManager, window, group, action);
179 192
             }
180 193
         }
181 194
 
@@ -212,10 +225,10 @@ public class ActionEditorDialog extends StandardDialog implements ActionListener
212 225
     /** Initialises the components. */
213 226
     private void initComponents() {
214 227
         orderButtons(new JButton(), new JButton());
215
-        name = new ActionNamePanel("", group);
228
+        name = new ActionNamePanel(iconManager, "", group);
216 229
         triggers = new ActionTriggersPanel();
217 230
         response = new ActionResponsePanel();
218
-        conditions = new ActionConditionsPanel();
231
+        conditions = new ActionConditionsPanel(iconManager);
219 232
         substitutions = new ActionSubstitutionsPanel();
220 233
         advanced = new ActionAdvancedPanel();
221 234
         showSubstitutions = new JButton("Show Substitutions");

+ 12
- 4
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionNamePanel.java View File

@@ -26,6 +26,7 @@ import com.dmdirc.actions.ActionGroup;
26 26
 import com.dmdirc.actions.ActionManager;
27 27
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
28 28
 import com.dmdirc.actions.validators.ActionNameValidator;
29
+import com.dmdirc.ui.IconManager;
29 30
 import com.dmdirc.util.validators.FileNameValidator;
30 31
 import com.dmdirc.util.validators.ValidatorChain;
31 32
 
@@ -57,23 +58,28 @@ public class ActionNamePanel extends JPanel implements PropertyChangeListener {
57 58
     private ValidatingJTextField name;
58 59
     /** Action group. */
59 60
     private ActionGroup group;
61
+    /** Icon manager. */
62
+    private IconManager iconManager;
60 63
 
61 64
     /**
62 65
      * Instantiates the panel.
63 66
      *
67
+     * @param iconManager Icon manager
64 68
      * @param group Associated group for this action
65 69
      */
66
-    public ActionNamePanel(final String group) {
67
-        this("", group);
70
+    public ActionNamePanel(final IconManager iconManager, final String group) {
71
+        this(iconManager, "", group);
68 72
     }
69 73
 
70 74
     /**
71 75
      * Instantiates the panel.
72 76
      *
77
+     * @param iconManager Icon manager
73 78
      * @param name Initial name of the action
74 79
      * @param group Associated group for this action
75 80
      */
76
-    public ActionNamePanel(final String name, final String group) {
81
+    public ActionNamePanel(final IconManager iconManager, final String name,
82
+            final String group) {
77 83
         super();
78 84
 
79 85
         if (name == null) {
@@ -81,6 +87,7 @@ public class ActionNamePanel extends JPanel implements PropertyChangeListener {
81 87
         } else {
82 88
             this.existingName = name;
83 89
         }
90
+        this.iconManager = iconManager;
84 91
         this.group = ActionManager.getActionManager().getOrCreateGroup(group);
85 92
 
86 93
         initComponents();
@@ -114,7 +121,8 @@ public class ActionNamePanel extends JPanel implements PropertyChangeListener {
114 121
     /** Initialises the components. */
115 122
     @SuppressWarnings("unchecked")
116 123
     private void initComponents() {
117
-        name = new ValidatingJTextField(new JTextField(existingName),
124
+        name = new ValidatingJTextField(iconManager,
125
+                new JTextField(existingName),
118 126
                 new ValidatorChain<String>(new FileNameValidator(),
119 127
                 new ActionNameValidator(group, existingName)));
120 128
     }

+ 11
- 5
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionGroupSettingsPanel.java View File

@@ -61,27 +61,34 @@ public final class ActionGroupSettingsPanel extends JPanel implements ActionList
61 61
     private Map<JButton, PreferencesSetting> settingMap;
62 62
     /** Parent dialog. */
63 63
     private Window window;
64
+    /** Prefs component factory. */
65
+    private PrefsComponentFactory factory;
64 66
 
65 67
     /**
66 68
      * Initialises a new action group information panel.
67 69
      *
70
+     * @param factory Prefs component factory
68 71
      * @param group Action group
69 72
      */
70
-    public ActionGroupSettingsPanel(final ActionGroup group) {
71
-        this(group, null);
73
+    public ActionGroupSettingsPanel(final PrefsComponentFactory factory,
74
+            final ActionGroup group) {
75
+        this(factory, group, null);
72 76
     }
73 77
 
74 78
     /**
75 79
      * Initialises a new action group information panel.
76 80
      *
81
+     * @param factory Prefs component factory
77 82
      * @param group Action group
78 83
      * @param window Parent window
79 84
      *
80 85
      * @since 0.6
81 86
      */
82
-    public ActionGroupSettingsPanel(final ActionGroup group, final Window window) {
87
+    public ActionGroupSettingsPanel(final PrefsComponentFactory factory,
88
+            final ActionGroup group, final Window window) {
83 89
         super();
84 90
 
91
+        this.factory = factory;
85 92
         this.window = window;
86 93
 
87 94
         initComponents();
@@ -114,8 +121,7 @@ public final class ActionGroupSettingsPanel extends JPanel implements ActionList
114 121
         for (PreferencesSetting setting : settings) {
115 122
             final JLabel label = new JLabel(setting.getTitle());
116 123
             label.setToolTipText(setting.getTitle());
117
-            final JComponent component =
118
-                    PrefsComponentFactory.getComponent(setting);
124
+            final JComponent component = factory.getComponent(setting);
119 125
 
120 126
             if (component instanceof DurationDisplay) {
121 127
                 ((DurationDisplay) component).setWindow(window);

+ 11
- 4
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanel.java View File

@@ -32,6 +32,7 @@ import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
32 32
 import com.dmdirc.addons.ui_swing.dialogs.StringArrayComparator;
33 33
 import com.dmdirc.addons.ui_swing.dialogs.actioneditor.ActionEditorDialog;
34 34
 
35
+import com.dmdirc.ui.IconManager;
35 36
 import java.awt.Window;
36 37
 import java.awt.Dialog.ModalityType;
37 38
 import java.awt.event.ActionEvent;
@@ -81,16 +82,21 @@ public final class ActionsGroupPanel extends JPanel implements ActionListener,
81 82
     private JButton delete;
82 83
     /** Action group. */
83 84
     private ActionGroup group;
85
+    /** Prefs component factory. */
86
+    private IconManager iconManager;
84 87
 
85 88
     /**
86 89
      * Creates a new instance of ActionsManagerDialog.
87 90
      *
91
+     * @param iconManager Prefs component factory
88 92
      * @param parent Parent window
89 93
      * @param group Action group to display
90 94
      */
91
-    public ActionsGroupPanel(final Window parent, final ActionGroup group) {
95
+    public ActionsGroupPanel(final IconManager iconManager,
96
+            final Window parent, final ActionGroup group) {
92 97
         super();
93 98
 
99
+        this.iconManager = iconManager;
94 100
         this.parent = parent;
95 101
         this.group = group;
96 102
 
@@ -243,10 +249,11 @@ public final class ActionsGroupPanel extends JPanel implements ActionListener,
243 249
     @Override
244 250
     public void actionPerformed(final ActionEvent e) {
245 251
         if (e.getSource() == add) {
246
-            ActionEditorDialog.showActionEditorDialog(parent, group.getName());
252
+            ActionEditorDialog.showActionEditorDialog(iconManager, parent,
253
+                    group.getName());
247 254
         } else if (e.getSource() == edit) {
248
-            ActionEditorDialog.showActionEditorDialog(parent, group.getName(),
249
-                    model.getAction(
255
+            ActionEditorDialog.showActionEditorDialog(iconManager, parent,
256
+                    group.getName(), model.getAction(
250 257
                     table.getRowSorter().convertRowIndexToModel(table.
251 258
                     getSelectedRow())));
252 259
         } else if (e.getSource() == delete) {

+ 16
- 11
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsManagerDialog.java View File

@@ -77,6 +77,12 @@ public final class ActionsManagerDialog extends StandardDialog implements
77 77
     private static final long serialVersionUID = 1;
78 78
     /** Previously created instance of ActionsManagerDialog. */
79 79
     private static volatile ActionsManagerDialog me;
80
+    /** Are we saving? */
81
+    private final AtomicBoolean saving = new AtomicBoolean(false);
82
+    /** Duplicate action group validator. */
83
+    private final ValidatorChain<String> validator;
84
+    /** Swing controller. */
85
+    private final SwingController controller;
80 86
     /** Info label. */
81 87
     private TextLabel infoLabel;
82 88
     /** Group list. */
@@ -97,10 +103,6 @@ public final class ActionsManagerDialog extends StandardDialog implements
97 103
     private ActionGroupSettingsPanel activeSettings;
98 104
     /** Group panel. */
99 105
     private JPanel groupPanel;
100
-    /** Are we saving? */
101
-    private final AtomicBoolean saving = new AtomicBoolean(false);
102
-    /** Duplicate action group validator. */
103
-    private final ValidatorChain<String> validator;
104 106
 
105 107
     /**
106 108
      * Creates a new instance of ActionsManagerDialog.
@@ -111,6 +113,7 @@ public final class ActionsManagerDialog extends StandardDialog implements
111 113
         super(Apple.isAppleUI() ? new AppleJFrame((MainFrame) parentWindow,
112 114
                 controller) : null, ModalityType.MODELESS);
113 115
 
116
+        this.controller= controller;
114 117
         initComponents();
115 118
         validator = new ValidatorChain<String>(
116 119
                 new ActionGroupNoDuplicatesInListValidator(groups,
@@ -180,10 +183,11 @@ public final class ActionsManagerDialog extends StandardDialog implements
180 183
                 + " to suit your needs.");
181 184
         groups = new JList(new SortedListModel<ActionGroup>(
182 185
                 new ActionGroupNameComparator()));
183
-        actions = new ActionsGroupPanel(this, null);
186
+        actions = new ActionsGroupPanel(controller.getIconManager(), this, null);
184 187
         info = new ActionGroupInformationPanel(null);
185 188
         settings = new HashMap<ActionGroup, ActionGroupSettingsPanel>();
186
-        activeSettings = new ActionGroupSettingsPanel(null, this);
189
+        activeSettings = new ActionGroupSettingsPanel(controller
190
+                .getPrefsComponentFactory(), null, this);
187 191
         settings.put(null, activeSettings);
188 192
         add = new JButton("Add");
189 193
         edit = new JButton("Edit");
@@ -294,7 +298,8 @@ public final class ActionsManagerDialog extends StandardDialog implements
294 298
         actions.setActionGroup(group);
295 299
         if (!settings.containsKey(group)) {
296 300
             final ActionGroupSettingsPanel currentSettings =
297
-                    new ActionGroupSettingsPanel(group, this);
301
+                    new ActionGroupSettingsPanel(controller
302
+                    .getPrefsComponentFactory(), group, this);
298 303
             settings.put(group, currentSettings);
299 304
             currentSettings.setBorder(BorderFactory.createTitledBorder(
300 305
                     UIManager.getBorder("TitledBorder.border"), "Settings"));
@@ -330,7 +335,7 @@ public final class ActionsManagerDialog extends StandardDialog implements
330 335
             for (ActionGroupSettingsPanel loopSettings : settings.values()) {
331 336
                 loopSettings.save();
332 337
             }
333
-            IdentityManager.getConfigIdentity().setOption("dialogstate",
338
+            controller.getGlobalIdentity().setOption("dialogstate",
334 339
                     "actionsmanagerdialog", groups.getSelectedIndex());
335 340
             dispose();
336 341
         }
@@ -342,7 +347,7 @@ public final class ActionsManagerDialog extends StandardDialog implements
342 347
     private void addGroup() {
343 348
         final int index = groups.getSelectedIndex();
344 349
         groups.getSelectionModel().clearSelection();
345
-        new StandardInputDialog(this,
350
+        new StandardInputDialog(controller, this,
346 351
                 ModalityType.DOCUMENT_MODAL, "New action group",
347 352
                 "Please enter the name of the new action group", validator) {
348 353
 
@@ -382,8 +387,8 @@ public final class ActionsManagerDialog extends StandardDialog implements
382 387
     private void editGroup() {
383 388
         final String oldName =
384 389
                 ((ActionGroup) groups.getSelectedValue()).getName();
385
-        final StandardInputDialog inputDialog = new StandardInputDialog(this,
386
-                ModalityType.DOCUMENT_MODAL, "Edit action group",
390
+        final StandardInputDialog inputDialog = new StandardInputDialog(
391
+                controller, this, ModalityType.DOCUMENT_MODAL, "Edit action group",
387 392
                 "Please enter the new name of the action group", validator) {
388 393
 
389 394
             /** Java Serialisation verion ID. */

+ 16
- 7
src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasManagerDialog.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.actions.ActionManager;
28 28
 import com.dmdirc.actions.CoreActionComparison;
29 29
 import com.dmdirc.actions.wrappers.Alias;
30 30
 import com.dmdirc.actions.wrappers.AliasWrapper;
31
+import com.dmdirc.addons.ui_swing.SwingController;
31 32
 import com.dmdirc.addons.ui_swing.components.PackingTable;
32 33
 import com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer;
33 34
 import com.dmdirc.addons.ui_swing.components.renderers.ArrayCellRenderer;
@@ -86,17 +87,22 @@ public final class AliasManagerDialog extends StandardDialog implements
86 87
     private int selectedRow;
87 88
     /** Substitutions panel. */
88 89
     private AliasSubstitutionsPanel subsPanel;
89
-    /** Show/Hide subsitution button. */
90
+    /** Show/Hide substitution button. */
90 91
     private JButton showSubs;
92
+    /** Swing controller. */
93
+    private SwingController controller;
91 94
 
92 95
     /**
93 96
      * Creates a new instance of ErrorListDialog.
94 97
      *
98
+     * @param controller Swing controller
95 99
      * @param parentWindow Parent window
96 100
      */
97
-    private AliasManagerDialog(final Window parentWindow) {
101
+    private AliasManagerDialog(final SwingController controller,
102
+            final Window parentWindow) {
98 103
         super(parentWindow, ModalityType.MODELESS);
99 104
 
105
+        this.controller = controller;
100 106
         setTitle("Alias manager");
101 107
 
102 108
         selectedRow = -1;
@@ -109,10 +115,12 @@ public final class AliasManagerDialog extends StandardDialog implements
109 115
     /**
110 116
      * Creates the dialog if one doesn't exist, and displays it.
111 117
      *
118
+     * @param controller Swing controller
112 119
      * @param parentWindow Parent window
113 120
      */
114
-    public static void showAliasManagerDialog(final Window parentWindow) {
115
-        me = getAliasManagerDialog(parentWindow);
121
+    public static void showAliasManagerDialog(final SwingController controller,
122
+            final Window parentWindow) {
123
+        me = getAliasManagerDialog(controller, parentWindow);
116 124
 
117 125
         me.display();
118 126
         me.requestFocusInWindow();
@@ -121,15 +129,16 @@ public final class AliasManagerDialog extends StandardDialog implements
121 129
     /**
122 130
      * Returns the instance of AliasManagerDialog.
123 131
      *
132
+     * @param controller Swing controller
124 133
      * @param parentWindow Parent window
125 134
      *
126 135
      * @return Instance of AliasManagerDialog
127 136
      */
128 137
     public static AliasManagerDialog getAliasManagerDialog(
129
-            final Window parentWindow) {
138
+            final SwingController controller, final Window parentWindow) {
130 139
         synchronized (AliasManagerDialog.class) {
131 140
             if (me == null) {
132
-                me = new AliasManagerDialog(parentWindow);
141
+                me = new AliasManagerDialog(controller, parentWindow);
133 142
             }
134 143
         }
135 144
 
@@ -187,7 +196,7 @@ public final class AliasManagerDialog extends StandardDialog implements
187 196
 
188 197
         scrollPane.setViewportView(table);
189 198
 
190
-        aliasDetails = new AliasPanel();
199
+        aliasDetails = new AliasPanel(controller);
191 200
         subsPanel = new AliasSubstitutionsPanel();
192 201
         subsPanel.setVisible(false);
193 202
         showSubs = new JButton("Show Substitutions");

+ 10
- 4
src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasPanel.java View File

@@ -26,6 +26,7 @@ import com.dmdirc.actions.ActionCondition;
26 26
 import com.dmdirc.actions.CoreActionComparison;
27 27
 import com.dmdirc.actions.CoreActionComponent;
28 28
 import com.dmdirc.actions.wrappers.Alias;
29
+import com.dmdirc.addons.ui_swing.SwingController;
29 30
 import com.dmdirc.addons.ui_swing.UIUtilities;
30 31
 import com.dmdirc.addons.ui_swing.components.inputfields.ValidatingTextFieldInputField;
31 32
 import com.dmdirc.addons.ui_swing.components.renderers.ActionComparisonCellRenderer;
@@ -70,13 +71,18 @@ public final class AliasPanel extends JPanel implements ActionListener {
70 71
     /** Alias. */
71 72
     private Alias alias;
72 73
 
73
-    /** Creates a new instance of AliasPanel. */
74
+    /**
75
+     * Creates a new instance of AliasPanel.
76
+     *
77
+     * @param controller Swing controller
78
+     */
74 79
     @SuppressWarnings("unchecked")
75
-    public AliasPanel() {
80
+    public AliasPanel(final SwingController controller) {
76 81
         super();
77 82
 
78
-        command = new ValidatingTextFieldInputField(new ValidatorChain<String>(
79
-                new CommandNameValidator(), new FileNameValidator()));
83
+        command = new ValidatingTextFieldInputField(controller,
84
+                new ValidatorChain<String>(new CommandNameValidator(),
85
+                new FileNameValidator()));
80 86
         command.setEnabled(false);
81 87
         //new SwingInputHandler(command, GlobalCommandParser
82 88
         //        .getGlobalCommandParser(), inputWindow)

+ 15
- 9
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelListModesPane.java View File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.dialogs.channelsetting;
24 24
 
25 25
 import com.dmdirc.Channel;
26
+import com.dmdirc.addons.ui_swing.SwingController;
26 27
 import com.dmdirc.addons.ui_swing.UIUtilities;
27 28
 import com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer;
28 29
 import com.dmdirc.addons.ui_swing.components.renderers.ListModeCellRenderer;
@@ -88,27 +89,32 @@ public final class ChannelListModesPane extends JPanel implements ActionListener
88 89
     private final MapList<Character, ChannelListModeItem> existingListItems;
89 90
     /** Mode count label. */
90 91
     private final JLabel modeCount;
91
-    /** Cell renderer. */
92
-    private ListCellRenderer renderer;
93 92
     /** Extended info toggle. */
94 93
     private final JCheckBox toggle;
95 94
     /** Parent window. */
96 95
     private final Window parentWindow;
96
+    /** Swing controller. */
97
+    private final SwingController controller;
98
+    /** Cell renderer. */
99
+    private ListCellRenderer renderer;
97 100
 
98 101
     /**
99 102
      * Creates a new instance of ChannelListModePane.
100 103
      *
104
+     * @param controller Swing controller
101 105
      * @param channel Parent channel
102 106
      * @param parentWindow Parent window
103 107
      */
104
-    public ChannelListModesPane(final Channel channel, final Window parentWindow) {
108
+    public ChannelListModesPane(final SwingController controller,
109
+            final Channel channel, final Window parentWindow) {
105 110
         super();
106 111
 
112
+        this.controller = controller;
107 113
         this.setOpaque(UIUtilities.getTabbedPaneOpaque());
108 114
         this.channel = channel;
109 115
         this.parentWindow = parentWindow;
110 116
 
111
-        if (IdentityManager.getGlobalConfig().getOptionBool("general",
117
+        if (channel.getConfigManager().getOptionBool("general",
112 118
                 "extendedListModes")) {
113 119
             renderer = new ExtendedListModeCellRenderer();
114 120
         } else {
@@ -125,7 +131,7 @@ public final class ChannelListModesPane extends JPanel implements ActionListener
125 131
         removeListModeButton.setEnabled(false);
126 132
         modeCount = new JLabel();
127 133
         toggle = new JCheckBox("Show extended information",
128
-                IdentityManager.getGlobalConfig().getOptionBool("general",
134
+                channel.getConfigManager().getOptionBool("general",
129 135
                 "extendedListModes"));
130 136
         toggle.setOpaque(UIUtilities.getTabbedPaneOpaque());
131 137
 
@@ -220,7 +226,7 @@ public final class ChannelListModesPane extends JPanel implements ActionListener
220 226
         removeListModeButton.addActionListener(this);
221 227
         listModesMenu.addActionListener(this);
222 228
         toggle.addActionListener(this);
223
-        IdentityManager.getGlobalConfig().addChangeListener("general",
229
+        channel.getConfigManager().addChangeListener("general",
224 230
                 "extendedListModes", this);
225 231
 
226 232
     }
@@ -270,7 +276,7 @@ public final class ChannelListModesPane extends JPanel implements ActionListener
270 276
 
271 277
         channel.getChannelInfo().flushModes();
272 278
 
273
-        IdentityManager.getConfigIdentity().setOption("general",
279
+        controller.getGlobalIdentity().setOption("general",
274 280
                 "extendedListModes", toggle.isSelected());
275 281
     }
276 282
 
@@ -283,8 +289,8 @@ public final class ChannelListModesPane extends JPanel implements ActionListener
283 289
             modeText = channel.getConfigManager().
284 290
                     getOption("server", "mode" + listModesArray[selectedIndex]);
285 291
         }
286
-        new StandardInputDialog(parentWindow, ModalityType.DOCUMENT_MODAL,
287
-                "Add new " + modeText,
292
+        new StandardInputDialog(controller, parentWindow,
293
+                ModalityType.DOCUMENT_MODAL, "Add new " + modeText,
288 294
                 "Please enter the hostmask for the new " + modeText,
289 295
                 new NotEmptyValidator()) {
290 296
 

+ 25
- 16
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java View File

@@ -24,6 +24,7 @@ package com.dmdirc.addons.ui_swing.dialogs.channelsetting;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.components.modes.ChannelModesPane;
26 26
 import com.dmdirc.Channel;
27
+import com.dmdirc.addons.ui_swing.SwingController;
27 28
 import com.dmdirc.addons.ui_swing.UIUtilities;
28 29
 import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel;
29 30
 import com.dmdirc.addons.ui_swing.dialogs.StandardDialog;
@@ -59,6 +60,12 @@ public final class ChannelSettingsDialog extends StandardDialog implements
59 60
     private static volatile ChannelSettingsDialog me;
60 61
     /** The channel object that this dialog belongs to. */
61 62
     private final Channel channel;
63
+    /** Channel identity file. */
64
+    private final Identity identity;
65
+    /** Channel window. */
66
+    private final InputWindow channelWindow;
67
+    /** Swing controller. */
68
+    private final SwingController controller;
62 69
     /** Tabbed pane. */
63 70
     private JTabbedPane tabbedPane;
64 71
     /** Client settings panel. */
@@ -69,20 +76,19 @@ public final class ChannelSettingsDialog extends StandardDialog implements
69 76
     private TopicPane topicModesPane;
70 77
     /** List modes panel. */
71 78
     private ChannelListModesPane channelListModesPane;
72
-    /** Channel identity file. */
73
-    private final Identity identity;
74
-    /** Channel window. */
75
-    private final InputWindow channelWindow;
76 79
 
77 80
     /**
78 81
      * Creates a new instance of ChannelSettingsDialog.
79 82
      *
83
+     * @param controller Swing controller
80 84
      * @param newChannel The channel object that we're editing settings for
81 85
      */
82
-    private ChannelSettingsDialog(final Channel newChannel,
83
-            final Window parentWindow, final InputWindow channelWindow) {
86
+    private ChannelSettingsDialog(final SwingController controller,
87
+            final Channel newChannel, final Window parentWindow,
88
+            final InputWindow channelWindow) {
84 89
         super(parentWindow, ModalityType.MODELESS);
85 90
 
91
+        this.controller = controller;
86 92
         channel = newChannel;
87 93
         identity = IdentityManager.getChannelConfig(channel.getServer().
88 94
                 getNetwork(), channel.getChannelInfo().getName());
@@ -95,14 +101,16 @@ public final class ChannelSettingsDialog extends StandardDialog implements
95 101
     /**
96 102
      * Creates the dialog if one doesn't exist, and displays it.
97 103
      *
104
+     * @param controller Swing controller
98 105
      * @param channel The channel object that we're editing settings for
99 106
      * @param parentWindow Parent window
100 107
      * @param channelWindow Channel window
101 108
      */
102 109
     public static void showChannelSettingsDialog(
103
-            final Channel channel, final Window parentWindow,
104
-            final InputWindow channelWindow) {
105
-        me = getChannelSettingsDialog(channel, parentWindow, channelWindow);
110
+            final SwingController controller, final Channel channel,
111
+            final Window parentWindow,final InputWindow channelWindow) {
112
+        me = getChannelSettingsDialog(controller, channel, parentWindow,
113
+                channelWindow);
106 114
 
107 115
         me.display();
108 116
         me.requestFocusInWindow();
@@ -111,6 +119,7 @@ public final class ChannelSettingsDialog extends StandardDialog implements
111 119
     /**
112 120
      * Returns the current instance of the ChannelSettingsDialog.
113 121
      *
122
+     * @param controller Swing controller
114 123
      * @param channel The channel object that we're editing settings for
115 124
      * @param parentWindow Parent window
116 125
      * @param channelWindow Channel window
@@ -118,12 +127,12 @@ public final class ChannelSettingsDialog extends StandardDialog implements
118 127
      * @return The current ChannelSettingsDialog instance
119 128
      */
120 129
     public static ChannelSettingsDialog getChannelSettingsDialog(
121
-            final Channel channel, final Window parentWindow,
122
-            final InputWindow channelWindow) {
130
+            final SwingController controller, final Channel channel,
131
+            final Window parentWindow, final InputWindow channelWindow) {
123 132
         synchronized (ChannelSettingsDialog.class) {
124 133
             if (me == null) {
125
-                me = new ChannelSettingsDialog(channel, parentWindow,
126
-                        channelWindow);
134
+                me = new ChannelSettingsDialog(controller, channel,
135
+                        parentWindow, channelWindow);
127 136
             }
128 137
         }
129 138
 
@@ -166,7 +175,7 @@ public final class ChannelSettingsDialog extends StandardDialog implements
166 175
 
167 176
     /** Initialises the IRC Settings tab. */
168 177
     private void initIrcTab() {
169
-        channelModesPane = new ChannelModesPane(channel);
178
+        channelModesPane = new ChannelModesPane(controller, channel);
170 179
 
171 180
         final JScrollPane channelModesSP = new JScrollPane(channelModesPane);
172 181
         channelModesSP.setHorizontalScrollBarPolicy(
@@ -180,7 +189,7 @@ public final class ChannelSettingsDialog extends StandardDialog implements
180 189
 
181 190
     /** Initialises the IRC Settings tab. */
182 191
     private void initListModesTab() {
183
-        channelListModesPane = new ChannelListModesPane(channel, this);
192
+        channelListModesPane = new ChannelListModesPane(controller, channel, this);
184 193
         tabbedPane.addTab("List Modes", channelListModesPane);
185 194
     }
186 195
 
@@ -193,7 +202,7 @@ public final class ChannelSettingsDialog extends StandardDialog implements
193 202
 
194 203
     /** Initialises the channel settings. */
195 204
     private void initSettingsPanel() {
196
-        channelSettingsPane = new SettingsPanel(
205
+        channelSettingsPane = new SettingsPanel(controller,
197 206
                 "These settings are specific to this channel on this network,"
198 207
                 + " any settings specified here will overwrite global settings");
199 208
         channelSettingsPane.addOption(PreferencesManager

+ 12
- 4
src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryPanel.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs.prefs;
24 24
 
25
+import com.dmdirc.addons.ui_swing.PrefsComponentFactory;
25 26
 import com.dmdirc.addons.ui_swing.UIUtilities;
26 27
 import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
27 28
 import com.dmdirc.addons.ui_swing.components.TitlePanel;
@@ -76,26 +77,33 @@ public class CategoryPanel extends JPanel {
76 77
     private Map<PreferencesCategory, JPanel> panels;
77 78
     /** Category loading swing worker. */
78 79
     private LoggingSwingWorker worker;
80
+    /** Prefs component factory. */
81
+    private final PrefsComponentFactory factory;
79 82
 
80 83
     /**
81 84
      * Instantiates a new category panel.
82 85
      *
86
+     * @param factory Prefs component factory instance
83 87
      * @param parent Parent window
84 88
      */
85
-    public CategoryPanel(final SwingPreferencesDialog parent) {
86
-        this(parent, null);
89
+    public CategoryPanel(final PrefsComponentFactory factory,
90
+            final SwingPreferencesDialog parent) {
91
+        this(factory, parent, null);
87 92
     }
88 93
 
89 94
     /**
90 95
      * Instantiates a new category panel.
91 96
      *
97
+     * @param factory Prefs component factory instance
92 98
      * @param parent Parent window
93 99
      * @param category Initial category
94 100
      */
95
-    public CategoryPanel(final SwingPreferencesDialog parent,
101
+    public CategoryPanel(final PrefsComponentFactory factory,
102
+            final SwingPreferencesDialog parent,
96 103
             final PreferencesCategory category) {
97 104
         super(new MigLayout("fillx, wrap, ins 0"));
98 105
         this.parent = parent;
106
+        this.factory = factory;
99 107
 
100 108
         panels = Collections.synchronizedMap(
101 109
                 new HashMap<PreferencesCategory, JPanel>());
@@ -235,7 +243,7 @@ public class CategoryPanel extends JPanel {
235 243
                 }
236 244
             });
237 245
 
238
-            worker = new PrefsCategoryLoader(this, category);
246
+            worker = new PrefsCategoryLoader(factory, this, category);
239 247
             worker.executeInExecutor();
240 248
         } else {
241 249
             categoryLoaded(category);

+ 9
- 4
src/com/dmdirc/addons/ui_swing/dialogs/prefs/PrefsCategoryLoader.java View File

@@ -64,19 +64,26 @@ public class PrefsCategoryLoader extends LoggingSwingWorker<JPanel, Object> {
64 64
             getValue();
65 65
     /** Error panel. */
66 66
     private JPanel errorCategory;
67
+    /** Category panel. */
67 68
     private final CategoryPanel categoryPanel;
69
+    /** Category to display. */
68 70
     private final PreferencesCategory category;
71
+    /** Prefs component factory instance. */
72
+    private final PrefsComponentFactory factory;
69 73
 
70 74
     /**
71 75
      * Instantiates a new preferences category loader.
72 76
      *
77
+     * @param factory Prefs component factory instance
73 78
      * @param categoryPanel Parent Category panel
74 79
      * @param category Preferences Category to load
75 80
      */
76
-    public PrefsCategoryLoader(final CategoryPanel categoryPanel,
81
+    public PrefsCategoryLoader(final PrefsComponentFactory factory,
82
+            final CategoryPanel categoryPanel,
77 83
             final PreferencesCategory category) {
78 84
         super();
79 85
 
86
+        this.factory = factory;
80 87
         this.categoryPanel = categoryPanel;
81 88
         this.category = category;
82 89
 
@@ -93,8 +100,6 @@ public class PrefsCategoryLoader extends LoggingSwingWorker<JPanel, Object> {
93 100
 
94 101
     /**
95 102
      * {@inheritDoc}
96
-     *
97
-     * @throws Exception if unable to compute a result
98 103
      */
99 104
     @Override
100 105
     protected JPanel doInBackground() {
@@ -198,7 +203,7 @@ public class PrefsCategoryLoader extends LoggingSwingWorker<JPanel, Object> {
198 203
             /** {@inheritDoc} */
199 204
             @Override
200 205
             public void run() {
201
-                JComponent option = PrefsComponentFactory.getComponent(setting);
206
+                JComponent option = factory.getComponent(setting);
202 207
                 option.setToolTipText(null);
203 208
                 setObject(option);
204 209
             }

+ 4
- 2
src/com/dmdirc/addons/ui_swing/dialogs/prefs/SwingPreferencesDialog.java View File

@@ -110,7 +110,9 @@ public final class SwingPreferencesDialog extends StandardDialog implements
110 110
                             new PluginPanel(parentWindow, controller),
111 111
                             new ThemePanel(parentWindow, controller),
112 112
                             new UpdateConfigPanel(controller),
113
-                            new URLConfigPanel(parentWindow));
113
+                            new URLConfigPanel(controller, parentWindow),
114
+                            controller.getGlobalConfig(),
115
+                            controller.getGlobalIdentity());
114 116
                 } catch (IllegalArgumentException ex) {
115 117
                     mainPanel.setError(ex.getMessage());
116 118
                     Logger.appError(ErrorLevel.HIGH, "Unable to load the" +
@@ -183,7 +185,7 @@ public final class SwingPreferencesDialog extends StandardDialog implements
183 185
      * Initialises GUI components.
184 186
      */
185 187
     private void initComponents() {
186
-        mainPanel = new CategoryPanel(this);
188
+        mainPanel = new CategoryPanel(controller.getPrefsComponentFactory(), this);
187 189
 
188 190
         tabList = new JList(new DefaultListModel());
189 191
         tabList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

+ 10
- 4
src/com/dmdirc/addons/ui_swing/dialogs/prefs/URLConfigPanel.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs.prefs;
24 24
 
25
+import com.dmdirc.addons.ui_swing.SwingController;
25 26
 import com.dmdirc.addons.ui_swing.components.PackingTable;
26 27
 import com.dmdirc.addons.ui_swing.components.URLProtocolPanel;
27 28
 import com.dmdirc.addons.ui_swing.components.renderers.URIHandlerCellRenderer;
@@ -65,6 +66,8 @@ public class URLConfigPanel extends JPanel implements
65 66
      * objects being unserialized with the new class).
66 67
      */
67 68
     private static final long serialVersionUID = 1;
69
+    /** Swing controller. */
70
+    private final SwingController controller;
68 71
     /** Protocol list. */
69 72
     private PackingTable table;
70 73
     /** Table mode. */
@@ -89,11 +92,14 @@ public class URLConfigPanel extends JPanel implements
89 92
     /**
90 93
      * Instantiates a new URL config panel.
91 94
      *
95
+     * @param controller Swing controller
92 96
      * @param parentWindow Parent window
93 97
      */
94
-    public URLConfigPanel(final Window parentWindow) {
98
+    public URLConfigPanel(final SwingController controller,
99
+            final Window parentWindow) {
95 100
         super();
96 101
 
102
+        this.controller = controller;
97 103
         this.parentWindow = parentWindow;
98 104
 
99 105
         initComponents();
@@ -143,7 +149,7 @@ public class URLConfigPanel extends JPanel implements
143 149
 
144 150
         tableScrollPane.setViewportView(table);
145 151
 
146
-        final Set<String> options = IdentityManager.getGlobalConfig().
152
+        final Set<String> options = controller.getGlobalConfig().
147 153
                 getOptions("protocol").keySet();
148 154
 
149 155
         for (String option : options) {
@@ -261,8 +267,8 @@ public class URLConfigPanel extends JPanel implements
261 267
     @Override
262 268
     public void actionPerformed(final ActionEvent e) {
263 269
         if (e.getSource() == add) {
264
-            new StandardInputDialog(parentWindow, ModalityType.MODELESS,
265
-                    "New URL handler",
270
+            new StandardInputDialog(controller, parentWindow,
271
+                    ModalityType.MODELESS, "New URL handler",
266 272
                     "Please enter the name of the new protocol.",
267 273
                     new URLProtocolValidator()) {
268 274
 

+ 15
- 11
src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileDetailPanel.java View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs.profiles;
24 24
 
25
-import com.dmdirc.addons.ui_swing.MainFrame;
25
+import com.dmdirc.addons.ui_swing.SwingController;
26 26
 import com.dmdirc.addons.ui_swing.components.reorderablelist.ReorderableJList;
27 27
 import com.dmdirc.addons.ui_swing.components.validating.NoDuplicatesInListValidator;
28 28
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
@@ -67,8 +67,8 @@ public final class ProfileDetailPanel extends JPanel implements ActionListener,
67 67
      * objects being unserialized with the new class).
68 68
      */
69 69
     private static final long serialVersionUID = 2;
70
-    /** Main frame. */
71
-    private final MainFrame mainFrame;
70
+    /** Swing controller. */
71
+    private final SwingController controller;
72 72
     /** Parent window. */
73 73
     private final Window parentWindow;
74 74
     /** Displayed profile. */
@@ -102,14 +102,14 @@ public final class ProfileDetailPanel extends JPanel implements ActionListener,
102 102
      * Creates a new profile detail panel.
103 103
      *
104 104
      * @param model The list model to use to validate names
105
-     * @param mainFrame Main frame
105
+     * @param controller Swing controller
106 106
      * @param parentWindow Parent window
107 107
      */
108 108
     @SuppressWarnings("unchecked")
109 109
     public ProfileDetailPanel(final ProfileListModel model,
110
-            final MainFrame mainFrame, final Window parentWindow) {
110
+            final SwingController controller, final Window parentWindow) {
111 111
         super();
112
-        this.mainFrame = mainFrame;
112
+        this.controller = controller;
113 113
         this.parentWindow = parentWindow;
114 114
 
115 115
         this.model = model;
@@ -127,9 +127,12 @@ public final class ProfileDetailPanel extends JPanel implements ActionListener,
127 127
 
128 128
     /** Initialises the components in the main panel. */
129 129
     private void initMainComponents() {
130
-        name = new ValidatingJTextField(new ProfileNameValidator());
131
-        realname = new ValidatingJTextField(new NotEmptyValidator());
132
-        ident = new ValidatingJTextField(new IdentValidator());
130
+        name = new ValidatingJTextField(controller.getIconManager(),
131
+                new ProfileNameValidator());
132
+        realname = new ValidatingJTextField(controller.getIconManager(),
133
+                new NotEmptyValidator());
134
+        ident = new ValidatingJTextField(controller.getIconManager(),
135
+                new IdentValidator());
133 136
         nicknames = new ReorderableJList(nicknameModel);
134 137
 
135 138
         passBorder = nicknames.getBorder();
@@ -266,7 +269,8 @@ public final class ProfileDetailPanel extends JPanel implements ActionListener,
266 269
         if (e.getSource() == addButton) {
267 270
             final int index = nicknames.getSelectedIndex();
268 271
             nicknames.getSelectionModel().clearSelection();
269
-            new StandardInputDialog(ProfileManagerDialog.getProfileManagerDialog(mainFrame),
272
+            new StandardInputDialog(controller, ProfileManagerDialog
273
+                    .getProfileManagerDialog(controller),
270 274
                     ModalityType.DOCUMENT_MODAL, "New Nickname",
271 275
                     "Please enter the new nickname", validator) {
272 276
 
@@ -293,7 +297,7 @@ public final class ProfileDetailPanel extends JPanel implements ActionListener,
293 297
             }.display();
294 298
         } else if (e.getSource() == editButton) {
295 299
             final StandardInputDialog dialog = new StandardInputDialog(
296
-                    ProfileManagerDialog.getProfileManagerDialog(mainFrame),
300
+                    controller, ProfileManagerDialog.getProfileManagerDialog(controller),
297 301
                     ModalityType.DOCUMENT_MODAL, "Edit Nickname",
298 302
                     "Please enter the new nickname", validator) {
299 303
 

+ 15
- 15
src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileManagerDialog.java View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.dialogs.profiles;
24 24
 
25
-import com.dmdirc.addons.ui_swing.MainFrame;
25
+import com.dmdirc.addons.ui_swing.SwingController;
26 26
 import com.dmdirc.addons.ui_swing.components.ListScroller;
27 27
 import com.dmdirc.addons.ui_swing.components.renderers.ProfileListCellRenderer;
28 28
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
@@ -60,8 +60,8 @@ public final class ProfileManagerDialog extends StandardDialog implements
60 60
     private static final long serialVersionUID = 2;
61 61
     /** Previously created instance of ProfileEditorDialog. */
62 62
     private static volatile ProfileManagerDialog me;
63
-    /** main frame. */
64
-    private final MainFrame mainFrame;
63
+    /** Swing controller. */
64
+    private final SwingController controller;
65 65
     /** Profile list. */
66 66
     private JList profileList;
67 67
     /** Profile list mode. */
@@ -82,11 +82,11 @@ public final class ProfileManagerDialog extends StandardDialog implements
82 82
     /**
83 83
      * Creates a new instance of ProfileEditorDialog.
84 84
      *
85
-     * @param parentWindow main frame
85
+     * @param controller Swing controller
86 86
      */
87
-    private ProfileManagerDialog(final MainFrame mainFrame) {
88
-        super(mainFrame, ModalityType.MODELESS);
89
-        this.mainFrame = mainFrame;
87
+    private ProfileManagerDialog(final SwingController controller) {
88
+        super(controller.getMainFrame(), ModalityType.MODELESS);
89
+        this.controller = controller;
90 90
         deletedProfiles = new ArrayList<Profile>();
91 91
 
92 92
         initComponents();
@@ -105,10 +105,10 @@ public final class ProfileManagerDialog extends StandardDialog implements
105 105
     /**
106 106
      * Creates the dialog if one doesn't exist, and displays it.
107 107
      *
108
-     * @param mainFrame Main frame
108
+     * @param controller Swing controller
109 109
      */
110
-    public static void showProfileManagerDialog(final MainFrame mainFrame) {
111
-        me = getProfileManagerDialog(mainFrame);
110
+    public static void showProfileManagerDialog(final SwingController controller) {
111
+        me = getProfileManagerDialog(controller);
112 112
 
113 113
         me.display();
114 114
         me.requestFocusInWindow();
@@ -117,15 +117,15 @@ public final class ProfileManagerDialog extends StandardDialog implements
117 117
     /**
118 118
      * Returns the current instance of the ProfileManagerDialog.
119 119
      *
120
-     * @param mainFrame Main frame
120
+     * @param controller Swing controller
121 121
      *
122 122
      * @return The current ProfileManagerDialog instance
123 123
      */
124 124
     public static ProfileManagerDialog getProfileManagerDialog(
125
-            final MainFrame mainFrame) {
125
+            final SwingController controller) {
126 126
         synchronized (ProfileManagerDialog.class) {
127 127
             if (me == null) {
128
-                me = new ProfileManagerDialog(mainFrame);
128
+                me = new ProfileManagerDialog(controller);
129 129
             }
130 130
         }
131 131
 
@@ -142,7 +142,7 @@ public final class ProfileManagerDialog extends StandardDialog implements
142 142
 
143 143
         model = new ProfileListModel();
144 144
         profileList = new JList(model);
145
-        details = new ProfileDetailPanel(model, mainFrame, this);
145
+        details = new ProfileDetailPanel(model, controller, this);
146 146
         addButton = new JButton("Add");
147 147
         deleteButton = new JButton("Delete");
148 148
         infoLabel =
@@ -214,7 +214,7 @@ public final class ProfileManagerDialog extends StandardDialog implements
214 214
             dispose();
215 215
         }
216 216
         if (NewServerDialog.isNewServerDialogShowing()) {
217
-            NewServerDialog.getNewServerDialog(mainFrame).populateProfiles();
217
+            NewServerDialog.getNewServerDialog(controller).populateProfiles();
218 218
         }
219 219
     }
220 220
 

+ 9
- 3
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/AddEntryInputDialog.java View File

@@ -31,6 +31,7 @@ import com.dmdirc.util.validators.URIValidator;
31 31
 import com.dmdirc.util.validators.Validator;
32 32
 import com.dmdirc.addons.serverlists.ServerGroup;
33 33
 
34
+import com.dmdirc.ui.IconManager;
34 35
 import java.awt.Window;
35 36
 import java.awt.Dialog.ModalityType;
36 37
 import java.awt.event.ActionEvent;
@@ -75,18 +76,23 @@ public class AddEntryInputDialog extends StandardDialog {
75 76
     private final JTree items;
76 77
     /** Parent model. */
77 78
     private final ServerListModel model;
79
+    /** Icon manager. */
80
+    private final IconManager iconManager;
78 81
 
79 82
     /**
80 83
      * Instantiates a new standard input dialog.
81 84
      *
85
+     * @param iconManager Icon manager
82 86
      * @param items Parent tree
83 87
      * @param owner Dialog owner
84 88
      * @param model Server list model
85 89
      */
86
-    public AddEntryInputDialog(final Window owner, final JTree items,
90
+    public AddEntryInputDialog(final IconManager iconManager,
91
+            final Window owner, final JTree items,
87 92
             final ServerListModel model) {
88 93
         super(owner, ModalityType.MODELESS);
89 94
 
95
+        this.iconManager = iconManager;
90 96
         this.items = items;
91 97
         this.model = model;
92 98
         this.entryValidator = new NotEmptyValidator();
@@ -122,8 +128,8 @@ public class AddEntryInputDialog extends StandardDialog {
122 128
      */
123 129
     private void initComponents() {
124 130
         orderButtons(new JButton(), new JButton());
125
-        entryName = new ValidatingJTextField(entryValidator);
126
-        uri = new ValidatingJTextField(new URIJTextField(), uriValidator);
131
+        entryName = new ValidatingJTextField(iconManager, entryValidator);
132
+        uri = new ValidatingJTextField(iconManager, new URIJTextField(), uriValidator);
127 133
         blurb = new TextLabel(message);
128 134
         validateText();
129 135
     }

+ 8
- 2
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/AddGroupInputDialog.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.addons.ui_swing.dialogs.StandardInputDialog;
29 29
 import com.dmdirc.util.validators.NotEmptyValidator;
30 30
 import com.dmdirc.util.validators.Validator;
31 31
 import com.dmdirc.addons.serverlists.ServerGroup;
32
+import com.dmdirc.ui.IconManager;
32 33
 
33 34
 import java.awt.Window;
34 35
 import java.awt.Dialog.ModalityType;
@@ -72,18 +73,23 @@ public class AddGroupInputDialog extends StandardDialog {
72 73
     private final JTree tree;
73 74
     /** Parent model. */
74 75
     private final ServerListModel serverListModel;
76
+    /** Icon manager. */
77
+    private final IconManager iconManager;
75 78
 
76 79
     /**
77 80
      * Instantiates a new standard input dialog.
78 81
      *
82
+     * @param iconManager Icon manager
79 83
      * @param items Parent tree
80 84
      * @param owner Dialog owner
81 85
      * @param model Server list model
82 86
      */
83
-    public AddGroupInputDialog(final Window owner, final JTree items,
87
+    public AddGroupInputDialog(final IconManager iconManager,
88
+            final Window owner, final JTree items,
84 89
             final ServerListModel model) {
85 90
         super(owner, ModalityType.MODELESS);
86 91
 
92
+        this.iconManager = iconManager;
87 93
         this.tree = items;
88 94
         this.serverListModel = model;
89 95
         this.validator = new NotEmptyValidator();
@@ -131,7 +137,7 @@ public class AddGroupInputDialog extends StandardDialog {
131 137
      */
132 138
     private void initComponents() {
133 139
         orderButtons(new JButton(), new JButton());
134
-        groupName = new ValidatingJTextField(validator);
140
+        groupName = new ValidatingJTextField(iconManager, validator);
135 141
         networkName = new JTextField();
136 142
         blurb = new TextLabel(message);
137 143
         validateText();

+ 17
- 10
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/ServerListDialog.java View File

@@ -25,6 +25,7 @@ package com.dmdirc.addons.ui_swing.dialogs.serverlist;
25 25
 import com.dmdirc.addons.ui_swing.components.LockedLayer;
26 26
 import com.dmdirc.addons.ui_swing.dialogs.StandardDialog;
27 27
 import com.dmdirc.addons.serverlists.ServerGroupItem;
28
+import com.dmdirc.addons.ui_swing.SwingController;
28 29
 import com.dmdirc.ui.core.util.URLHandler;
29 30
 
30 31
 import java.awt.Window;
@@ -80,12 +81,13 @@ public final class ServerListDialog extends StandardDialog implements
80 81
     /**
81 82
      * Creates the dialog if one doesn't exist, and displays it.
82 83
      *
84
+     * @param controller Swing Controller
83 85
      * @param parentWindow Parent window
84 86
      * @param urlHandler The URL Handler to use to handle clicked links
85 87
      */
86
-    public static void showServerListDialog(final Window parentWindow,
87
-            final URLHandler urlHandler) {
88
-        me = getServerListDialog(parentWindow, urlHandler);
88
+    public static void showServerListDialog(final SwingController controller,
89
+            final Window parentWindow, final URLHandler urlHandler) {
90
+        me = getServerListDialog(controller, parentWindow, urlHandler);
89 91
 
90 92
         me.display();
91 93
         me.requestFocusInWindow();
@@ -94,16 +96,19 @@ public final class ServerListDialog extends StandardDialog implements
94 96
     /**
95 97
      * Returns the current instance of the ServerListDialog.
96 98
      *
99
+     * @param controller Swing Controller
97 100
      * @param parentWindow Parent window
98 101
      * @param urlHandler The URL Handler to use to handle clicked links
102
+     *
99 103
      * @return The current ServerListDialog instance
100 104
      */
101 105
     public static ServerListDialog getServerListDialog(
102
-            final Window parentWindow, final URLHandler urlHandler) {
106
+            final SwingController controller, final Window parentWindow,
107
+            final URLHandler urlHandler) {
103 108
         synchronized (ServerListDialog.class) {
104 109
             if (me == null) {
105
-                me = new ServerListDialog(parentWindow, ModalityType.MODELESS,
106
-                        urlHandler);
110
+                me = new ServerListDialog(controller, parentWindow,
111
+                ModalityType.MODELESS, urlHandler);
107 112
             }
108 113
         }
109 114
 
@@ -117,8 +122,9 @@ public final class ServerListDialog extends StandardDialog implements
117 122
      * @param modalityType Desired modality
118 123
      * @param urlHandler The URL Handler to use to handle clicked links
119 124
      */
120
-    private ServerListDialog(final Window window,
121
-            final ModalityType modalityType, final URLHandler urlHandler) {
125
+    private ServerListDialog(final SwingController controller,
126
+            final Window window, final ModalityType modalityType,
127
+            final URLHandler urlHandler) {
122 128
         super(window, modalityType);
123 129
 
124 130
         setTitle("Server List");
@@ -141,7 +147,7 @@ public final class ServerListDialog extends StandardDialog implements
141 147
                 null)));
142 148
         profileLayer = new JXLayer<Profiles>(new Profiles(model), profileLock);
143 149
         performLayer = new JXLayer<Perform>(new Perform(model), performLock);
144
-        settingsLayer = new JXLayer<Settings>(new Settings(model),
150
+        settingsLayer = new JXLayer<Settings>(new Settings(controller, model),
145 151
                 settingsLock);
146 152
         infoLayer = new JXLayer<Info>(new Info(model, urlHandler), infoLock);
147 153
         help = new Help();
@@ -149,7 +155,8 @@ public final class ServerListDialog extends StandardDialog implements
149 155
 
150 156
         setLayout(new MigLayout("fill, wrap 2, wmin 600, wmax 600"));
151 157
 
152
-        add(new Tree(model, this), "grow, spany 4, wmax 150, wmin 150");
158
+        add(new Tree(controller.getIconManager(), model, this),
159
+                "grow, spany 4, wmax 150, wmin 150");
153 160
         add(help, "pos 160 0.5al");
154 161
         add(infoLayer, "growx, pushx");
155 162
         add(settingsLayer, "grow, push, gaptop unrel, gapbottom unrel");

+ 9
- 4
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/Settings.java View File

@@ -26,6 +26,7 @@ import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel;
26 26
 import com.dmdirc.config.IdentityManager;
27 27
 import com.dmdirc.addons.serverlists.ServerGroup;
28 28
 import com.dmdirc.addons.serverlists.ServerGroupItem;
29
+import com.dmdirc.addons.ui_swing.SwingController;
29 30
 import com.dmdirc.config.ConfigManager;
30 31
 import com.dmdirc.config.Identity;
31 32
 import com.dmdirc.config.prefs.PreferencesManager;
@@ -59,14 +60,18 @@ public class Settings extends JPanel implements ServerListListener {
59 60
             new HashMap<ServerGroupItem, SettingsPanel>();
60 61
     /** Platform border. */
61 62
     private final Border border;
63
+    /** Swing controller. */
64
+    private final SwingController controller;
62 65
 
63 66
     /**
64 67
      * Instantiates a new settings panel.
65 68
      *
69
+     * @param controller Swing controller
66 70
      * @param model Backing model
67 71
      */
68
-    public Settings(final ServerListModel model) {
72
+    public Settings(final SwingController controller, final ServerListModel model) {
69 73
         super();
74
+        this.controller = controller;
70 75
         this.model = model;
71 76
         addListeners();
72 77
         border = UIManager.getBorder("TitledBorder.border");
@@ -111,14 +116,14 @@ public class Settings extends JPanel implements ServerListListener {
111 116
     private SettingsPanel getSettingsPanel(final ServerGroupItem item) {
112 117
         if (!panels.containsKey(item)) {
113 118
             if (item instanceof ServerGroup) {
114
-                panels.put(item, new SettingsPanel("", false));
119
+                panels.put(item, new SettingsPanel(controller, "", false));
115 120
                 addSettings(panels.get(item), new ConfigManager("irc", "",
116 121
                     item.getGroup().getNetwork(), item.getName()),
117 122
                     IdentityManager.getServerConfig(item.getName()));
118 123
             } else if (item == null) {
119
-                panels.put(null, new SettingsPanel("", false));
124
+                panels.put(null, new SettingsPanel(controller, "", false));
120 125
             } else {
121
-                panels.put(item, new SettingsPanel("", false));
126
+                panels.put(item, new SettingsPanel(controller, "", false));
122 127
             }
123 128
         }
124 129
         return panels.get(item);

+ 9
- 3
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/Tree.java View File

@@ -25,6 +25,7 @@ package com.dmdirc.addons.ui_swing.dialogs.serverlist;
25 25
 import com.dmdirc.addons.ui_swing.components.TreeScroller;
26 26
 import com.dmdirc.addons.ui_swing.components.renderers.ServerGroupTreeRenderer;
27 27
 import com.dmdirc.addons.serverlists.ServerGroupItem;
28
+import com.dmdirc.ui.IconManager;
28 29
 
29 30
 import java.awt.Rectangle;
30 31
 import java.awt.Window;
@@ -69,16 +70,21 @@ public class Tree extends JPanel implements TreeSelectionListener,
69 70
     private final JButton addItemButton;
70 71
     /** Parent window. */
71 72
     private final Window parentWindow;
73
+    /** Icon manager. */
74
+    private final IconManager iconManager;
72 75
 
73 76
     /**
74 77
      * Instantiates a new tree of server groups.
75 78
      *
79
+     * @param iconManager Icon Manager
76 80
      * @param model Model backing this tree
77 81
      * @param parentWindow Dialog's parent window
78 82
      */
79
-    public Tree(final ServerListModel model, final Window parentWindow) {
83
+    public Tree(final IconManager iconManager, final ServerListModel model,
84
+            final Window parentWindow) {
80 85
         super();
81 86
 
87
+        this.iconManager = iconManager;
82 88
         this.model = model;
83 89
         this.parentWindow = parentWindow;
84 90
         addGroupButton = new JButton("Add group");
@@ -193,9 +199,9 @@ public class Tree extends JPanel implements TreeSelectionListener,
193 199
     @Override
194 200
     public void actionPerformed(final ActionEvent e) {
195 201
         if (e.getSource() == addGroupButton) {
196
-            new AddGroupInputDialog(parentWindow, items, model).display();
202
+            new AddGroupInputDialog(iconManager, parentWindow, items, model).display();
197 203
         } else {
198
-            new AddEntryInputDialog(parentWindow, items, model).display();
204
+            new AddEntryInputDialog(iconManager, parentWindow, items, model).display();
199 205
         }
200 206
     }
201 207
 

+ 14
- 7
src/com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListPanel.java View File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.ui_swing.dialogs.serversetting;
24 24
 
25 25
 import com.dmdirc.Server;
26
+import com.dmdirc.addons.ui_swing.SwingController;
26 27
 import com.dmdirc.addons.ui_swing.UIUtilities;
27 28
 import com.dmdirc.addons.ui_swing.dialogs.StandardInputDialog;
28 29
 import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
@@ -64,6 +65,8 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
64 65
     private final Server server;
65 66
     /** Parent window. */
66 67
     private final Window parentWindow;
68
+    /** Swing controller. */
69
+    private final SwingController controller;
67 70
     /** Add button. */
68 71
     private JButton addButton;
69 72
     /** Remove button. */
@@ -82,12 +85,15 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
82 85
     /**
83 86
      * Creates a new instance of IgnoreList.
84 87
      *
88
+     * @param controller Swing controller
85 89
      * @param server Parent server
86 90
      * @param parentWindow Parent window
87 91
      */
88
-    public IgnoreListPanel(final Server server, final Window parentWindow) {
92
+    public IgnoreListPanel(final SwingController controller,
93
+            final Server server, final Window parentWindow) {
89 94
         super();
90 95
 
96
+        this.controller = controller;
91 97
         this.server = server;
92 98
         this.parentWindow = parentWindow;
93 99
 
@@ -97,7 +103,7 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
97 103
         populateList();
98 104
     }
99 105
 
100
-    /** Initialises teh components. */
106
+    /** Initialises the components. */
101 107
     private void initComponents() {
102 108
         cachedIgnoreList = new IgnoreList(server.getIgnoreList().getRegexList());
103 109
 
@@ -176,17 +182,18 @@ public final class IgnoreListPanel extends JPanel implements ActionListener,
176 182
     @Override
177 183
     public void actionPerformed(final ActionEvent e) {
178 184
         if (e.getSource() == addButton) {
179
-            new StandardInputDialog(parentWindow, ModalityType.MODELESS,
180
-                    "New ignore list entry",
185
+            new StandardInputDialog(controller, parentWindow,
186
+                    ModalityType.MODELESS, "New ignore list entry",
181 187
                     "Please enter the new ignore list entry",
182 188
                     viewToggle.isSelected() ? new ValidatorChain<String>(
183 189
                     new NotEmptyValidator(), new RegexValidator())
184 190
                     : new NotEmptyValidator()) {
185 191
 
186 192
                 /**
187
-                 * A version number for this class. It should be changed whenever the class
188
-                 * structure is changed (or anything else that would prevent serialized
189
-                 * objects being unserialized with the new class).
193
+                 * A version number for this class. It should be changed
194
+                 * whenever the class structure is changed (or anything else
195
+                 * that would prevent serialized objects being unserialized
196
+                 * with the new class).
190 197
                  */
191 198
                 private static final long serialVersionUID = 2;
192 199
 

+ 21
- 11
src/com/dmdirc/addons/ui_swing/dialogs/serversetting/ServerSettingsDialog.java View File

@@ -25,6 +25,7 @@ package com.dmdirc.addons.ui_swing.dialogs.serversetting;
25 25
 import com.dmdirc.addons.ui_swing.components.modes.UserModesPane;
26 26
 import com.dmdirc.Server;
27 27
 import com.dmdirc.ServerState;
28
+import com.dmdirc.addons.ui_swing.SwingController;
28 29
 import com.dmdirc.addons.ui_swing.UIUtilities;
29 30
 import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel;
30 31
 import com.dmdirc.addons.ui_swing.dialogs.StandardDialog;
@@ -57,6 +58,10 @@ public final class ServerSettingsDialog extends StandardDialog implements Action
57 58
     private static volatile ServerSettingsDialog me;
58 59
     /** Parent server. */
59 60
     private final Server server;
61
+    /** Parent window. */
62
+    private final Window parentWindow;
63
+    /** Swing controller. */
64
+    private final SwingController controller;
60 65
     /** User modes panel. */
61 66
     private UserModesPane modesPanel;
62 67
     /** Ignore list panel. */
@@ -67,18 +72,19 @@ public final class ServerSettingsDialog extends StandardDialog implements Action
67 72
     private SettingsPanel settingsPanel;
68 73
     /** The tabbed pane. */
69 74
     private JTabbedPane tabbedPane;
70
-    /** Parent window. */
71
-    private final Window parentWindow;
72 75
 
73 76
     /**
74 77
      * Creates a new instance of ServerSettingsDialog.
75 78
      *
79
+     * @param controller Swing controller
76 80
      * @param server The server object that we're editing settings for
77 81
      * @param parentWindow Parent window
78 82
      */
79
-    private ServerSettingsDialog(final Server server, final Window parentWindow) {
83
+    private ServerSettingsDialog(final SwingController controller,
84
+            final Server server, final Window parentWindow) {
80 85
         super(parentWindow, ModalityType.MODELESS);
81 86
 
87
+        this.controller = controller;
82 88
         this.server = server;
83 89
         this.parentWindow = parentWindow;
84 90
 
@@ -92,12 +98,14 @@ public final class ServerSettingsDialog extends StandardDialog implements Action
92 98
     /**
93 99
      * Creates the dialog if one doesn't exist, and displays it.
94 100
      *
101
+     * @param controller Swing controller
95 102
      * @param server The server object that we're editing settings for
96 103
      * @param parentWindow Parent window
97 104
      */
98
-    public static void showServerSettingsDialog(final Server server,
105
+    public static void showServerSettingsDialog(
106
+            final SwingController controller,final Server server,
99 107
             final Window parentWindow) {
100
-        me = getServerSettingsDialog(server, parentWindow);
108
+        me = getServerSettingsDialog(controller, server, parentWindow);
101 109
 
102 110
         me.display();
103 111
         me.requestFocusInWindow();
@@ -106,16 +114,18 @@ public final class ServerSettingsDialog extends StandardDialog implements Action
106 114
     /**
107 115
      * Returns the current instance of the ServerSettingsDialog.
108 116
      *
117
+     * @param controller Swing controller
109 118
      * @param server The server object that we're editing settings for
110 119
      * @param parentWindow Parent window
111 120
      *
112 121
      * @return The current ServerSettingsDialog instance
113 122
      */
114 123
     public static ServerSettingsDialog getServerSettingsDialog(
124
+            final SwingController controller,
115 125
             final Server server, final Window parentWindow) {
116 126
         synchronized (ServerSettingsDialog.class) {
117 127
             if (me == null) {
118
-                me = new ServerSettingsDialog(server, parentWindow);
128
+                me = new ServerSettingsDialog(controller, server, parentWindow);
119 129
             }
120 130
         }
121 131
 
@@ -139,18 +149,18 @@ public final class ServerSettingsDialog extends StandardDialog implements Action
139 149
 
140 150
         tabbedPane = new JTabbedPane();
141 151
 
142
-        modesPanel = new UserModesPane(server);
152
+        modesPanel = new UserModesPane(controller, server);
143 153
 
144 154
         ignoreList =
145
-                new IgnoreListPanel(server, parentWindow);
155
+                new IgnoreListPanel(controller, server, parentWindow);
146 156
 
147 157
         performPanel =
148 158
                 new PerformTab(server);
149 159
 
150 160
         settingsPanel =
151
-                new SettingsPanel("These settings are specific to this " +
152
-                "network, any settings specified here will overwrite global " +
153
-                "settings");
161
+                new SettingsPanel(controller, "These settings are specific to "
162
+                        + "this network, any settings specified here will "
163
+                        + "overwrite global settings");
154 164
 
155 165
         if (settingsPanel != null) {
156 166
             addSettings();

+ 1
- 1
src/com/dmdirc/addons/ui_swing/framemanager/ctrltab/CtrlTabWindowManager.java View File

@@ -77,7 +77,7 @@ public class CtrlTabWindowManager implements SwingWindowListener,
77 77
             final MainFrame mainFrame,
78 78
             final JComponent component) {
79 79
         nodes = new HashMap<Window, TreeViewNode>();
80
-        model = new TreeViewModel(new TreeViewNode(null, null));
80
+        model = new TreeViewModel(controller, new TreeViewNode(null, null));
81 81
         selectionModel = new DefaultTreeSelectionModel();
82 82
         treeScroller = new TreeScroller(model, selectionModel, false) {
83 83
 

+ 1
- 2
src/com/dmdirc/addons/ui_swing/framemanager/tree/NodeLabel.java View File

@@ -27,7 +27,6 @@ import com.dmdirc.addons.ui_swing.SelectionListener;
27 27
 import com.dmdirc.addons.ui_swing.UIUtilities;
28 28
 import com.dmdirc.addons.ui_swing.components.ImageButton;
29 29
 import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
30
-import com.dmdirc.config.IdentityManager;
31 30
 import com.dmdirc.interfaces.FrameInfoListener;
32 31
 import com.dmdirc.interfaces.NotificationListener;
33 32
 import com.dmdirc.ui.Colour;
@@ -93,7 +92,7 @@ public class NodeLabel extends JPanel implements SelectionListener,
93 92
      */
94 93
     private void init() {
95 94
         if (window == null) {
96
-            icon.setIcon(new IconManager(IdentityManager.getGlobalConfig())
95
+            icon.setIcon(new IconManager(window.getConfigManager())
97 96
                     .getIcon("icon"));
98 97
             return;
99 98
         }

+ 9
- 9
src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeFrameManager.java View File

@@ -28,7 +28,6 @@ import com.dmdirc.addons.ui_swing.UIUtilities;
28 28
 import com.dmdirc.addons.ui_swing.components.TreeScroller;
29 29
 import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
30 30
 import com.dmdirc.addons.ui_swing.framemanager.FrameManager;
31
-import com.dmdirc.config.IdentityManager;
32 31
 import com.dmdirc.interfaces.ConfigChangeListener;
33 32
 import com.dmdirc.interfaces.FrameInfoListener;
34 33
 import com.dmdirc.interfaces.NotificationListener;
@@ -133,22 +132,23 @@ public final class TreeFrameManager implements FrameManager,
133 132
 
134 133
             @Override
135 134
             public void run() {
136
-                model = new TreeViewModel(new TreeViewNode(null, null));
135
+                model = new TreeViewModel(controller, new TreeViewNode(null,
136
+                        null));
137 137
                 tree = new Tree(TreeFrameManager.this, model,
138 138
                         TreeFrameManager.this.controller);
139 139
                 tree.setCellRenderer(new TreeViewTreeCellRenderer(
140 140
                         TreeFrameManager.this));
141 141
                 tree.setVisible(true);
142 142
 
143
-                IdentityManager.getGlobalConfig().addChangeListener("treeview",
143
+                controller.getGlobalConfig().addChangeListener("treeview",
144 144
                         TreeFrameManager.this);
145
-                IdentityManager.getGlobalConfig().addChangeListener("ui",
145
+                controller.getGlobalConfig().addChangeListener("ui",
146 146
                         "sortrootwindows", TreeFrameManager.this);
147
-                IdentityManager.getGlobalConfig().addChangeListener("ui",
147
+                controller.getGlobalConfig().addChangeListener("ui",
148 148
                         "sortchildwindows", TreeFrameManager.this);
149
-                IdentityManager.getGlobalConfig().addChangeListener("ui",
149
+                controller.getGlobalConfig().addChangeListener("ui",
150 150
                         "backgroundcolour", TreeFrameManager.this);
151
-                IdentityManager.getGlobalConfig().addChangeListener("ui",
151
+                controller.getGlobalConfig().addChangeListener("ui",
152 152
                         "foregroundcolour", TreeFrameManager.this);
153 153
             }
154 154
         });
@@ -272,11 +272,11 @@ public final class TreeFrameManager implements FrameManager,
272 272
     /** Sets treeview colours. */
273 273
     private void setColours() {
274 274
         tree.setBackground(UIUtilities.convertColour(
275
-                IdentityManager.getGlobalConfig().getOptionColour(
275
+                controller.getGlobalConfig().getOptionColour(
276 276
                 "treeview", "backgroundcolour",
277 277
                 "ui", "backgroundcolour")));
278 278
         tree.setForeground(UIUtilities.convertColour(
279
-                IdentityManager.getGlobalConfig().getOptionColour(
279
+                controller.getGlobalConfig().getOptionColour(
280 280
                 "treeview", "foregroundcolour",
281 281
                 "ui", "foregroundcolour")));
282 282
 

+ 10
- 18
src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeViewModel.java View File

@@ -24,7 +24,7 @@ package com.dmdirc.addons.ui_swing.framemanager.tree;
24 24
 
25 25
 import com.dmdirc.FrameContainerComparator;
26 26
 import com.dmdirc.GlobalWindow;
27
-import com.dmdirc.config.IdentityManager;
27
+import com.dmdirc.addons.ui_swing.SwingController;
28 28
 
29 29
 import javax.swing.tree.DefaultTreeModel;
30 30
 
@@ -41,28 +41,20 @@ public class TreeViewModel extends DefaultTreeModel {
41 41
     private static final long serialVersionUID = 1;
42 42
     /** Frame container comparator. */
43 43
     private final FrameContainerComparator comparator;
44
+    /** Parent UI Controller. */
45
+    private SwingController controller;
44 46
 
45 47
     /**
46 48
      * Creates a tree in which any node can have children.
47 49
      *
50
+     * @param controller Parent UI
48 51
      * @param root a TreeNode object that is the root of the tree.
49 52
      */
50
-    public TreeViewModel(final TreeViewNode root) {
51
-        this(root, false);
52
-    }
53
-
54
-    /**
55
-     * Creates a tree specifying whether any node can have children,
56
-     * or whether only certain nodes can have children.
57
-     *
58
-     * @param asksAllowsChildren true = ask whether child can have chilren,
59
-     * false all nodes can have chilren.
60
-     * @param root a root TreeNode.
61
-     */
62
-    public TreeViewModel(final TreeViewNode root,
63
-            final boolean asksAllowsChildren) {
64
-        super(root, asksAllowsChildren);
53
+    public TreeViewModel(final SwingController controller,
54
+            final TreeViewNode root) {
55
+        super(root, false);
65 56
 
57
+        this.controller = controller;
66 58
         comparator = new FrameContainerComparator();
67 59
     }
68 60
 
@@ -105,12 +97,12 @@ public class TreeViewModel extends DefaultTreeModel {
105 97
             return 0;
106 98
         }
107 99
 
108
-        if (parent.equals(root) && !IdentityManager.getGlobalConfig().
100
+        if (parent.equals(root) && !controller.getGlobalConfig().
109 101
                 getOptionBool("ui", "sortrootwindows")) {
110 102
             return parent.getChildCount();
111 103
         }
112 104
 
113
-        if (IdentityManager.getGlobalConfig().getOptionBool("ui",
105
+        if (controller.getGlobalConfig().getOptionBool("ui",
114 106
                 "sortchildwindows")) {
115 107
             for (int i = 0; i < parent.getChildCount(); i++) {
116 108
                 final TreeViewNode child = (TreeViewNode) parent.getChildAt(i);

+ 5
- 6
src/com/dmdirc/addons/ui_swing/wizard/firstrun/SwingFirstRunWizard.java View File

@@ -32,7 +32,6 @@ import com.dmdirc.addons.ui_swing.dialogs.profiles.ProfileManagerDialog;
32 32
 import com.dmdirc.addons.ui_swing.wizard.Step;
33 33
 import com.dmdirc.addons.ui_swing.wizard.WizardDialog;
34 34
 import com.dmdirc.addons.ui_swing.wizard.WizardListener;
35
-import com.dmdirc.config.IdentityManager;
36 35
 import com.dmdirc.interfaces.ActionListener;
37 36
 import com.dmdirc.logger.ErrorLevel;
38 37
 import com.dmdirc.logger.Logger;
@@ -71,8 +70,8 @@ public final class SwingFirstRunWizard implements WizardListener,
71 70
         wizardDialog = new WizardDialog("Setup wizard",
72 71
                 new ArrayList<Step>(), parentWindow,
73 72
                 ModalityType.APPLICATION_MODAL);
74
-        wizardDialog.setIconImage(new IconManager(IdentityManager
75
-                .getGlobalConfig()).getImage("icon"));
73
+        wizardDialog.setIconImage(new IconManager(controller.getGlobalConfig())
74
+                .getImage("icon"));
76 75
         wizardDialog.addWizardListener(this);
77 76
         if(Apple.isAppleUI()) {
78 77
             wizardDialog.setMinimumSize(new Dimension(400, 425));
@@ -94,9 +93,9 @@ public final class SwingFirstRunWizard implements WizardListener,
94 93
             extractActions();
95 94
         }
96 95
 
97
-        IdentityManager.getConfigIdentity().setOption("updater", "enable",
96
+        controller.getGlobalIdentity().setOption("updater", "enable",
98 97
                 ((CommunicationStep) wizardDialog.getStep(1)).checkUpdates());
99
-        IdentityManager.getConfigIdentity().setOption("general", "submitErrors",
98
+        controller.getGlobalIdentity().setOption("general", "submitErrors",
100 99
                 ((CommunicationStep) wizardDialog.getStep(1)).checkErrors());
101 100
 
102 101
         if (((ProfileStep) wizardDialog.getStep(2)).getProfileManagerState()) {
@@ -105,7 +104,7 @@ public final class SwingFirstRunWizard implements WizardListener,
105 104
                 @Override
106 105
                 public void processEvent(final ActionType type,
107 106
                         final StringBuffer format, final Object... arguments) {
108
-                    ProfileManagerDialog.showProfileManagerDialog(controller.getMainFrame());
107
+                    ProfileManagerDialog.showProfileManagerDialog(controller);
109 108
                 }
110 109
             }, CoreActionType.CLIENT_OPENED);
111 110
 

+ 8
- 4
src/com/dmdirc/addons/windowflashing/WindowFlashing.java View File

@@ -128,17 +128,21 @@ public class WindowFlashing extends BasePlugin implements ConfigChangeListener {
128 128
                 PreferencesType.OPTIONALINTEGER, getDomain(), "blinkrate",
129 129
                 "Blink rate", "Specifies the rate at which the taskbar and or "
130 130
                 + "caption will blink, if unspecified this will be your cursor "
131
-                + "blink rate."));
131
+                + "blink rate.",
132
+                manager.getConfigManager(), manager.getIdentity()));
132 133
         category.addSetting(new PreferencesSetting(
133 134
                 PreferencesType.OPTIONALINTEGER, getDomain(), "flashcount",
134 135
                 "Flash count", "Specifies the number of times to blink, if "
135
-                + "unspecified this will blink indefinitely"));
136
+                + "unspecified this will blink indefinitely",
137
+                manager.getConfigManager(), manager.getIdentity()));
136 138
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
137 139
                 getDomain(), "flashtaskbar", "Flash taskbar",
138
-                "Should the taskbar entry flash?"));
140
+                "Should the taskbar entry flash?",
141
+                manager.getConfigManager(), manager.getIdentity()));
139 142
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
140 143
                 getDomain(), "flashcaption", "Flash caption",
141
-                "Should the window caption flash?"));
144
+                "Should the window caption flash?",
145
+                manager.getConfigManager(), manager.getIdentity()));
142 146
 
143 147
         manager.addCategory(category);
144 148
     }

+ 6
- 3
src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java View File

@@ -223,13 +223,16 @@ public final class WindowStatusPlugin extends BasePlugin
223 223
 
224 224
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
225 225
                 getDomain(), "channel.shownone", "Show 'none' count",
226
-                "Should the count for users with no state be shown?"));
226
+                "Should the count for users with no state be shown?",
227
+                manager.getConfigManager(), manager.getIdentity()));
227 228
         category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
228 229
                 getDomain(), "channel.noneprefix", "'None' count prefix",
229
-                "The Prefix to use when showing the 'none' count"));
230
+                "The Prefix to use when showing the 'none' count",
231
+                manager.getConfigManager(), manager.getIdentity()));
230 232
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
231 233
                 getDomain(), "client.showname", "Show real name",
232
-                "Should the realname for clients be shown if known?"));
234
+                "Should the realname for clients be shown if known?",
235
+                manager.getConfigManager(), manager.getIdentity()));
233 236
 
234 237
         manager.getCategory("Plugins").addSubCategory(category);
235 238
     }

+ 1
- 1
test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanelTest.java View File

@@ -90,7 +90,7 @@ public class ActionsGroupPanelTest extends UISpecTestCase {
90 90
             action1, action2, action3, action4,
91 91
         })));
92 92
 
93
-        panel = new Panel(new ActionsGroupPanel(null, group));
93
+        panel = new Panel(new ActionsGroupPanel(null, null, group));
94 94
         table = panel.getTable();
95 95
     }
96 96
 

Loading…
Cancel
Save