Просмотр исходного кода

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 лет назад
Родитель
Сommit
14540d9688
69 измененных файлов: 858 добавлений и 483 удалений
  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 Просмотреть файл

745
 
745
 
746
         firewall.addSetting(new PreferencesSetting(PreferencesType.TEXT,
746
         firewall.addSetting(new PreferencesSetting(PreferencesType.TEXT,
747
                 getDomain(), "firewall.ip", "Forced IP",
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
         firewall.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
750
         firewall.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
750
                 getDomain(), "firewall.ports.usePortRange", "Use Port Range",
751
                 getDomain(), "firewall.ports.usePortRange", "Use Port Range",
751
                 "Useful if you have a firewall that only forwards specific "
752
                 "Useful if you have a firewall that only forwards specific "
752
-                + "ports"));
753
+                + "ports", manager.getConfigManager(), manager.getIdentity()));
753
         firewall.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
754
         firewall.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
754
                 getDomain(), "firewall.ports.startPort", "Start Port",
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
         firewall.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
758
         firewall.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
757
                 getDomain(), "firewall.ports.endPort", "End Port",
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
         receiving.addSetting(new PreferencesSetting(PreferencesType.DIRECTORY,
762
         receiving.addSetting(new PreferencesSetting(PreferencesType.DIRECTORY,
760
                 getDomain(), "receive.savelocation", "Default save location",
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
         sending.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
766
         sending.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
763
                 getDomain(), "send.reverse", "Reverse DCC",
767
                 getDomain(), "send.reverse", "Reverse DCC",
764
                 "With reverse DCC, the sender connects rather than "
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
         sending.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
771
         sending.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
767
                 getDomain(), "send.forceturbo", "Use Turbo DCC",
772
                 getDomain(), "send.forceturbo", "Use Turbo DCC",
768
                 "Turbo DCC doesn't wait for ack packets. this is "
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
         receiving.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
776
         receiving.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
771
                 getDomain(), "receive.reverse.sendtoken",
777
                 getDomain(), "receive.reverse.sendtoken",
772
                 "Send token in reverse receive",
778
                 "Send token in reverse receive",
773
                 "If you have problems with reverse dcc receive resume,"
779
                 "If you have problems with reverse dcc receive resume,"
774
-                + " try toggling this."));
780
+                + " try toggling this.", manager.getConfigManager(),
781
+                manager.getIdentity()));
775
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
782
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
776
                 getDomain(), "send.blocksize", "Blocksize to use for DCC",
783
                 getDomain(), "send.blocksize", "Blocksize to use for DCC",
777
                 "Change the block size for send/receive, this can "
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
787
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
780
                 getDomain(), "general.percentageInTitle",
788
                 getDomain(), "general.percentageInTitle",
781
                 "Show percentage of transfers in the window title",
789
                 "Show percentage of transfers in the window title",
782
                 "Show the current percentage of transfers in the DCC window "
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 Просмотреть файл

195
 
195
 
196
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
196
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
197
                 getDomain(), "general.timeout", "Timeout",
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
         general.addSetting(new PreferencesSetting(PreferencesType.FILE,
200
         general.addSetting(new PreferencesSetting(PreferencesType.FILE,
200
                 getDomain(), "general.icon", "icon",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
204
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
203
                 getDomain(), "advanced.escapehtml", "Escape HTML",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
208
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
206
                 getDomain(), "advanced.strictescape", "Strict Escape HTML",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
212
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
209
                 getDomain(), "advanced.stripcodes", "Strip Control Codes",
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
         manager.getCategory("Plugins").addSubCategory(general);
217
         manager.getCategory("Plugins").addSubCategory(general);
213
     }
218
     }

+ 20
- 10
src/com/dmdirc/addons/identd/IdentdPlugin.java Просмотреть файл

144
                 getDomain(), "general.useUsername", "Use connection " +
144
                 getDomain(), "general.useUsername", "Use connection " +
145
                 "username rather than system username", "If this is enabled," +
145
                 "username rather than system username", "If this is enabled," +
146
                 " the username for the connection will be used rather than " +
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
149
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
149
                 getDomain(), "general.useNickname", "Use connection " +
150
                 getDomain(), "general.useNickname", "Use connection " +
150
                 "nickname rather than system username", "If this is enabled, " +
151
                 "nickname rather than system username", "If this is enabled, " +
151
                 "the nickname for the connection will be used rather than " +
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
155
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
154
                 getDomain(), "general.useCustomName", "Use custom name" +
156
                 getDomain(), "general.useCustomName", "Use custom name" +
155
                 " all the time", "If this is enabled, the name specified below" +
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
         general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
160
         general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
158
                 getDomain(), "general.customName", "Custom Name to use",
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
165
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
162
                 getDomain(), "advanced.alwaysOn", "Always have ident " +
166
                 getDomain(), "advanced.alwaysOn", "Always have ident " +
163
                 "port open", "By default the identd only runs when there are " +
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
170
         advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
166
                 new PortValidator(), getDomain(), "advanced.port",
171
                 new PortValidator(), getDomain(), "advanced.port",
167
                 "What port should the identd listen on", "Default port is 113," +
172
                 "What port should the identd listen on", "Default port is 113," +
168
                 " this is probably useless if changed unless you port forward" +
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
176
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
171
                 getDomain(), "advanced.useCustomSystem", "Use custom OS",
177
                 getDomain(), "advanced.useCustomSystem", "Use custom OS",
172
                 "By default the plugin uses 'UNIX' or 'WIN32' as the system " +
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT,
181
         advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT,
175
                 getDomain(), "advanced.customSystem", "Custom OS to use",
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
185
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
178
                 getDomain(), "advanced.isHiddenUser", "Respond to ident" +
186
                 getDomain(), "advanced.isHiddenUser", "Respond to ident" +
179
                 " requests with HIDDEN-USER error", "By default the plugin will" +
187
                 " requests with HIDDEN-USER error", "By default the plugin will" +
180
                 " give a USERID response, this can force an 'ERROR :" +
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
191
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
183
                 getDomain(), "advanced.isNoUser", "Respond to ident" +
192
                 getDomain(), "advanced.isNoUser", "Respond to ident" +
184
                 " requests with NO-USER error", "By default the plugin will" +
193
                 " requests with NO-USER error", "By default the plugin will" +
185
                 " give a USERID response, this can force an 'ERROR : NO-USER'" +
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
         manager.getCategory("Plugins").addSubCategory(general);
198
         manager.getCategory("Plugins").addSubCategory(general);
189
         general.addSubCategory(advanced);
199
         general.addSubCategory(advanced);

+ 8
- 4
src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java Просмотреть файл

275
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
275
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
276
                 getDomain(), "usealternate",
276
                 getDomain(), "usealternate",
277
                 "Alternate method", "Use an alternate method of determining "
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
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
280
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
280
                 getDomain(), "graph", "Show graph", "Show a graph of ping times " +
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
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
284
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
283
                 getDomain(), "labels", "Show labels", "Show labels on selected " +
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
         cat.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
288
         cat.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
286
                 getDomain(), "history", "Graph points", "Number of data points " +
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
         manager.getCategory("Plugins").addSubCategory(cat);
292
         manager.getCategory("Plugins").addSubCategory(cat);
289
     }
293
     }
290
 
294
 

+ 60
- 16
src/com/dmdirc/addons/logging/LoggingPlugin.java Просмотреть файл

