|
@@ -22,7 +22,6 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.addons.ui_swing.components;
|
24
|
24
|
|
25
|
|
-import com.dmdirc.Channel;
|
26
|
25
|
import com.dmdirc.DMDircMBassador;
|
27
|
26
|
import com.dmdirc.Topic;
|
28
|
27
|
import com.dmdirc.addons.ui_swing.EdtHandlerInvocation;
|
|
@@ -36,6 +35,7 @@ import com.dmdirc.addons.ui_swing.textpane.StyledDocumentMaker;
|
36
|
35
|
import com.dmdirc.events.ChannelTopicChangeEvent;
|
37
|
36
|
import com.dmdirc.events.ChannelTopicUnsetEvent;
|
38
|
37
|
import com.dmdirc.interfaces.CommandController;
|
|
38
|
+import com.dmdirc.interfaces.GroupChat;
|
39
|
39
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
40
|
40
|
import com.dmdirc.interfaces.config.ConfigChangeListener;
|
41
|
41
|
import com.dmdirc.plugins.PluginManager;
|
|
@@ -91,7 +91,7 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
91
|
91
|
/** The window this topic bar is for. */
|
92
|
92
|
private final ChannelFrame window;
|
93
|
93
|
/** Associated channel. */
|
94
|
|
- private final Channel channel;
|
|
94
|
+ private final GroupChat channel;
|
95
|
95
|
/** the maximum length allowed for a topic. */
|
96
|
96
|
private final int topicLengthMax;
|
97
|
97
|
/** The config domain to read settings from. */
|
|
@@ -134,7 +134,7 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
134
|
134
|
final PluginManager pluginManager,
|
135
|
135
|
final Clipboard clipboard,
|
136
|
136
|
final CommandController commandController,
|
137
|
|
- final Channel channel,
|
|
137
|
+ final GroupChat channel,
|
138
|
138
|
final ChannelFrame window,
|
139
|
139
|
final IconManager iconManager,
|
140
|
140
|
final TabCompleterUtils tabCompleterUtils,
|
|
@@ -161,10 +161,11 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
161
|
161
|
iconManager.getIcon("close-active"));
|
162
|
162
|
|
163
|
163
|
final SwingInputHandler handler = new SwingInputHandler(
|
164
|
|
- pluginManager, topicText, commandController, channel.getCommandParser(),
|
165
|
|
- channel, tabCompleterUtils, channel.getEventBus());
|
|
164
|
+ pluginManager, topicText, commandController,
|
|
165
|
+ channel.getWindowModel().getCommandParser(),
|
|
166
|
+ channel.getWindowModel(), tabCompleterUtils, channel.getEventBus());
|
166
|
167
|
handler.setTypes(true, false, true, false);
|
167
|
|
- handler.setTabCompleter(channel.getTabCompleter());
|
|
168
|
+ handler.setTabCompleter(channel.getWindowModel().getTabCompleter());
|
168
|
169
|
|
169
|
170
|
final JScrollPane sp = new JScrollPane(topicText);
|
170
|
171
|
sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
|
@@ -238,13 +239,13 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
238
|
239
|
topicChanged(event.getChannel(), null);
|
239
|
240
|
}
|
240
|
241
|
|
241
|
|
- private void topicChanged(final Channel channel, final Topic topic) {
|
|
242
|
+ private void topicChanged(final GroupChat channel, final Topic topic) {
|
242
|
243
|
if (topicText.isEditable()) {
|
243
|
244
|
return;
|
244
|
245
|
}
|
245
|
246
|
topicText.setText("");
|
246
|
247
|
if (topic != null) {
|
247
|
|
- channel.getBackBuffer().getStyliser().addStyledString(
|
|
248
|
+ channel.getWindowModel().getBackBuffer().getStyliser().addStyledString(
|
248
|
249
|
new StyledDocumentMaker((StyledDocument) topicText.getDocument(), as),
|
249
|
250
|
Styliser.CODE_HEXCOLOUR
|
250
|
251
|
+ UIUtilities.getHex(foregroundColour)
|
|
@@ -342,13 +343,12 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
342
|
343
|
*/
|
343
|
344
|
private void setColours() {
|
344
|
345
|
backgroundColour = UIUtilities.convertColour(
|
345
|
|
- colourManager.getColourFromString(
|
346
|
|
- channel.getConfigManager().getOptionString(
|
347
|
|
- "ui", "inputbackgroundcolour",
|
348
|
|
- "ui", "backgroundcolour"), null));
|
|
346
|
+ colourManager.getColourFromString(channel.getWindowModel().getConfigManager()
|
|
347
|
+ .getOptionString("ui", "inputbackgroundcolour", "ui",
|
|
348
|
+ "backgroundcolour"), null));
|
349
|
349
|
foregroundColour = UIUtilities.convertColour(
|
350
|
350
|
colourManager.getColourFromString(
|
351
|
|
- channel.getConfigManager().getOptionString(
|
|
351
|
+ channel.getWindowModel().getConfigManager().getOptionString(
|
352
|
352
|
"ui", "inputforegroundcolour",
|
353
|
353
|
"ui", "foregroundcolour"), null));
|
354
|
354
|
setBackground(backgroundColour);
|
|
@@ -433,9 +433,12 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
433
|
433
|
}
|
434
|
434
|
|
435
|
435
|
private void updateOptions() {
|
436
|
|
- showFull = channel.getConfigManager().getOptionBool(domain, "showfulltopic");
|
437
|
|
- hideEmpty = channel.getConfigManager().getOptionBool(domain, "hideEmptyTopicBar");
|
438
|
|
- showBar = channel.getConfigManager().getOptionBool(domain, "showtopicbar");
|
|
436
|
+ showFull = channel.getWindowModel().getConfigManager()
|
|
437
|
+ .getOptionBool(domain, "showfulltopic");
|
|
438
|
+ hideEmpty = channel.getWindowModel().getConfigManager()
|
|
439
|
+ .getOptionBool(domain, "hideEmptyTopicBar");
|
|
440
|
+ showBar = channel.getWindowModel().getConfigManager()
|
|
441
|
+ .getOptionBool(domain, "showtopicbar");
|
439
|
442
|
}
|
440
|
443
|
|
441
|
444
|
/**
|