diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/commands/ChannelSettings.java b/ui_swing/src/com/dmdirc/addons/ui_swing/commands/ChannelSettings.java index 3918dfc41..26d0feb83 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/commands/ChannelSettings.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/commands/ChannelSettings.java @@ -22,7 +22,6 @@ package com.dmdirc.addons.ui_swing.commands; -import com.dmdirc.Channel; import com.dmdirc.FrameContainer; import com.dmdirc.addons.ui_swing.dialogs.channelsetting.ChannelSettingsDialog; import com.dmdirc.addons.ui_swing.injection.KeyedDialogProvider; @@ -36,6 +35,7 @@ import com.dmdirc.commandparser.commands.context.ChannelCommandContext; import com.dmdirc.commandparser.commands.context.CommandContext; import com.dmdirc.interfaces.CommandController; +import com.dmdirc.interfaces.GroupChat; import com.dmdirc.ui.input.AdditionalTabTargets; import javax.annotation.Nonnull; @@ -51,7 +51,7 @@ public class ChannelSettings extends Command implements IntelligentCommand { public static final CommandInfo INFO = new BaseCommandInfo("channelsettings", "channelsettings - opens the channel settings window", CommandType.TYPE_CHANNEL); /** The controller to use to show the settings window. */ - private final KeyedDialogProvider dialogProvider; + private final KeyedDialogProvider dialogProvider; /** * Creates a new instance of the {@link ChannelSettings} command. @@ -62,7 +62,7 @@ public class ChannelSettings extends Command implements IntelligentCommand { @Inject public ChannelSettings( final CommandController commandController, - final KeyedDialogProvider dialogProvider) { + final KeyedDialogProvider dialogProvider) { super(commandController); this.dialogProvider = dialogProvider; } diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java b/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java index 12ed571bb..d1c675d5e 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java @@ -22,7 +22,6 @@ package com.dmdirc.addons.ui_swing.components.frames; -import com.dmdirc.Channel; import com.dmdirc.DMDircMBassador; import com.dmdirc.ServerState; import com.dmdirc.addons.ui_swing.EDTInvocation; @@ -58,7 +57,7 @@ import static com.dmdirc.addons.ui_swing.SwingPreconditions.checkOnEDT; /** - * The channel frame is the GUI component that represents a channel to the user. + * The groupChat frame is the GUI component that represents a groupChat to the user. */ public final class ChannelFrame extends InputTextFrame { @@ -79,9 +78,9 @@ public final class ChannelFrame extends InputTextFrame { /** Config to read settings from. */ private final AggregateConfigProvider globalConfig; /** Channel settings dialog provider. */ - private final KeyedDialogProvider dialogProvider; - /** Channel instance. */ - private final Channel channel; + private final KeyedDialogProvider dialogProvider; + /** Group chat instance. */ + private final GroupChat groupChat; /** Config binder. */ private final ConfigBinder binder; @@ -91,33 +90,33 @@ public final class ChannelFrame extends InputTextFrame { * * @param deps The dependencies required by text frames. * @param inputFieldProvider The provider to use to create a new input field. - * @param identityFactory The factory to use to create a channel identity. + * @param identityFactory The factory to use to create a group chat identity. * @param topicBarFactory The factory to use to create topic bars. - * @param owner The Channel object that owns this frame + * @param owner The group chat object that owns this frame * @param domain The domain to read settings from - * @param dialogProvider The dialog provider to get the channel settings dialog from. + * @param dialogProvider The dialog provider to get the group chat settings dialog from. */ public ChannelFrame( final String domain, final TextFrameDependencies deps, final Provider inputFieldProvider, final IdentityFactory identityFactory, - final KeyedDialogProvider dialogProvider, + final KeyedDialogProvider dialogProvider, final InputTextFramePasteActionFactory inputTextFramePasteActionFactory, final TopicBarFactory topicBarFactory, - final Channel owner) { - super(deps, inputFieldProvider, inputTextFramePasteActionFactory, owner); + final GroupChat owner) { + super(deps, inputFieldProvider, inputTextFramePasteActionFactory, owner.getWindowModel()); this.eventBus = deps.eventBus; this.globalConfig = deps.globalConfig; this.dialogProvider = dialogProvider; - this.channel = owner; + this.groupChat = owner; initComponents(topicBarFactory, deps.colourManagerFactory); binder = getContainer().getConfigManager().getBinder().withDefaultDomain(domain); identity = identityFactory.createChannelConfig(owner.getConnection().get().getNetwork(), - owner.getChannelInfo().getName()); + owner.getName()); } /** @@ -142,8 +141,7 @@ private void initComponents(final TopicBarFactory topicBarFactory, nicklist = new NickList(this, getContainer().getConfigManager(), colourManagerFactory); settingsMI = new JMenuItem("Settings"); - settingsMI.addActionListener(l -> - dialogProvider.displayOrRequestFocus((Channel) getContainer())); + settingsMI.addActionListener(l -> dialogProvider.displayOrRequestFocus(groupChat)); splitPane = new SplitPane(globalConfig, SplitPane.Orientation.HORIZONTAL); @@ -212,7 +210,7 @@ public PopupType getNormalPopupType() { @Override public void addCustomPopupItems(final JPopupMenu popupMenu) { - if (channel.getConnection().get().getState() == ServerState.CONNECTED) { + if (groupChat.getConnection().get().getState() == ServerState.CONNECTED) { settingsMI.setEnabled(true); } else { settingsMI.setEnabled(false); @@ -228,7 +226,7 @@ public void addCustomPopupItems(final JPopupMenu popupMenu) { public void windowClosing(final FrameClosingEvent event) { saveSplitPanePosition(); topicBar.close(); - dialogProvider.dispose(channel); + dialogProvider.dispose(groupChat); super.windowClosing(event); } diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrameFactory.java b/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrameFactory.java index 3aae9e998..a4ebcf310 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrameFactory.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrameFactory.java @@ -22,7 +22,6 @@ package com.dmdirc.addons.ui_swing.components.frames; -import com.dmdirc.Channel; import com.dmdirc.DMDircMBassador; import com.dmdirc.FrameContainer; import com.dmdirc.addons.ui_swing.SwingController; @@ -31,6 +30,7 @@ import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputField; import com.dmdirc.addons.ui_swing.dialogs.channelsetting.ChannelSettingsDialog; import com.dmdirc.addons.ui_swing.injection.KeyedDialogProvider; +import com.dmdirc.interfaces.GroupChat; import com.dmdirc.interfaces.config.IdentityFactory; import com.dmdirc.plugins.PluginDomain; import com.dmdirc.ui.core.components.WindowComponent; @@ -56,7 +56,7 @@ public class ChannelFrameFactory implements SwingWindowFactory.WindowProvider { private final Provider inputFieldProvider; private final IdentityFactory identityFactory; private final InputTextFramePasteActionFactory inputTextFramePasteActionFactory; - private final Provider> dialogProvider; + private final Provider> dialogProvider; private final TopicBarFactory topicBarFactory; private final DMDircMBassador eventBus; @@ -68,7 +68,7 @@ public ChannelFrameFactory( final Provider inputFieldProvider, final InputTextFramePasteActionFactory inputTextFramePasteActionFactory, final IdentityFactory identityFactory, - final Provider> dialogProvider, + final Provider> dialogProvider, final TopicBarFactory topicBarFactory) { this.eventBus = eventBus; this.domain = domain; @@ -84,7 +84,8 @@ public ChannelFrameFactory( public TextFrame getWindow(final FrameContainer container) { final ChannelFrame frame = new ChannelFrame(domain, dependencies.get(), inputFieldProvider, identityFactory, dialogProvider.get(), inputTextFramePasteActionFactory, - topicBarFactory, (Channel) container); + topicBarFactory, (GroupChat) container); + // TODO: Can't assume containers are GroupChats... eventBus.subscribe(frame); return frame; } diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/components/menubar/ChannelMenu.java b/ui_swing/src/com/dmdirc/addons/ui_swing/components/menubar/ChannelMenu.java index 54148d3ef..2f6d0d7e8 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/components/menubar/ChannelMenu.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/components/menubar/ChannelMenu.java @@ -22,7 +22,6 @@ package com.dmdirc.addons.ui_swing.components.menubar; -import com.dmdirc.Channel; import com.dmdirc.FrameContainer; import com.dmdirc.ServerState; import com.dmdirc.addons.ui_swing.MainFrame; @@ -34,6 +33,7 @@ import com.dmdirc.addons.ui_swing.injection.KeyedDialogProvider; import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager; import com.dmdirc.interfaces.Connection; +import com.dmdirc.interfaces.GroupChat; import com.dmdirc.parser.common.ChannelJoinRequest; import com.dmdirc.addons.ui_swing.components.IconManager; @@ -60,7 +60,7 @@ public class ChannelMenu extends JMenu implements MenuListener { /** Main frame. */ private final MainFrame mainFrame; /** Dialog provider. */ - private final KeyedDialogProvider dialogProvider; + private final KeyedDialogProvider dialogProvider; /** Channel list dialog provider. */ private final DialogProvider channelListDialogProvider; /** Active frame manager. */ @@ -73,7 +73,7 @@ public class ChannelMenu extends JMenu implements MenuListener { @Inject public ChannelMenu( final ActiveFrameManager activeFrameManager, - final KeyedDialogProvider dialogProvider, + final KeyedDialogProvider dialogProvider, final MainFrame mainFrame, final IconManager iconManager, final DialogProvider channelListDialogProvider) { @@ -121,8 +121,9 @@ private void joinChannel() { private void showChannelSettings() { activeFrameManager.getActiveFrame().ifPresent(f -> { - if (f.getContainer() instanceof Channel) { - dialogProvider.displayOrRequestFocus((Channel) f.getContainer()); + // TODO: Can't assume containers will be group chats. + if (f.getContainer() instanceof GroupChat) { + dialogProvider.displayOrRequestFocus((GroupChat) f.getContainer()); } }); } diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/components/modes/ChannelModesPane.java b/ui_swing/src/com/dmdirc/addons/ui_swing/components/modes/ChannelModesPane.java index 20ec17846..1aaf971d0 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/components/modes/ChannelModesPane.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/components/modes/ChannelModesPane.java @@ -22,74 +22,75 @@ package com.dmdirc.addons.ui_swing.components.modes; -import com.dmdirc.Channel; -import com.dmdirc.parser.interfaces.Parser; import com.dmdirc.addons.ui_swing.components.IconManager; +import com.dmdirc.interfaces.GroupChat; +import com.dmdirc.parser.interfaces.Parser; /** Non list mode panel. */ public final class ChannelModesPane extends ModesPane { /** Serial version UID. */ private static final long serialVersionUID = 1; - /** Parent channel. */ - private final Channel channel; + /** Parent group chat. */ + private final GroupChat groupChat; /** * Creates a new instance of ChannelModesPane. * - * @param channel Parent channel + * @param groupChat Parent group chat * @param iconManager The icon manager to use */ - public ChannelModesPane(final Channel channel, final IconManager iconManager) { - super(channel.getConfigManager(), iconManager); + public ChannelModesPane(final GroupChat groupChat, final IconManager iconManager) { + super(groupChat.getWindowModel().getConfigManager(), iconManager); - this.channel = channel; + this.groupChat = groupChat; initModesPanel(); } @Override public boolean hasModeValue(final String mode) { - return channel.getWindowModel().getConfigManager().hasOptionString("server", "mode" + mode); + return groupChat.getWindowModel().getConfigManager().hasOptionString("server", + "mode" + mode); } @Override public String getModeValue(final String mode) { - return channel.getWindowModel().getConfigManager().getOption("server", "mode" + mode); + return groupChat.getWindowModel().getConfigManager().getOption("server", "mode" + mode); } @Override public boolean isModeEnabled(final String mode) { - return !channel.getWindowModel().getConfigManager().hasOptionString("server", - "enablemode" + mode) || channel.getWindowModel().getConfigManager() + return !groupChat.getWindowModel().getConfigManager().hasOptionString("server", + "enablemode" + mode) || groupChat.getWindowModel().getConfigManager() .getOptionBool("server", "enablemode" + mode); } @Override public boolean isModeSettable(final String mode) { - return channel.getConnection().get().getParser().get().isUserSettable(mode.toCharArray() + return groupChat.getConnection().get().getParser().get().isUserSettable(mode.toCharArray() [0]); } @Override public String getAvailableBooleanModes() { - return channel.getConnection().get().getParser().get().getBooleanChannelModes(); + return groupChat.getConnection().get().getParser().get().getBooleanChannelModes(); } @Override public String getOurBooleanModes() { - return channel.getChannelInfo().getModes(); + return groupChat.getModes(); } @Override public String getAllParamModes() { - final Parser parser = channel.getConnection().get().getParser().get(); + final Parser parser = groupChat.getConnection().get().getParser().get(); return parser.getParameterChannelModes() + parser.getDoubleParameterChannelModes(); } @Override public String getParamModeValue(final String mode) { - return channel.getChannelInfo().getMode(mode.charAt(0)); + return groupChat.getModeValue(mode.charAt(0)); } @Override @@ -101,12 +102,17 @@ public void alterMode(final boolean add, final String mode, } else { state = getParamModes().get(mode).getState(); } - channel.getChannelInfo().alterMode(state, mode.charAt(0), parameter); + + if (state) { + groupChat.setMode(mode.charAt(0), parameter); + } else { + groupChat.removeMode(mode.charAt(0), parameter); + } } @Override public void flushModes() { - channel.getChannelInfo().flushModes(); + groupChat.flushModes(); } } diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelListModesPane.java b/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelListModesPane.java index 0384540b3..40993a1ad 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelListModesPane.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelListModesPane.java @@ -22,15 +22,15 @@ package com.dmdirc.addons.ui_swing.dialogs.channelsetting; -import com.dmdirc.Channel; import com.dmdirc.addons.ui_swing.UIUtilities; +import com.dmdirc.addons.ui_swing.components.IconManager; import com.dmdirc.addons.ui_swing.components.renderers.ListModeCellRenderer; import com.dmdirc.addons.ui_swing.dialogs.StandardInputDialog; +import com.dmdirc.interfaces.GroupChat; import com.dmdirc.interfaces.config.AggregateConfigProvider; import com.dmdirc.interfaces.config.ConfigChangeListener; import com.dmdirc.interfaces.config.ConfigProvider; import com.dmdirc.parser.common.ChannelListModeItem; -import com.dmdirc.addons.ui_swing.components.IconManager; import com.dmdirc.util.collections.MapList; import com.dmdirc.util.validators.NotEmptyValidator; @@ -70,8 +70,8 @@ public final class ChannelListModesPane extends JPanel implements ActionListener /** A version number for this class. */ private static final long serialVersionUID = 5; - /** Channel. */ - private final Channel channel; + /** Group chat. */ + private final GroupChat groupChat; /** Combox box used to switch between list modes. */ private final JComboBox listModesMenu; /** Arraylist of jpanels containing the listmodes. */ @@ -111,33 +111,34 @@ public final class ChannelListModesPane extends JPanel implements ActionListener * @param globalConfig The config to read settings from. * @param userConfig The config to write settings to. * @param iconManager The manager to use to retrieve icons for dialogs and validation. - * @param channel Parent channel + * @param groupChat Parent group chat * @param parentWindow Parent window */ public ChannelListModesPane( final AggregateConfigProvider globalConfig, final ConfigProvider userConfig, final IconManager iconManager, - final Channel channel, + final GroupChat groupChat, final Window parentWindow) { this.globalConfig = checkNotNull(globalConfig); this.userConfig = checkNotNull(userConfig); this.iconManager = checkNotNull(iconManager); - this.channel = checkNotNull(channel); + this.groupChat = checkNotNull(groupChat); this.parentWindow = checkNotNull(parentWindow); setOpaque(UIUtilities.getTabbedPaneOpaque()); list = new JList<>(); nativeRenderer = list.getCellRenderer(); - if (channel.getConfigManager().getOptionBool("general", "extendedListModes")) { + if (groupChat.getWindowModel().getConfigManager() + .getOptionBool("general", "extendedListModes")) { renderer = new ExtendedListModeCellRenderer(); } else { renderer = new ListModeCellRenderer(nativeRenderer); } listModesPanel = new JScrollPane(); listModesPanels = new ArrayList<>(); - listModesArray = channel.getConnection().get().getParser().get() + listModesArray = groupChat.getConnection().get().getParser().get() .getListChannelModes().toCharArray(); existingListItems = new MapList<>(); listModesMenu = new JComboBox<>(new DefaultComboBoxModel<>()); @@ -145,8 +146,8 @@ public ChannelListModesPane( removeListModeButton = new JButton("Remove"); removeListModeButton.setEnabled(false); modeCount = new JLabel(); - toggle = new JCheckBox("Show extended information", - channel.getConfigManager().getOptionBool("general", "extendedListModes")); + toggle = new JCheckBox("Show extended information", groupChat.getWindowModel() + .getConfigManager().getOptionBool("general", "extendedListModes")); toggle.setOpaque(UIUtilities.getTabbedPaneOpaque()); initListModesPanel(); @@ -157,13 +158,13 @@ public ChannelListModesPane( public void update() { existingListItems.clear(); - if (channel.getChannelInfo() == null) { + if (!groupChat.isOnChannel()) { return; } + for (int i = 0; i < listModesArray.length; i++) { final char mode = listModesArray[i]; - final Collection listItems = channel - .getChannelInfo().getListMode(mode); + final Collection listItems = groupChat.getListModeItems(mode); if (listItems == null) { continue; } @@ -191,8 +192,9 @@ private void updateMenu() { getModel(); for (char mode : listModesArray) { String modeText = mode + " list"; - if (channel.getConfigManager().hasOptionString("server", "mode" + mode)) { - modeText = channel.getConfigManager().getOption("server", + if (groupChat.getWindowModel().getConfigManager() + .hasOptionString("server", "mode" + mode)) { + modeText = groupChat.getWindowModel().getConfigManager().getOption("server", "mode" + mode) + " list [+" + mode + ']'; } model.addElement(modeText); @@ -236,7 +238,8 @@ private void initListeners() { removeListModeButton.addActionListener(this); listModesMenu.addActionListener(this); toggle.addActionListener(this); - channel.getConfigManager().addChangeListener("general", "extendedListModes", this); + groupChat.getWindowModel().getConfigManager() + .addChangeListener("general", "extendedListModes", this); } @@ -266,15 +269,15 @@ public void save() { if (currentModes.containsKey(entry.getKey())) { currentModes.remove(entry.getKey()); } else { - channel.getChannelInfo().alterMode(true, entry.getValue(), entry.getKey().getItem()); + groupChat.setMode(entry.getValue(), entry.getKey().getItem()); } } for (Entry entry : currentModes.entrySet()) { - channel.getChannelInfo().alterMode(false, entry.getValue(), entry.getKey().getItem()); + groupChat.removeMode(entry.getValue(), entry.getKey().getItem()); } - channel.getChannelInfo().flushModes(); + groupChat.flushModes(); userConfig.setOption("general", "extendedListModes", toggle.isSelected()); } @@ -282,9 +285,9 @@ public void save() { private void addListMode() { final int selectedIndex = listModesMenu.getSelectedIndex(); String modeText = String.valueOf(listModesArray[selectedIndex]); - if (channel.getConfigManager().hasOptionString("server", "mode" + if (groupChat.getWindowModel().getConfigManager().hasOptionString("server", "mode" + listModesArray[selectedIndex])) { - modeText = channel.getConfigManager(). + modeText = groupChat.getWindowModel().getConfigManager(). getOption("server", "mode" + listModesArray[selectedIndex]); } new StandardInputDialog(parentWindow, ModalityType.DOCUMENT_MODAL, @@ -354,7 +357,7 @@ private void updateModeCount() { final int selected = listModesMenu.getSelectedIndex(); final int current = listModesPanels.get(selected).getModel().getSize(); - final int maxModes = channel.getConnection().get().getParser().get(). + final int maxModes = groupChat.getConnection().get().getParser().get(). getMaxListModes(listModesArray[selected]); if (maxModes == -1) { diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java b/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java index 51037806f..5849c6d09 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/ChannelSettingsDialog.java @@ -22,21 +22,21 @@ package com.dmdirc.addons.ui_swing.dialogs.channelsetting; -import com.dmdirc.Channel; import com.dmdirc.DMDircMBassador; import com.dmdirc.addons.ui_swing.PrefsComponentFactory; import com.dmdirc.addons.ui_swing.SwingWindowFactory; import com.dmdirc.addons.ui_swing.UIUtilities; +import com.dmdirc.addons.ui_swing.components.IconManager; import com.dmdirc.addons.ui_swing.components.expandingsettings.SettingsPanel; import com.dmdirc.addons.ui_swing.components.modes.ChannelModesPane; import com.dmdirc.addons.ui_swing.dialogs.StandardDialog; import com.dmdirc.config.prefs.PreferencesManager; import com.dmdirc.interfaces.CommandController; +import com.dmdirc.interfaces.GroupChat; import com.dmdirc.interfaces.config.ConfigProvider; import com.dmdirc.interfaces.config.IdentityFactory; import com.dmdirc.interfaces.ui.InputWindow; import com.dmdirc.plugins.ServiceManager; -import com.dmdirc.addons.ui_swing.components.IconManager; import com.dmdirc.ui.input.TabCompleterUtils; import com.dmdirc.ui.messages.ColourManagerFactory; @@ -62,7 +62,7 @@ public class ChannelSettingsDialog extends StandardDialog implements ActionListe /** Serial version UID. */ private static final long serialVersionUID = 8; /** The channel object that this dialog belongs to. */ - private final Channel channel; + private final GroupChat channel; /** Channel identity file. */ private final ConfigProvider identity; /** Channel window. */ @@ -104,7 +104,7 @@ public class ChannelSettingsDialog extends StandardDialog implements ActionListe * @param serviceManager Service manager * @param preferencesManager Preferences Manager * @param compFactory Preferences setting component factory - * @param channel The channel object that we're editing settings for + * @param groupChat The group chat object that we're editing settings for * @param parentWindow Parent window * @param clipboard Clipboard to copy and paste from * @param commandController The controller to use to retrieve command information. @@ -117,7 +117,7 @@ public ChannelSettingsDialog( final ServiceManager serviceManager, final PreferencesManager preferencesManager, final PrefsComponentFactory compFactory, - final Channel channel, + final GroupChat groupChat, final Window parentWindow, final Clipboard clipboard, final CommandController commandController, @@ -131,17 +131,16 @@ public ChannelSettingsDialog( this.serviceManager = checkNotNull(serviceManager); this.preferencesManager = checkNotNull(preferencesManager); this.compFactory = checkNotNull(compFactory); - this.channel = checkNotNull(channel); + this.channel = checkNotNull(groupChat); this.clipboard = clipboard; this.commandController = checkNotNull(commandController); this.eventBus = eventBus; this.colourManagerFactory = colourManagerFactory; this.iconManager = iconManager; - identity = identityFactory.createChannelConfig( - channel.getConnection().get().getNetwork(), - channel.getChannelInfo().getName()); - channelWindow = (InputWindow) windowFactory.getSwingWindow(channel); + identity = identityFactory.createChannelConfig(groupChat.getConnection().get().getNetwork(), + groupChat.getName()); + channelWindow = (InputWindow) windowFactory.getSwingWindow(groupChat.getWindowModel()); initComponents(tabCompleterUtils); initListeners(); diff --git a/ui_swing/src/com/dmdirc/addons/ui_swing/injection/DialogModule.java b/ui_swing/src/com/dmdirc/addons/ui_swing/injection/DialogModule.java index 26714ce14..80efc85f8 100644 --- a/ui_swing/src/com/dmdirc/addons/ui_swing/injection/DialogModule.java +++ b/ui_swing/src/com/dmdirc/addons/ui_swing/injection/DialogModule.java @@ -22,7 +22,6 @@ package com.dmdirc.addons.ui_swing.injection; -import com.dmdirc.Channel; import com.dmdirc.ClientModule.UserConfig; import com.dmdirc.DMDircMBassador; import com.dmdirc.addons.ui_swing.MainFrame; @@ -44,6 +43,7 @@ import com.dmdirc.config.prefs.PreferencesManager; import com.dmdirc.interfaces.CommandController; import com.dmdirc.interfaces.Connection; +import com.dmdirc.interfaces.GroupChat; import com.dmdirc.interfaces.LifecycleController; import com.dmdirc.interfaces.config.ConfigProvider; import com.dmdirc.interfaces.config.IdentityFactory; @@ -186,7 +186,7 @@ protected ServerSettingsDialog getInstance(final Connection key) { @Provides @Singleton - public KeyedDialogProvider getChannelSettingsDialogProvider( + public KeyedDialogProvider getChannelSettingsDialogProvider( final IdentityFactory identityFactory, final SwingWindowFactory windowFactory, @UserConfig final ConfigProvider userConfig, @@ -200,9 +200,9 @@ public KeyedDialogProvider getChannelSettingsDia final ColourManagerFactory colourManagerFactory, final TabCompleterUtils tabCompleterUtils, final IconManager iconManager) { - return new KeyedDialogProvider() { + return new KeyedDialogProvider() { @Override - protected ChannelSettingsDialog getInstance(final Channel key) { + protected ChannelSettingsDialog getInstance(final GroupChat key) { return new ChannelSettingsDialog(identityFactory, windowFactory, userConfig, serviceManager, preferencesManager, compFactory, key, parentWindow, clipboard, commandController, eventBus,