229
         final PreferencesCategory advanced = new PluginPreferencesCategory(
229
         final PreferencesCategory advanced = new PluginPreferencesCategory(
230
                 pluginInfo, "Advanced", "Advanced configuration for Logging plugin. You shouldn't need to edit this unless you know what you are doing.");
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
         general.addSubCategory(backbuffer.setInline());
293
         general.addSubCategory(backbuffer.setInline());
250
         general.addSubCategory(advanced.setInline());
294
         general.addSubCategory(advanced.setInline());

+ 3
- 2
src/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePlugin.java Просмотреть файл

211
 
211
 
212
         final PreferencesSetting setting = new PreferencesSetting(
212
         final PreferencesSetting setting = new PreferencesSetting(
213
                 PreferencesType.LABEL, getDomain(), "", "Instructions",
213
                 PreferencesType.LABEL, getDomain(), "", "Instructions",
214
-                "Instructions");
214
+                "Instructions", manager.getConfigManager(), manager.getIdentity());
215
         setting.setValue("<html><p>"
215
         setting.setValue("<html><p>"
216
                 + "The VLC media source requires that VLC's web interface is"
216
                 + "The VLC media source requires that VLC's web interface is"
217
                 + " enabled. To do this, follow the steps below:</p>"
217
                 + " enabled. To do this, follow the steps below:</p>"
237
         general.addSetting(setting);
237
         general.addSetting(setting);
238
         general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
238
         general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
239
                 getDomain(), "host", "Hostname and port",
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
         manager.getCategory("Plugins").addSubCategory(general);
243
         manager.getCategory("Plugins").addSubCategory(general);
243
     }
244
     }

+ 13
- 7
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java Просмотреть файл

277
 
277
 
278
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
278
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
279
                 "ui", "shownickcoloursintext", "Show colours in text area",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
282
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
282
                 "ui", "shownickcoloursinnicklist", "Show colours in"
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
286
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
285
                 getDomain(), "settext", "Set colours in textarea",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
290
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
288
                 getDomain(), "setnicklist", "Set colours in nick list",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
294
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
291
                 getDomain(), "userandomcolour", "Use random colour",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
298
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
294
                 getDomain(), "useowncolour", "Use colour for own nick",
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
         general.addSetting(
302
         general.addSetting(
297
                 new PreferencesSetting(PreferencesType.COLOUR, getDomain(),
303
                 new PreferencesSetting(PreferencesType.COLOUR, getDomain(),
298
                 "owncolour", "Colour to use for own nick",
304
                 "owncolour", "Colour to use for own nick",
299
                 "Colour used for our own nickname, if above setting is "
305
                 "Colour used for our own nickname, if above setting is "
300
-                + "enabled."));
306
+                + "enabled.", manager.getConfigManager(), manager.getIdentity()));
301
 
307
 
302
         general.addSubCategory(colours);
308
         general.addSubCategory(colours);
303
         manager.getCategory("Plugins").addSubCategory(general);
309
         manager.getCategory("Plugins").addSubCategory(general);

+ 16
- 9
src/com/dmdirc/addons/osd/OsdPlugin.java Просмотреть файл

83
 
83
 
84
         fontSizeSetting = new PreferencesSetting(PreferencesType.INTEGER,
84
         fontSizeSetting = new PreferencesSetting(PreferencesType.INTEGER,
85
                 getDomain(), "fontSize", "Font size", "Changes the font " +
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
         backgroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
88
         backgroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
88
                 getDomain(), "bgcolour", "Background colour",
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
         foregroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
92
         foregroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
91
                 getDomain(), "fgcolour", "Foreground colour",
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
         widthSetting = new PreferencesSetting(PreferencesType.INTEGER,
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
         timeoutSetting = new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
100
         timeoutSetting = new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
97
                 new OptionalValidator(new NumericalValidator(1, Integer.MAX_VALUE)),
101
                 new OptionalValidator(new NumericalValidator(1, Integer.MAX_VALUE)),
98
                 getDomain(), "timeout", "Timeout", "Length of time in " +
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
         maxWindowsSetting = new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
105
         maxWindowsSetting = new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
101
                 new OptionalValidator(new NumericalValidator(1, Integer.MAX_VALUE)),
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
         category.addSetting(fontSizeSetting);
111
         category.addSetting(fontSizeSetting);
106
         category.addSetting(backgroundSetting);
112
         category.addSetting(backgroundSetting);
118
 
124
 
119
         category.addSetting(new PreferencesSetting(getDomain(), "newbehaviour",
125
         category.addSetting(new PreferencesSetting(getDomain(), "newbehaviour",
120
                 "New window policy", "What to do when an OSD Window "
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
         category.addChangeListener(this);
130
         category.addChangeListener(this);
124
         manager.getCategory("Plugins").addSubCategory(category);
131
         manager.getCategory("Plugins").addSubCategory(category);

+ 42
- 13
src/com/dmdirc/addons/parser_twitter/TwitterPlugin.java Просмотреть файл

98
     /** {@inheritDoc} */
98
     /** {@inheritDoc} */
99
     @Override
99
     @Override
100
     public void showConfig(final PreferencesDialogModel manager) {
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
         category.addSubCategory(advanced);
144
         category.addSubCategory(advanced);
116
 
145
 

+ 4
- 2
src/com/dmdirc/addons/relaybot/RelayBotPlugin.java Просмотреть файл

296
         colours.setInline().setInlineAfter();
296
         colours.setInline().setInlineAfter();
297
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
297
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
298
                 getDomain(), "joinOnDiscover", "Join on discover",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
301
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
301
                 getDomain(), "colourFullName", "Colour full name",
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
         manager.getCategory("Plugins").addSubCategory(general);
305
         manager.getCategory("Plugins").addSubCategory(general);
304
         general.addSubCategory(colours);
306
         general.addSubCategory(colours);
305
     }
307
     }

+ 2
- 1
src/com/dmdirc/addons/systray/SystrayPlugin.java Просмотреть файл

190
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
190
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
191
                 getDomain(), "autominimise", "Auto-hide DMDirc when minimised",
191
                 getDomain(), "autominimise", "Auto-hide DMDirc when minimised",
192
                 "If this option is enabled, the systray plugin will hide DMDirc"
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
         manager.getCategory("Plugins").addSubCategory(category);
196
         manager.getCategory("Plugins").addSubCategory(category);
196
     }
197
     }

+ 22
- 15
src/com/dmdirc/addons/ui_swing/PrefsComponentFactory.java Просмотреть файл

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

+ 72
- 33
src/com/dmdirc/addons/ui_swing/SwingController.java Просмотреть файл

56
 import com.dmdirc.interfaces.ui.InputWindow;
56
 import com.dmdirc.interfaces.ui.InputWindow;
57
 import com.dmdirc.interfaces.ui.UIController;
57
 import com.dmdirc.interfaces.ui.UIController;
58
 import com.dmdirc.interfaces.ui.Window;
58
 import com.dmdirc.interfaces.ui.Window;
59
+import com.dmdirc.ui.IconManager;
59
 import com.dmdirc.updater.Version;
60
 import com.dmdirc.updater.Version;
60
 import com.dmdirc.util.ReturnableThread;
61
 import com.dmdirc.util.ReturnableThread;
61
 import com.dmdirc.util.validators.NumericalValidator;
62
 import com.dmdirc.util.validators.NumericalValidator;
80
 import javax.swing.UIManager.LookAndFeelInfo;
81
 import javax.swing.UIManager.LookAndFeelInfo;
81
 
82
 
82
 import lombok.Getter;
83
 import lombok.Getter;
84
+
83
 import net.miginfocom.layout.PlatformDefaults;
85
 import net.miginfocom.layout.PlatformDefaults;
84
 
86
 
85
 /**
87
 /**
129
     /** Addon config identity. */
131
     /** Addon config identity. */
130
     @Getter
132
     @Getter
131
     private final Identity addonIdentity;
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
      * Instantiates a new SwingController.
142
      * Instantiates a new SwingController.
144
                 .getGlobalConfigIdentity();
152
                 .getGlobalConfigIdentity();
145
         addonIdentity = IdentityManager.getIdentityManager()
153
         addonIdentity = IdentityManager.getIdentityManager()
146
                 .getGlobalAddonIdentity();
154
                 .getGlobalAddonIdentity();
155
+        iconManager = new IconManager(globalConfig);
156
+        prefsComponentFactory = new PrefsComponentFactory(this);
147
         setAntiAlias();
157
         setAntiAlias();
148
         windows = new ArrayList<java.awt.Window>();
158
         windows = new ArrayList<java.awt.Window>();
149
         registerCommand(new ServerSettings(), ServerSettings.INFO);
159
         registerCommand(new ServerSettings(), ServerSettings.INFO);
214
             /** {@inheritDoc} */
224
             /** {@inheritDoc} */
215
             @Override
225
             @Override
216
             public void run() {
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
             @Override
240
             @Override
231
             public void run() {
241
             public void run() {
232
                 ServerSettingsDialog.showServerSettingsDialog(
242
                 ServerSettingsDialog.showServerSettingsDialog(
233
-                        server, getMainFrame());
243
+                        SwingController.this, server, getMainFrame());
234
             }
244
             }
235
         });
245
         });
236
     }
246
     }
523
         }
533
         }
524
 
534
 
525
         general.addSetting(new PreferencesSetting("ui", "lookandfeel",
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
         general.addSetting(new PreferencesSetting("ui", "framemanager",
538
         general.addSetting(new PreferencesSetting("ui", "framemanager",
528
                 "Window manager", "Which window manager should be used?",
539
                 "Window manager", "Which window manager should be used?",
529
-                framemanagers));
540
+                framemanagers,
541
+                globalConfig, globalIdentity));
530
         general.addSetting(new PreferencesSetting("ui", "framemanagerPosition",
542
         general.addSetting(new PreferencesSetting("ui", "framemanagerPosition",
531
                 "Window manager position", "Where should the window "
543
                 "Window manager position", "Where should the window "
532
-                + "manager be positioned?", fmpositions));
544
+                + "manager be positioned?", fmpositions,
545
+                globalConfig, globalIdentity));
533
         general.addSetting(new PreferencesSetting(PreferencesType.FONT,
546
         general.addSetting(new PreferencesSetting(PreferencesType.FONT,
534
                 "ui", "textPaneFontName", "Textpane font",
547
                 "ui", "textPaneFontName", "Textpane font",
535
-                "Font for the textpane"));
548
+                "Font for the textpane",
549
+                globalConfig, globalIdentity));
536
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
550
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
537
                 "ui", "textPaneFontSize", "Textpane font size",
551
                 "ui", "textPaneFontSize", "Textpane font size",
538
-                "Font size for the textpane"));
552
+                "Font size for the textpane",
553
+                globalConfig, globalIdentity));
539
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
554
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
540
                 "ui", "sortrootwindows", "Sort root windows",
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
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
558
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
543
                 "ui", "sortchildwindows", "Sort child windows",
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
         general.addSubCategory(createNicklistCategory());
