|
@@ -25,11 +25,9 @@ package com.dmdirc.addons.lagdisplay;
|
25
|
25
|
import com.dmdirc.ClientModule.GlobalConfig;
|
26
|
26
|
import com.dmdirc.DMDircMBassador;
|
27
|
27
|
import com.dmdirc.FrameContainer;
|
28
|
|
-import com.dmdirc.Server;
|
29
|
28
|
import com.dmdirc.ServerState;
|
30
|
29
|
import com.dmdirc.addons.ui_swing.SelectionListener;
|
31
|
30
|
import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
|
32
|
|
-import com.dmdirc.addons.ui_swing.components.statusbar.SwingStatusBar;
|
33
|
31
|
import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
|
34
|
32
|
import com.dmdirc.events.ServerDisconnectedEvent;
|
35
|
33
|
import com.dmdirc.events.ServerGotpingEvent;
|
|
@@ -65,8 +63,6 @@ public class LagDisplayManager implements ConfigChangeListener, SelectionListene
|
65
|
63
|
private final DMDircMBassador eventBus;
|
66
|
64
|
/** Active frame manager. */
|
67
|
65
|
private final ActiveFrameManager activeFrameManager;
|
68
|
|
- /** Status bar to add panels to. */
|
69
|
|
- private final SwingStatusBar statusBar;
|
70
|
66
|
private final Provider<LagDisplayPanel> panelProvider;
|
71
|
67
|
/** The settings domain to use. */
|
72
|
68
|
private final String domain;
|
|
@@ -86,16 +82,13 @@ public class LagDisplayManager implements ConfigChangeListener, SelectionListene
|
86
|
82
|
private LagDisplayPanel panel;
|
87
|
83
|
|
88
|
84
|
@Inject
|
89
|
|
- public LagDisplayManager(
|
90
|
|
- final DMDircMBassador eventBus,
|
|
85
|
+ public LagDisplayManager(final DMDircMBassador eventBus,
|
91
|
86
|
final ActiveFrameManager activeFrameManager,
|
92
|
|
- final SwingStatusBar statusBar,
|
93
|
87
|
final Provider<LagDisplayPanel> panelProvider,
|
94
|
88
|
@PluginDomain(LagDisplayPlugin.class) final String domain,
|
95
|
89
|
@GlobalConfig final AggregateConfigProvider globalConfig) {
|
96
|
90
|
this.eventBus = eventBus;
|
97
|
91
|
this.activeFrameManager = activeFrameManager;
|
98
|
|
- this.statusBar = statusBar;
|
99
|
92
|
this.panelProvider = panelProvider;
|
100
|
93
|
this.domain = domain;
|
101
|
94
|
this.globalConfig = globalConfig;
|
|
@@ -177,7 +170,7 @@ public class LagDisplayManager implements ConfigChangeListener, SelectionListene
|
177
|
170
|
if (event.getNumeric() != 421) {
|
178
|
171
|
return;
|
179
|
172
|
}
|
180
|
|
- final boolean useAlternate = ((Server) event.getConnection()).getConfigManager()
|
|
173
|
+ final boolean useAlternate = ((FrameContainer) event.getConnection()).getConfigManager()
|
181
|
174
|
.getOptionBool(domain, "usealternate");
|
182
|
175
|
final TextFrame activeFrame = activeFrameManager.getActiveFrame();
|
183
|
176
|
final FrameContainer active = activeFrame == null ? null : activeFrame.getContainer();
|
|
@@ -230,7 +223,7 @@ public class LagDisplayManager implements ConfigChangeListener, SelectionListene
|
230
|
223
|
final String value = formatTime(event.getPing());
|
231
|
224
|
|
232
|
225
|
getHistory(event.getConnection()).add(event.getPing());
|
233
|
|
- pings.put((event.getConnection()), value);
|
|
226
|
+ pings.put(event.getConnection(), value);
|
234
|
227
|
|
235
|
228
|
if (isActive) {
|
236
|
229
|
panel.getComponent().setText(value);
|
|
@@ -249,7 +242,7 @@ public class LagDisplayManager implements ConfigChangeListener, SelectionListene
|
249
|
242
|
final FrameContainer active = activeFrame == null ? null : activeFrame.getContainer();
|
250
|
243
|
final boolean isActive = active != null && event.getConnection().equals(active.
|
251
|
244
|
getConnection());
|
252
|
|
- final String value = formatTime(event.getPing()) + "+";
|
|
245
|
+ final String value = formatTime(event.getPing()) + '+';
|
253
|
246
|
|
254
|
247
|
pings.put(event.getConnection(), value);
|
255
|
248
|
|