563
         general.addSubCategory(createNicklistCategory());
547
         general.addSubCategory(createTreeViewCategory());
564
         general.addSubCategory(createTreeViewCategory());
563
                 PreferencesType.OPTIONALINTEGER,
580
                 PreferencesType.OPTIONALINTEGER,
564
                 new NumericalValidator(10, -1), "ui", "frameBufferSize",
581
                 new NumericalValidator(10, -1), "ui", "frameBufferSize",
565
                 "Window buffer size", "The maximum number of lines in a window"
582
                 "Window buffer size", "The maximum number of lines in a window"
566
-                + " buffer"));
583
+                + " buffer",
584
+                globalConfig, globalIdentity));
567
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
585
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
568
                 getDomain(), "mdiBarVisibility", "MDI Bar Visibility",
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
         advanced.addSetting(
589
         advanced.addSetting(
571
                 new PreferencesSetting(PreferencesType.BOOLEAN, "ui",
590
                 new PreferencesSetting(PreferencesType.BOOLEAN, "ui",
572
                 "useOneTouchExpandable", "Use one touch expandable split "
591
                 "useOneTouchExpandable", "Use one touch expandable split "
573
                 + "panes?", "Use one touch expandable arrows for "
592
                 + "panes?", "Use one touch expandable arrows for "
574
-                + "collapsing/expanding the split panes"));
593
+                + "collapsing/expanding the split panes",
594
+                globalConfig, globalIdentity));
575
         advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
595
         advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
576
                 getDomain(), "windowMenuItems", "Window menu item count",
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
         advanced.addSetting(
599
         advanced.addSetting(
579
                 new PreferencesSetting(PreferencesType.INTEGER, getDomain(),
600
                 new PreferencesSetting(PreferencesType.INTEGER, getDomain(),
580
                 "windowMenuScrollInterval", "Window menu scroll interval",
601
                 "windowMenuScrollInterval", "Window menu scroll interval",
581
                 "Number of milliseconds to pause when autoscrolling in the "
602
                 "Number of milliseconds to pause when autoscrolling in the "
582
-                + "window menu"));
603
+                + "window menu",
604
+                globalConfig, globalIdentity));
583
         advanced.addSetting(
605
         advanced.addSetting(
584
                 new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(),
606
                 new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(),
585
                 "showtopicbar", "Show topic bar",
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
610
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
588
                 getDomain(),
611
                 getDomain(),
589
                 "shownicklist", "Show nicklist?",
612
                 "shownicklist", "Show nicklist?",
590
-                "Do you want the nicklist visible"));
613
+                "Do you want the nicklist visible",
614
+                globalConfig, globalIdentity));
591
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
615
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
592
                 getDomain(), "showfulltopic", "Show full topic in topic bar?",
616
                 getDomain(), "showfulltopic", "Show full topic in topic bar?",
593
                "Do you want to show the full topic in the topic bar or just"
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
620
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
596
                 getDomain(), "hideEmptyTopicBar", "Hide empty topic bar?",
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
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
624
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
599
                 getDomain(), "textpanelinenotification",
625
                 getDomain(), "textpanelinenotification",
600
                 "New line notification", "Do you want to be notified about new "
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
         return advanced;
630
         return advanced;
604
     }
631
     }
615
         treeview.addSetting(new PreferencesSetting(
642
         treeview.addSetting(new PreferencesSetting(
616
                 PreferencesType.OPTIONALCOLOUR,
643
                 PreferencesType.OPTIONALCOLOUR,
617
                 "treeview", "backgroundcolour", "Treeview background colour",
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
         treeview.addSetting(new PreferencesSetting(
647
         treeview.addSetting(new PreferencesSetting(
620
                 PreferencesType.OPTIONALCOLOUR,
648
                 PreferencesType.OPTIONALCOLOUR,
621
                 "treeview", "foregroundcolour", "Treeview foreground colour",
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
         treeview.addSetting(new PreferencesSetting(
652
         treeview.addSetting(new PreferencesSetting(
624
                 PreferencesType.OPTIONALCOLOUR,
653
                 PreferencesType.OPTIONALCOLOUR,
625
                 "ui", "treeviewRolloverColour", "Treeview rollover colour",
654
                 "ui", "treeviewRolloverColour", "Treeview rollover colour",
626
                 "Background colour to use when the mouse cursor is over a "
655
                 "Background colour to use when the mouse cursor is over a "
627
-                + "node"));
656
+                + "node",
657
+                globalConfig, globalIdentity));
628
         treeview.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
658
         treeview.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
629
                 "ui", "treeviewActiveBold", "Active node bold",
659
                 "ui", "treeviewActiveBold", "Active node bold",
630
-                "Make the active node bold?"));
660
+                "Make the active node bold?",
661
+                globalConfig, globalIdentity));
631
         treeview.addSetting(new PreferencesSetting(
662
         treeview.addSetting(new PreferencesSetting(
632
                 PreferencesType.OPTIONALCOLOUR,
663
                 PreferencesType.OPTIONALCOLOUR,
633
                 "ui", "treeviewActiveBackground", "Active node background",
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
         treeview.addSetting(new PreferencesSetting(
667
         treeview.addSetting(new PreferencesSetting(
636
                 PreferencesType.OPTIONALCOLOUR,
668
                 PreferencesType.OPTIONALCOLOUR,
637
                 "ui", "treeviewActiveForeground", "Active node foreground",
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
         treeview.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
672
         treeview.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
640
                 getDomain(), "showtreeexpands", "Show expand/collapse handles",
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
         return treeview;
677
         return treeview;
644
     }
678
     }
655
         nicklist.addSetting(new PreferencesSetting(
689
         nicklist.addSetting(new PreferencesSetting(
656
                 PreferencesType.OPTIONALCOLOUR,
690
                 PreferencesType.OPTIONALCOLOUR,
657
                 "ui", "nicklistbackgroundcolour", "Nicklist background colour",
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
         nicklist.addSetting(new PreferencesSetting(
694
         nicklist.addSetting(new PreferencesSetting(
660
                 PreferencesType.OPTIONALCOLOUR,
695
                 PreferencesType.OPTIONALCOLOUR,
661
                 "ui", "nicklistforegroundcolour", "Nicklist foreground colour",
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
         nicklist.addSetting(new PreferencesSetting(
699
         nicklist.addSetting(new PreferencesSetting(
664
                 PreferencesType.OPTIONALCOLOUR,
700
                 PreferencesType.OPTIONALCOLOUR,
665
                 "ui", "nickListAltBackgroundColour",
701
                 "ui", "nickListAltBackgroundColour",
666
                 "Alternate background colour",
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
         nicklist.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
705
         nicklist.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
669
                 "nicklist", "sortByMode", "Sort nicklist by user mode",
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
         nicklist.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
709
         nicklist.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
672
                 "nicklist", "sortByCase", "Sort nicklist by case",
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
         return nicklist;
714
         return nicklist;
676
     }
715
     }

+ 6
- 4
src/com/dmdirc/addons/ui_swing/components/FileBrowser.java Просмотреть файл

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

+ 2
- 1
src/com/dmdirc/addons/ui_swing/components/SwingSearchBar.java Просмотреть файл

118
         prevButton = new JButton();
118
         prevButton = new JButton();
119
         caseCheck = new JCheckBox();
119
         caseCheck = new JCheckBox();
120
         validator = new SearchValidator();
120
         validator = new SearchValidator();
121
-        searchBox = new ValidatingJTextField(validator);
121
+        searchBox = new ValidatingJTextField(parent.getController()
122
+                .getIconManager(), validator);
122
         wrapIndicator = new JLabel("Search wrapped",
123
         wrapIndicator = new JLabel("Search wrapped",
123
                 parent.getContainer().getIconManager().getIcon("linewrap"),
124
                 parent.getContainer().getIconManager().getIcon("linewrap"),
124
                 JLabel.LEFT);
125
                 JLabel.LEFT);

+ 14
- 6
src/com/dmdirc/addons/ui_swing/components/expandingsettings/SettingsPanel.java Просмотреть файл

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

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java Просмотреть файл

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

+ 8
- 4
src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java Просмотреть файл

56
      * objects being unserialized with the new class).
56
      * objects being unserialized with the new class).
57
      */
57
      */
58
     private static final long serialVersionUID = 9;
58
     private static final long serialVersionUID = 9;
59
+    /** Swing controller. */
60
+    private final SwingController controller;
59
     /** popup menu item. */
61
     /** popup menu item. */
60
     private JMenuItem settingsMI;
62
     private JMenuItem settingsMI;
61
     /** The SSL certificate dialog we're displaying for this server, if any. */
63
     /** The SSL certificate dialog we're displaying for this server, if any. */
70
     public ServerFrame(final SwingController controller, final Server owner) {
72
     public ServerFrame(final SwingController controller, final Server owner) {
71
         super(controller, owner);
73
         super(controller, owner);
72
 
74
 
75
+        this.controller = controller;
73
         initComponents();
76
         initComponents();
74
 
77
 
75
         owner.addCertificateProblemListener(this);
78
         owner.addCertificateProblemListener(this);
96
     @Override
99
     @Override
97
     public void actionPerformed(final ActionEvent actionEvent) {
100
     public void actionPerformed(final ActionEvent actionEvent) {
98
         if (actionEvent.getSource() == settingsMI) {
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
     @Override
166
     @Override
164
     public void windowClosing(final FrameContainer window) {
167
     public void windowClosing(final FrameContainer window) {
165
         if (ServerSettingsDialog.hasServerSettingsDialog()) {
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
         super.windowClosing(window);
174
         super.windowClosing(window);

+ 14
- 9
src/com/dmdirc/addons/ui_swing/components/inputfields/ValidatingTextFieldInputField.java Просмотреть файл

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/menubar/ChannelMenu.java Просмотреть файл

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

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/menubar/ServerMenu.java Просмотреть файл

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

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/menubar/SettingsMenu.java Просмотреть файл

104
         if ("Preferences".equals(e.getActionCommand())) {
104
         if ("Preferences".equals(e.getActionCommand())) {
105
             SwingPreferencesDialog.showSwingPreferencesDialog(controller);
105
             SwingPreferencesDialog.showSwingPreferencesDialog(controller);
106
         } else if (e.getActionCommand().equals("Profile")) {
106
         } else if (e.getActionCommand().equals("Profile")) {
107
-            ProfileManagerDialog.showProfileManagerDialog(mainFrame);
107
+            ProfileManagerDialog.showProfileManagerDialog(controller);
108
         }  else if (e.getActionCommand().equals("Actions")) {
108
         }  else if (e.getActionCommand().equals("Actions")) {
109
             ActionsManagerDialog.showActionsManagerDialog(mainFrame,
109
             ActionsManagerDialog.showActionsManagerDialog(mainFrame,
110
                     controller);
110
                     controller);
111
         } else if (e.getActionCommand().equals("Aliases")) {
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 Просмотреть файл

23
 package com.dmdirc.addons.ui_swing.components.modes;
23
 package com.dmdirc.addons.ui_swing.components.modes;
24
 
24
 
25
 import com.dmdirc.Channel;
25
 import com.dmdirc.Channel;
26
-import com.dmdirc.config.ConfigManager;
26
+import com.dmdirc.addons.ui_swing.SwingController;
27
 import com.dmdirc.parser.interfaces.Parser;
27
 import com.dmdirc.parser.interfaces.Parser;
28
 
28
 
29
 /** Non list mode panel. */
29
 /** Non list mode panel. */
37
     private static final long serialVersionUID = 1;
37
     private static final long serialVersionUID = 1;
38
     /** Parent channel. */
38
     /** Parent channel. */
39
     private final Channel channel;
39
     private final Channel channel;
40
+    /** Swing controller. */
41
+    private final SwingController controller;
40
 
42
 
41
     /**
43
     /**
42
      * Creates a new instance of ChannelModesPane.
44
      * Creates a new instance of ChannelModesPane.
43
      *
45
      *
46
+     * @param controller Swing controller
44
      * @param channel Parent channel
47
      * @param channel Parent channel
45
      */
48
      */
46
-    public ChannelModesPane(final Channel channel) {
49
+    public ChannelModesPane(final SwingController controller,
50
+            final Channel channel) {
47
         super();
51
         super();
48
 
52
 
53
+        this.controller = controller;
49
         this.channel = channel;
54
         this.channel = channel;
50
         initModesPanel();
55
         initModesPanel();
51
     }
56
     }
120
 
125
 
121
     /** {@inheritDoc} */
126
     /** {@inheritDoc} */
122
     @Override
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 Просмотреть файл

22
 
22
 
23
 package com.dmdirc.addons.ui_swing.components.modes;
23
 package com.dmdirc.addons.ui_swing.components.modes;
24
 
24
 
25
+import com.dmdirc.addons.ui_swing.SwingController;
25
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
27
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
27
-import com.dmdirc.config.ConfigManager;
28
 
28
 
29
 import java.awt.Insets;
29
 import java.awt.Insets;
30
 import java.util.HashMap;
30
 import java.util.HashMap;
111
                     mode.subSequence(0, 1));
111
                     mode.subSequence(0, 1));
112
 
112
 
113
             final ParamModePanel panel = new ParamModePanel(mode, state, value,
113
             final ParamModePanel panel = new ParamModePanel(mode, state, value,
114
-                    getConfigManager());
114
+                    getSwingController());
115
 
115
 
116
             getParamModes().put(mode, panel);
116
             getParamModes().put(mode, panel);
117
         }
117
         }
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
      * Checks whether there is a plain text description for this mode.
245
      * Checks whether there is a plain text description for this mode.

+ 10
- 10
src/com/dmdirc/addons/ui_swing/components/modes/ParamModePanel.java Просмотреть файл

22
 
22
 
23
 package com.dmdirc.addons.ui_swing.components.modes;
23
 package com.dmdirc.addons.ui_swing.components.modes;
24
 
24
 
25
+import com.dmdirc.addons.ui_swing.SwingController;
25
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
27
 import com.dmdirc.addons.ui_swing.components.validating.ValidatingJTextField;
27
-import com.dmdirc.config.ConfigManager;
28
 import com.dmdirc.util.validators.RegexStringValidator;
28
 import com.dmdirc.util.validators.RegexStringValidator;
29
 
29
 
30
 import java.awt.Component;
30
 import java.awt.Component;
62
      * @param thisMode The mode that this panel should deal with
62
      * @param thisMode The mode that this panel should deal with
63
      * @param state The current state of the mode
63
      * @param state The current state of the mode
64
      * @param value The current value of the mode
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
     public ParamModePanel(final String thisMode, final boolean state,
67
     public ParamModePanel(final String thisMode, final boolean state,
68
-            final String value, final ConfigManager configManager) {
68
+            final String value, final SwingController controller) {
69
         super();
69
         super();
70
         this.mode = thisMode;
70
         this.mode = thisMode;
71
         this.originalValue = value;
71
         this.originalValue = value;
72
         String text;
72
         String text;
73
         String tooltip;
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
         } else {
77
         } else {
78
             tooltip = "Mode " + mode + ": Unknown";
78
             tooltip = "Mode " + mode + ": Unknown";
79
         }
79
         }
82
 
82
 
83
         text = "Mode " + mode + ": ";
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
                     + " [+" + mode + "]: ";
87
                     + " [+" + mode + "]: ";
88
         }
88
         }
89
 
89
 
92
         checkBox.setOpaque(UIUtilities.getTabbedPaneOpaque());
92
         checkBox.setOpaque(UIUtilities.getTabbedPaneOpaque());
93
         add(checkBox);
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
         textField.setText(value);
97
         textField.setText(value);
98
         add(textField, "growx, pushx");
98
         add(textField, "growx, pushx");
99
 
99
 

+ 9
- 4
src/com/dmdirc/addons/ui_swing/components/modes/UserModesPane.java Просмотреть файл

23
 package com.dmdirc.addons.ui_swing.components.modes;
23
 package com.dmdirc.addons.ui_swing.components.modes;
24
 
24
 
25
 import com.dmdirc.Server;
25
 import com.dmdirc.Server;
26
-import com.dmdirc.config.ConfigManager;
26
+import com.dmdirc.addons.ui_swing.SwingController;
27
 
27
 
28
 /** User mode panel. */
28
 /** User mode panel. */
29
 public final class UserModesPane extends ModesPane {
29
 public final class UserModesPane extends ModesPane {
36
     private static final long serialVersionUID = 1;
36
     private static final long serialVersionUID = 1;
37
     /** Parent server. */
37
     /** Parent server. */
38
     private final Server server;
38
     private final Server server;
39
+    /** Swing controller. */
40
+    private final SwingController controller;
39
 
41
 
40
     /**
42
     /**
41
      * Creates a new instance of UserModesPane.
43
      * Creates a new instance of UserModesPane.
42
      *
44
      *
45
+     * @param controller Swing controller
43
      * @param server Parent server
46
      * @param server Parent server
44
      */
47
      */
45
-    public UserModesPane(final Server server) {
48
+    public UserModesPane(final SwingController controller,
49
+            final Server server) {
46
         super();
50
         super();
47
 
51
 
52
+        this.controller = controller;
48
         this.server = server;
53
         this.server = server;
49
         initModesPanel();
54
         initModesPanel();
50
     }
55
     }
113
 
118
 
114
     /** {@inheritDoc} */
119
     /** {@inheritDoc} */
115
     @Override
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 Просмотреть файл

24
 
24
 
25
 import com.dmdirc.addons.ui_swing.MainFrame;
25
 import com.dmdirc.addons.ui_swing.MainFrame;
26
 import com.dmdirc.addons.ui_swing.SwingController;
26
 import com.dmdirc.addons.ui_swing.SwingController;
27
-import com.dmdirc.config.IdentityManager;
28
 import com.dmdirc.logger.ErrorLevel;
27
 import com.dmdirc.logger.ErrorLevel;
29
 import com.dmdirc.logger.ErrorListener;
28
 import com.dmdirc.logger.ErrorListener;
30
 import com.dmdirc.logger.ErrorManager;
29
 import com.dmdirc.logger.ErrorManager;
58
      */
57
      */
59
     private static final long serialVersionUID = 2;
58
     private static final long serialVersionUID = 2;
60
     /** non error state image icon. */
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
     /** Status controller. */
61
     /** Status controller. */
64
     private final MainFrame mainFrame;
62
     private final MainFrame mainFrame;
65
     /** Swing status bar. */
63
     /** Swing status bar. */
79
     private ErrorLevel errorLevel;
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
      * @param controller Swing controller
82
      * @param controller Swing controller
85
      * @param mainFrame Main frame
83
      * @param mainFrame Main frame
92
         this.controller = controller;
90
         this.controller = controller;
93
         this.mainFrame = mainFrame;
91
         this.mainFrame = mainFrame;
94
         this.statusBar = statusBar;
92
         this.statusBar = statusBar;
93
+        DEFAULT_ICON = new IconManager(controller.getGlobalConfig())
94
+                .getIcon("normal");
95
 
95
 
96
         menu = new JPopupMenu();
96
         menu = new JPopupMenu();
97
         dismiss = new JMenuItem("Clear All");
97
         dismiss = new JMenuItem("Clear All");
153
                         if (errorLevel == null ||
153
                         if (errorLevel == null ||
154
                                 !error.getLevel().moreImportant(errorLevel)) {
154
                                 !error.getLevel().moreImportant(errorLevel)) {
155
                             errorLevel = error.getLevel();
155
                             errorLevel = error.getLevel();
156
-                            label.setIcon(new IconManager(IdentityManager
156
+                            label.setIcon(new IconManager(controller
157
                                     .getGlobalConfig()).getIcon(errorLevel
157
                                     .getGlobalConfig()).getIcon(errorLevel
158
                                     .getIcon()));
158
                                     .getIcon()));
159
                         }
159
                         }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/statusbar/GappedEtchedBorder.java Просмотреть файл

36
     /** Java serialisation version ID. */
36
     /** Java serialisation version ID. */
37
     private static final long serialVersionUID = 1;
37
     private static final long serialVersionUID = 1;
38
     /** Parent popup window. */
38
     /** Parent popup window. */
39
-    private final StatusbarPopupWindow outer;
39
+    private transient final StatusbarPopupWindow outer;
40
 
40
 
41
     /**
41
     /**
42
      * Creates a new etched border leaving a gap where the specified window is.
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 Просмотреть файл

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

+ 9
- 7
src/com/dmdirc/addons/ui_swing/components/statusbar/MessageLabel.java Просмотреть файл

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

+ 10
- 5
src/com/dmdirc/addons/ui_swing/components/statusbar/MessagePopup.java Просмотреть файл

22
 
22
 
23
 package com.dmdirc.addons.ui_swing.components.statusbar;
23
 package com.dmdirc.addons.ui_swing.components.statusbar;
24
 
24
 
25
-import com.dmdirc.config.IdentityManager;
25
+import com.dmdirc.config.ConfigManager;
26
 import com.dmdirc.ui.IconManager;
26
 import com.dmdirc.ui.IconManager;
27
 import com.dmdirc.ui.StatusMessage;
27
 import com.dmdirc.ui.StatusMessage;
28
 
28
 
57
     private final List<StatusMessage> messages;
57
     private final List<StatusMessage> messages;
58
     /** Parent panel. */
58
     /** Parent panel. */
59
     private final JPanel parent;
59
     private final JPanel parent;
60
+    /** Config manager. */
61
+    private final ConfigManager configManager;
60
 
62
 
61
     /**
63
     /**
62
      * Creates a new message history popup.
64
      * Creates a new message history popup.
63
      *
65
      *
64
      * @param parent Parent to size against
66
      * @param parent Parent to size against
65
      * @param parentWindow Parent window
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
         super(new JLabel("^"),
72
         super(new JLabel("^"),
69
                 new SidelessEtchedBorder(SidelessEtchedBorder.Side.LEFT),
73
                 new SidelessEtchedBorder(SidelessEtchedBorder.Side.LEFT),
70
                 new SidelessEtchedBorder(SidelessEtchedBorder.Side.TOP));
74
                 new SidelessEtchedBorder(SidelessEtchedBorder.Side.TOP));
71
         this.parentWindow = parentWindow;
75
         this.parentWindow = parentWindow;
72
         this.parent = parent;
76
         this.parent = parent;
77
+        this.configManager = configManager;
73
         messages = new ArrayList<StatusMessage>();
78
         messages = new ArrayList<StatusMessage>();
74
     }
79
     }
75
 
80
 
164
 
169
 
165
             for (StatusMessage message : messages) {
170
             for (StatusMessage message : messages) {
166
                 panel.add(new JLabel(message.getMessage(), message.getIconType()
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 Просмотреть файл

69
             final MainFrame mainFrame) {
69
             final MainFrame mainFrame) {
70
         super();
70
         super();
71
 
71
 
72
-        messageLabel = new MessageLabel(mainFrame);
72
+        messageLabel = new MessageLabel(mainFrame,
73
+                controller.getGlobalConfig());
73
         errorPanel = new ErrorPanel(controller, mainFrame, this);
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
         setLayout(new MigLayout("fill, ins 0, hidemode 3"));
78
         setLayout(new MigLayout("fill, ins 0, hidemode 3"));
78
 
79
 

+ 23
- 17
src/com/dmdirc/addons/ui_swing/components/statusbar/UpdaterLabel.java Просмотреть файл

22
 
22
 
23
 package com.dmdirc.addons.ui_swing.components.statusbar;
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
 import com.dmdirc.addons.ui_swing.dialogs.updater.SwingRestartDialog;
26
 import com.dmdirc.addons.ui_swing.dialogs.updater.SwingRestartDialog;
27
 import com.dmdirc.addons.ui_swing.dialogs.updater.SwingUpdaterDialog;
27
 import com.dmdirc.addons.ui_swing.dialogs.updater.SwingUpdaterDialog;
28
-import com.dmdirc.config.IdentityManager;
29
-import com.dmdirc.ui.IconManager;
30
 import com.dmdirc.interfaces.ui.StatusBarComponent;
28
 import com.dmdirc.interfaces.ui.StatusBarComponent;
29
+import com.dmdirc.ui.IconManager;
31
 import com.dmdirc.updater.UpdateChecker;
30
 import com.dmdirc.updater.UpdateChecker;
32
 import com.dmdirc.updater.UpdateChecker.STATE;
31
 import com.dmdirc.updater.UpdateChecker.STATE;
33
 import com.dmdirc.updater.UpdateCheckerListener;
32
 import com.dmdirc.updater.UpdateCheckerListener;
38
 import javax.swing.BorderFactory;
37
 import javax.swing.BorderFactory;
39
 import javax.swing.JLabel;
38
 import javax.swing.JLabel;
40
 
39
 
40
+import lombok.Getter;
41
+
41
 /**
42
 /**
42
  * Updater label is responsible for handling the display of updates in the
43
  * Updater label is responsible for handling the display of updates in the
43
  * status bar.
44
  * status bar.
52
      */
53
      */
53
     private static final long serialVersionUID = 1;
54
     private static final long serialVersionUID = 1;
54
     /** Swing controller. */
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
         super(new JLabel());
66
         super(new JLabel());
64
 
67
 
65
-        this.mainFrame = mainFrame;
68
+        this.controller = controller;
66
         setBorder(BorderFactory.createEtchedBorder());
69
         setBorder(BorderFactory.createEtchedBorder());
67
         UpdateChecker.addListener(this);
70
         UpdateChecker.addListener(this);
68
         setVisible(false);
71
         setVisible(false);
79
         super.mouseClicked(mouseEvent);
82
         super.mouseClicked(mouseEvent);
80
 
83
 
81
         if (mouseEvent.getButton() == MouseEvent.BUTTON1) {
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
         }
104
         }
99
 
105
 
100
         if (newStatus.equals(STATE.CHECKING)) {
106
         if (newStatus.equals(STATE.CHECKING)) {
101
-            label.setIcon(new IconManager(IdentityManager.getGlobalConfig())
107
+            label.setIcon(new IconManager(controller.getGlobalConfig())
102
                     .getIcon("hourglass"));
108
                     .getIcon("hourglass"));
103
         } else if (newStatus.equals(STATE.UPDATES_AVAILABLE)) {
109
         } else if (newStatus.equals(STATE.UPDATES_AVAILABLE)) {
104
-            label.setIcon(new IconManager(IdentityManager.getGlobalConfig())
110
+            label.setIcon(new IconManager(controller.getGlobalConfig())
105
                     .getIcon("update"));
111
                     .getIcon("update"));
106
         } else if (newStatus.equals(STATE.RESTART_REQUIRED)) {
112
         } else if (newStatus.equals(STATE.RESTART_REQUIRED)) {
107
-            label.setIcon(new IconManager(IdentityManager.getGlobalConfig())
113
+            label.setIcon(new IconManager(controller.getGlobalConfig())
108
                     .getIcon("restart-needed"));
114
                     .getIcon("restart-needed"));
109
         }
115
         }
110
     }
116
     }
112
     /** {@inheritDoc} */
118
     /** {@inheritDoc} */
113
     @Override
119
     @Override
114
     protected StatusbarPopupWindow getWindow() {
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 Просмотреть файл

23
 package com.dmdirc.addons.ui_swing.components.validating;
23
 package com.dmdirc.addons.ui_swing.components.validating;
24
 
24
 
25
 import com.dmdirc.addons.ui_swing.UIUtilities;
25
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
-import com.dmdirc.config.IdentityManager;
27
 import com.dmdirc.ui.IconManager;
26
 import com.dmdirc.ui.IconManager;
28
 import com.dmdirc.util.validators.ValidationResponse;
27
 import com.dmdirc.util.validators.ValidationResponse;
29
 import com.dmdirc.util.validators.Validator;
28
 import com.dmdirc.util.validators.Validator;
65
     /**
64
     /**
66
      * Instantiates a new Validating text field.
65
      * Instantiates a new Validating text field.
67
      *
66
      *
67
+     * @param iconManager Icon manager
68
      * @param validator Validator instance
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
      * Instantiates a new Validating text field.
76
      * Instantiates a new Validating text field.
76
      *
77
      *
78
+     * @param iconManager Icon manager
77
      * @param textField JTextField to wrap
79
      * @param textField JTextField to wrap
78
      * @param validator Validator instance
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
         super();
84
         super();
83
         this.textField = textField;
85
         this.textField = textField;
84
         this.validator = validator;
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
         setLayout(new MigLayout("fill, ins 0, hidemode 3, gap 0"));
89
         setLayout(new MigLayout("fill, ins 0, hidemode 3, gap 0"));
89
         add(textField, "grow, pushx");
90
         add(textField, "grow, pushx");

+ 7
- 5
src/com/dmdirc/addons/ui_swing/dialogs/ChannelJoinDialog.java Просмотреть файл

23
 package com.dmdirc.addons.ui_swing.dialogs;
23
 package com.dmdirc.addons.ui_swing.dialogs;
24
 
24
 
25
 import com.dmdirc.addons.ui_swing.MainFrame;
25
 import com.dmdirc.addons.ui_swing.MainFrame;
26
+import com.dmdirc.addons.ui_swing.SwingController;
26
 import com.dmdirc.parser.common.ChannelJoinRequest;
27
 import com.dmdirc.parser.common.ChannelJoinRequest;
27
 
28
 
28
 import java.awt.Dialog.ModalityType;
29
 import java.awt.Dialog.ModalityType;
42
      * Creates a new dialog which prompts a user and then joins the channel
43
      * Creates a new dialog which prompts a user and then joins the channel
43
      * they specify.
44
      * they specify.
44
      *
45
      *
45
-     * @param owner Parent window
46
+     * @param controller Swing controller
46
      * @param modality Window modality
47
      * @param modality Window modality
47
      * @param title Window title
48
      * @param title Window title
48
      * @param message Window message
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
     /** {@inheritDoc} */
59
     /** {@inheritDoc} */

+ 30
- 26
src/com/dmdirc/addons/ui_swing/dialogs/NewServerDialog.java Просмотреть файл

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

+ 12
- 4
src/com/dmdirc/addons/ui_swing/dialogs/StandardInputDialog.java Просмотреть файл

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

+ 15
- 5
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionsPanel.java Просмотреть файл

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

+ 8
- 2
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionsTreePanel.java Просмотреть файл

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

+ 29
- 16
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionEditorDialog.java Просмотреть файл

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

+ 12
- 4
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionNamePanel.java Просмотреть файл

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

+ 11
- 5
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionGroupSettingsPanel.java Просмотреть файл

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

+ 11
- 4
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanel.java Просмотреть файл

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

+ 16
- 11
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsManagerDialog.java Просмотреть файл

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

+ 16
- 7
src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasManagerDialog.java Просмотреть файл

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

+ 10
- 4
src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasPanel.java Просмотреть файл

26
 import com.dmdirc.actions.CoreActionComparison;
26
 import com.dmdirc.actions.CoreActionComparison;
27
 import com.dmdirc.actions.CoreActionComponent;
27
 import com.dmdirc.actions.CoreActionComponent;
28
 import com.dmdirc.actions.wrappers.Alias;
28
 import com.dmdirc.actions.wrappers.Alias;
29
+import com.dmdirc.addons.ui_swing.SwingController;
29
 import com.dmdirc.addons.ui_swing.UIUtilities;
30
 import com.dmdirc.addons.ui_swing.UIUtilities;
30
 import com.dmdirc.addons.ui_swing.components.inputfields.ValidatingTextFieldInputField;
31
 import com.dmdirc.addons.ui_swing.components.inputfields.ValidatingTextFieldInputField;
31
 import com.dmdirc.addons.ui_swing.components.renderers.ActionComparisonCellRenderer;
32
 import com.dmdirc.addons.ui_swing.components.renderers.ActionComparisonCellRenderer;
70
     /** Alias. */
71
     /** Alias. */
71
     private Alias alias;
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
     @SuppressWarnings("unchecked")
79
     @SuppressWarnings("unchecked")
75
-    public AliasPanel() {
80
+    public AliasPanel(final SwingController controller) {
76
         super();
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
         command.setEnabled(false);
86
         command.setEnabled(false);
81
         //new SwingInputHandler(command, GlobalCommandParser
87
         //new SwingInputHandler(command, GlobalCommandParser
82
         //        .getGlobalCommandParser(), inputWindow)
88
         //        .getGlobalCommandParser(), inputWindow)

+ 15
- 9
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelListModesPane.java Просмотреть файл

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

+ 25
- 16
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java Просмотреть файл

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

+ 12
- 4
src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryPanel.java Просмотреть файл

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

+ 9
- 4
src/com/dmdirc/addons/ui_swing/dialogs/prefs/PrefsCategoryLoader.java Просмотреть файл

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

+ 4
- 2
src/com/dmdirc/addons/ui_swing/dialogs/prefs/SwingPreferencesDialog.java Просмотреть файл

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

+ 10
- 4
src/com/dmdirc/addons/ui_swing/dialogs/prefs/URLConfigPanel.java Просмотреть файл

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

+ 15
- 11
src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileDetailPanel.java Просмотреть файл

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

+ 15
- 15
src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileManagerDialog.java Просмотреть файл

22
 
22
 
23
 package com.dmdirc.addons.ui_swing.dialogs.profiles;
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
 import com.dmdirc.addons.ui_swing.components.ListScroller;
26
 import com.dmdirc.addons.ui_swing.components.ListScroller;
27
 import com.dmdirc.addons.ui_swing.components.renderers.ProfileListCellRenderer;
27
 import com.dmdirc.addons.ui_swing.components.renderers.ProfileListCellRenderer;
28
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
28
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
60
     private static final long serialVersionUID = 2;
60
     private static final long serialVersionUID = 2;
61
     /** Previously created instance of ProfileEditorDialog. */
61
     /** Previously created instance of ProfileEditorDialog. */
62
     private static volatile ProfileManagerDialog me;
62
     private static volatile ProfileManagerDialog me;
63
-    /** main frame. */
64
-    private final MainFrame mainFrame;
63
+    /** Swing controller. */
64
+    private final SwingController controller;
65
     /** Profile list. */
65
     /** Profile list. */
66
     private JList profileList;
66
     private JList profileList;
67
     /** Profile list mode. */
67
     /** Profile list mode. */
82
     /**
82
     /**
83
      * Creates a new instance of ProfileEditorDialog.
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
         deletedProfiles = new ArrayList<Profile>();
90
         deletedProfiles = new ArrayList<Profile>();
91
 
91
 
92
         initComponents();
92
         initComponents();
105
     /**
105
     /**
106
      * Creates the dialog if one doesn't exist, and displays it.
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
         me.display();
113
         me.display();
114
         me.requestFocusInWindow();
114
         me.requestFocusInWindow();
117
     /**
117
     /**
118
      * Returns the current instance of the ProfileManagerDialog.
118
      * Returns the current instance of the ProfileManagerDialog.
119
      *
119
      *
120
-     * @param mainFrame Main frame
120
+     * @param controller Swing controller
121
      *
121
      *
122
      * @return The current ProfileManagerDialog instance
122
      * @return The current ProfileManagerDialog instance
123
      */
123
      */
124
     public static ProfileManagerDialog getProfileManagerDialog(
124
     public static ProfileManagerDialog getProfileManagerDialog(
125
-            final MainFrame mainFrame) {
125
+            final SwingController controller) {
126
         synchronized (ProfileManagerDialog.class) {
126
         synchronized (ProfileManagerDialog.class) {
127
             if (me == null) {
127
             if (me == null) {
128
-                me = new ProfileManagerDialog(mainFrame);
128
+                me = new ProfileManagerDialog(controller);
129
             }
129
             }
130
         }
130
         }
131
 
131
 
142
 
142
 
143
         model = new ProfileListModel();
143
         model = new ProfileListModel();
144
         profileList = new JList(model);
144
         profileList = new JList(model);
145
-        details = new ProfileDetailPanel(model, mainFrame, this);
145
+        details = new ProfileDetailPanel(model, controller, this);
146
         addButton = new JButton("Add");
146
         addButton = new JButton("Add");
147
         deleteButton = new JButton("Delete");
147
         deleteButton = new JButton("Delete");
148
         infoLabel =
148
         infoLabel =
214
             dispose();
214
             dispose();
215
         }
215
         }
216
         if (NewServerDialog.isNewServerDialogShowing()) {
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 Просмотреть файл

31
 import com.dmdirc.util.validators.Validator;
31
 import com.dmdirc.util.validators.Validator;
32
 import com.dmdirc.addons.serverlists.ServerGroup;
32
 import com.dmdirc.addons.serverlists.ServerGroup;
33
 
33
 
34
+import com.dmdirc.ui.IconManager;
34
 import java.awt.Window;
35
 import java.awt.Window;
35
 import java.awt.Dialog.ModalityType;
36
 import java.awt.Dialog.ModalityType;
36
 import java.awt.event.ActionEvent;
37
 import java.awt.event.ActionEvent;
75
     private final JTree items;
76
     private final JTree items;
76
     /** Parent model. */
77
     /** Parent model. */
77
     private final ServerListModel model;
78
     private final ServerListModel model;
79
+    /** Icon manager. */
80
+    private final IconManager iconManager;
78
 
81
 
79
     /**
82
     /**
80
      * Instantiates a new standard input dialog.
83
      * Instantiates a new standard input dialog.
81
      *
84
      *
85
+     * @param iconManager Icon manager
82
      * @param items Parent tree
86
      * @param items Parent tree
83
      * @param owner Dialog owner
87
      * @param owner Dialog owner
84
      * @param model Server list model
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
             final ServerListModel model) {
92
             final ServerListModel model) {
88
         super(owner, ModalityType.MODELESS);
93
         super(owner, ModalityType.MODELESS);
89
 
94
 
95
+        this.iconManager = iconManager;
90
         this.items = items;
96
         this.items = items;
91
         this.model = model;
97
         this.model = model;
92
         this.entryValidator = new NotEmptyValidator();
98
         this.entryValidator = new NotEmptyValidator();
122
      */
128
      */
123
     private void initComponents() {
129
     private void initComponents() {
124
         orderButtons(new JButton(), new JButton());
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
         blurb = new TextLabel(message);
133
         blurb = new TextLabel(message);
128
         validateText();
134
         validateText();
129
     }
135
     }

+ 8
- 2
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/AddGroupInputDialog.java Просмотреть файл

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

+ 17
- 10
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/ServerListDialog.java Просмотреть файл

25
 import com.dmdirc.addons.ui_swing.components.LockedLayer;
25
 import com.dmdirc.addons.ui_swing.components.LockedLayer;
26
 import com.dmdirc.addons.ui_swing.dialogs.StandardDialog;
26
 import com.dmdirc.addons.ui_swing.dialogs.StandardDialog;
27
 import com.dmdirc.addons.serverlists.ServerGroupItem;
27
 import com.dmdirc.addons.serverlists.ServerGroupItem;
28
+import com.dmdirc.addons.ui_swing.SwingController;
28
 import com.dmdirc.ui.core.util.URLHandler;
29
 import com.dmdirc.ui.core.util.URLHandler;
29
 
30
 
30
 import java.awt.Window;
31
 import java.awt.Window;
80
     /**
81
     /**
81
      * Creates the dialog if one doesn't exist, and displays it.
82
      * Creates the dialog if one doesn't exist, and displays it.
82
      *
83
      *
84
+     * @param controller Swing Controller
83
      * @param parentWindow Parent window
85
      * @param parentWindow Parent window
84
      * @param urlHandler The URL Handler to use to handle clicked links
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
         me.display();
92
         me.display();
91
         me.requestFocusInWindow();
93
         me.requestFocusInWindow();
94
     /**
96
     /**
95
      * Returns the current instance of the ServerListDialog.
97
      * Returns the current instance of the ServerListDialog.
96
      *
98
      *
99
+     * @param controller Swing Controller
97
      * @param parentWindow Parent window
100
      * @param parentWindow Parent window
98
      * @param urlHandler The URL Handler to use to handle clicked links
101
      * @param urlHandler The URL Handler to use to handle clicked links
102
+     *
99
      * @return The current ServerListDialog instance
103
      * @return The current ServerListDialog instance
100
      */
104
      */
101
     public static ServerListDialog getServerListDialog(
105
     public static ServerListDialog getServerListDialog(
102
-            final Window parentWindow, final URLHandler urlHandler) {
106
+            final SwingController controller, final Window parentWindow,
107
+            final URLHandler urlHandler) {
103
         synchronized (ServerListDialog.class) {
108
         synchronized (ServerListDialog.class) {
104
             if (me == null) {
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
      * @param modalityType Desired modality
122
      * @param modalityType Desired modality
118
      * @param urlHandler The URL Handler to use to handle clicked links
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
         super(window, modalityType);
128
         super(window, modalityType);
123
 
129
 
124
         setTitle("Server List");
130
         setTitle("Server List");
141
                 null)));
147
                 null)));
142
         profileLayer = new JXLayer<Profiles>(new Profiles(model), profileLock);
148
         profileLayer = new JXLayer<Profiles>(new Profiles(model), profileLock);
143
         performLayer = new JXLayer<Perform>(new Perform(model), performLock);
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
                 settingsLock);
151
                 settingsLock);
146
         infoLayer = new JXLayer<Info>(new Info(model, urlHandler), infoLock);
152
         infoLayer = new JXLayer<Info>(new Info(model, urlHandler), infoLock);
147
         help = new Help();
153
         help = new Help();
149
 
155
 
150
         setLayout(new MigLayout("fill, wrap 2, wmin 600, wmax 600"));
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
         add(help, "pos 160 0.5al");
160
         add(help, "pos 160 0.5al");
154
         add(infoLayer, "growx, pushx");
161
         add(infoLayer, "growx, pushx");
155
         add(settingsLayer, "grow, push, gaptop unrel, gapbottom unrel");
162
         add(settingsLayer, "grow, push, gaptop unrel, gapbottom unrel");

+ 9
- 4
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/Settings.java Просмотреть файл

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

+ 9
- 3
src/com/dmdirc/addons/ui_swing/dialogs/serverlist/Tree.java Просмотреть файл

25
 import com.dmdirc.addons.ui_swing.components.TreeScroller;
25
 import com.dmdirc.addons.ui_swing.components.TreeScroller;
26
 import com.dmdirc.addons.ui_swing.components.renderers.ServerGroupTreeRenderer;
26
 import com.dmdirc.addons.ui_swing.components.renderers.ServerGroupTreeRenderer;
27
 import com.dmdirc.addons.serverlists.ServerGroupItem;
27
 import com.dmdirc.addons.serverlists.ServerGroupItem;
28
+import com.dmdirc.ui.IconManager;
28
 
29
 
29
 import java.awt.Rectangle;
30
 import java.awt.Rectangle;
30
 import java.awt.Window;
31
 import java.awt.Window;
69
     private final JButton addItemButton;
70
     private final JButton addItemButton;
70
     /** Parent window. */
71
     /** Parent window. */
71
     private final Window parentWindow;
72
     private final Window parentWindow;
73
+    /** Icon manager. */
74
+    private final IconManager iconManager;
72
 
75
 
73
     /**
76
     /**
74
      * Instantiates a new tree of server groups.
77
      * Instantiates a new tree of server groups.
75
      *
78
      *
79
+     * @param iconManager Icon Manager
76
      * @param model Model backing this tree
80
      * @param model Model backing this tree
77
      * @param parentWindow Dialog's parent window
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
         super();
85
         super();
81
 
86
 
87
+        this.iconManager = iconManager;
82
         this.model = model;
88
         this.model = model;
83
         this.parentWindow = parentWindow;
89
         this.parentWindow = parentWindow;
84
         addGroupButton = new JButton("Add group");
90
         addGroupButton = new JButton("Add group");
193
     @Override
199
     @Override
194
     public void actionPerformed(final ActionEvent e) {
200
     public void actionPerformed(final ActionEvent e) {
195
         if (e.getSource() == addGroupButton) {
201
         if (e.getSource() == addGroupButton) {
196
-            new AddGroupInputDialog(parentWindow, items, model).display();
202
+            new AddGroupInputDialog(iconManager, parentWindow, items, model).display();
197
         } else {
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 Просмотреть файл

23
 package com.dmdirc.addons.ui_swing.dialogs.serversetting;
23
 package com.dmdirc.addons.ui_swing.dialogs.serversetting;
24
 
24
 
25
 import com.dmdirc.Server;
25
 import com.dmdirc.Server;
26
+import com.dmdirc.addons.ui_swing.SwingController;
26
 import com.dmdirc.addons.ui_swing.UIUtilities;
27
 import com.dmdirc.addons.ui_swing.UIUtilities;
27
 import com.dmdirc.addons.ui_swing.dialogs.StandardInputDialog;
28
 import com.dmdirc.addons.ui_swing.dialogs.StandardInputDialog;
28
 import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
29
 import com.dmdirc.addons.ui_swing.dialogs.StandardQuestionDialog;
64
     private final Server server;
65
     private final Server server;
65
     /** Parent window. */
66
     /** Parent window. */
66
     private final Window parentWindow;
67
     private final Window parentWindow;
68
+    /** Swing controller. */
69
+    private final SwingController controller;
67
     /** Add button. */
70
     /** Add button. */
68
     private JButton addButton;
71
     private JButton addButton;
69
     /** Remove button. */
72
     /** Remove button. */
82
     /**
85
     /**
83
      * Creates a new instance of IgnoreList.
86
      * Creates a new instance of IgnoreList.
84
      *
87
      *
88
+     * @param controller Swing controller
85
      * @param server Parent server
89
      * @param server Parent server
86
      * @param parentWindow Parent window
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
         super();
94
         super();
90
 
95
 
96
+        this.controller = controller;
91
         this.server = server;
97
         this.server = server;
92
         this.parentWindow = parentWindow;
98
         this.parentWindow = parentWindow;
93
 
99
 
97
         populateList();
103
         populateList();
98
     }
104
     }
99
 
105
 
100
-    /** Initialises teh components. */
106
+    /** Initialises the components. */
101
     private void initComponents() {
107
     private void initComponents() {
102
         cachedIgnoreList = new IgnoreList(server.getIgnoreList().getRegexList());
108
         cachedIgnoreList = new IgnoreList(server.getIgnoreList().getRegexList());
103
 
109
 
176
     @Override
182
     @Override
177
     public void actionPerformed(final ActionEvent e) {
183
     public void actionPerformed(final ActionEvent e) {
178
         if (e.getSource() == addButton) {
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
                     "Please enter the new ignore list entry",
187
                     "Please enter the new ignore list entry",
182
                     viewToggle.isSelected() ? new ValidatorChain<String>(
188
                     viewToggle.isSelected() ? new ValidatorChain<String>(
183
                     new NotEmptyValidator(), new RegexValidator())
189
                     new NotEmptyValidator(), new RegexValidator())
184
                     : new NotEmptyValidator()) {
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
                 private static final long serialVersionUID = 2;
198
                 private static final long serialVersionUID = 2;
192
 
199
 

+ 21
- 11
src/com/dmdirc/addons/ui_swing/dialogs/serversetting/ServerSettingsDialog.java Просмотреть файл

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/framemanager/ctrltab/CtrlTabWindowManager.java Просмотреть файл

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

+ 1
- 2
src/com/dmdirc/addons/ui_swing/framemanager/tree/NodeLabel.java Просмотреть файл

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

+ 9
- 9
src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeFrameManager.java Просмотреть файл

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

+ 10
- 18
src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeViewModel.java Просмотреть файл

24
 
24
 
25
 import com.dmdirc.FrameContainerComparator;
25
 import com.dmdirc.FrameContainerComparator;
26
 import com.dmdirc.GlobalWindow;
26
 import com.dmdirc.GlobalWindow;
27
-import com.dmdirc.config.IdentityManager;
27
+import com.dmdirc.addons.ui_swing.SwingController;
28
 
28
 
29
 import javax.swing.tree.DefaultTreeModel;
29
 import javax.swing.tree.DefaultTreeModel;
30
 
30
 
41
     private static final long serialVersionUID = 1;
41
     private static final long serialVersionUID = 1;
42
     /** Frame container comparator. */
42
     /** Frame container comparator. */
43
     private final FrameContainerComparator comparator;
43
     private final FrameContainerComparator comparator;
44
+    /** Parent UI Controller. */
45
+    private SwingController controller;
44
 
46
 
45
     /**
47
     /**
46
      * Creates a tree in which any node can have children.
48
      * Creates a tree in which any node can have children.
47
      *
49
      *
50
+     * @param controller Parent UI
48
      * @param root a TreeNode object that is the root of the tree.
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
         comparator = new FrameContainerComparator();
58
         comparator = new FrameContainerComparator();
67
     }
59
     }
68
 
60
 
105
             return 0;
97
             return 0;
106
         }
98
         }
107
 
99
 
108
-        if (parent.equals(root) && !IdentityManager.getGlobalConfig().
100
+        if (parent.equals(root) && !controller.getGlobalConfig().
109
                 getOptionBool("ui", "sortrootwindows")) {
101
                 getOptionBool("ui", "sortrootwindows")) {
110
             return parent.getChildCount();
102
             return parent.getChildCount();
111
         }
103
         }
112
 
104
 
113
-        if (IdentityManager.getGlobalConfig().getOptionBool("ui",
105
+        if (controller.getGlobalConfig().getOptionBool("ui",
114
                 "sortchildwindows")) {
106
                 "sortchildwindows")) {
115
             for (int i = 0; i < parent.getChildCount(); i++) {
107
             for (int i = 0; i < parent.getChildCount(); i++) {
116
                 final TreeViewNode child = (TreeViewNode) parent.getChildAt(i);
108
                 final TreeViewNode child = (TreeViewNode) parent.getChildAt(i);

+ 5
- 6
src/com/dmdirc/addons/ui_swing/wizard/firstrun/SwingFirstRunWizard.java Просмотреть файл

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

+ 8
- 4
src/com/dmdirc/addons/windowflashing/WindowFlashing.java Просмотреть файл

128
                 PreferencesType.OPTIONALINTEGER, getDomain(), "blinkrate",
128
                 PreferencesType.OPTIONALINTEGER, getDomain(), "blinkrate",
129
                 "Blink rate", "Specifies the rate at which the taskbar and or "
129
                 "Blink rate", "Specifies the rate at which the taskbar and or "
130
                 + "caption will blink, if unspecified this will be your cursor "
130
                 + "caption will blink, if unspecified this will be your cursor "
131
-                + "blink rate."));
131
+                + "blink rate.",
132
+                manager.getConfigManager(), manager.getIdentity()));
132
         category.addSetting(new PreferencesSetting(
133
         category.addSetting(new PreferencesSetting(
133
                 PreferencesType.OPTIONALINTEGER, getDomain(), "flashcount",
134
                 PreferencesType.OPTIONALINTEGER, getDomain(), "flashcount",
134
                 "Flash count", "Specifies the number of times to blink, if "
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
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
138
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
137
                 getDomain(), "flashtaskbar", "Flash taskbar",
139
                 getDomain(), "flashtaskbar", "Flash taskbar",
138
-                "Should the taskbar entry flash?"));
140
+                "Should the taskbar entry flash?",
141
+                manager.getConfigManager(), manager.getIdentity()));
139
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
142
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
140
                 getDomain(), "flashcaption", "Flash caption",
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
         manager.addCategory(category);
147
         manager.addCategory(category);
144
     }
148
     }

+ 6
- 3
src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java Просмотреть файл

223
 
223
 
224
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
224
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
225
                 getDomain(), "channel.shownone", "Show 'none' count",
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
         category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
228
         category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
228
                 getDomain(), "channel.noneprefix", "'None' count prefix",
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
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
232
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
231
                 getDomain(), "client.showname", "Show real name",
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
         manager.getCategory("Plugins").addSubCategory(category);
237
         manager.getCategory("Plugins").addSubCategory(category);
235
     }
238
     }

+ 1
- 1
test/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionsGroupPanelTest.java Просмотреть файл

90
             action1, action2, action3, action4,
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
         table = panel.getTable();
94
         table = panel.getTable();
95
     }
95
     }
96
 
96
 

Загрузка…
Отмена
Сохранить