|
@@ -199,6 +199,9 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
|
199
|
199
|
/** The config provider to write user settings to. */
|
200
|
200
|
private final ConfigProvider userSettings;
|
201
|
201
|
|
|
202
|
+ /** The manager to use to add status bar messages. */
|
|
203
|
+ private final StatusBarManager statusBarManager;
|
|
204
|
+
|
202
|
205
|
/**
|
203
|
206
|
* Creates a new server which will connect to the specified URL with
|
204
|
207
|
* the specified profile.
|
|
@@ -211,6 +214,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
|
211
|
214
|
* @param tabCompleterFactory The factory to use for tab completers.
|
212
|
215
|
* @param identityFactory The factory to use to create identities.
|
213
|
216
|
* @param messageSinkManager The sink manager to use to despatch messages.
|
|
217
|
+ * @param statusBarManager The manager to use to add status bar messages.
|
214
|
218
|
* @param windowManager Window Manager
|
215
|
219
|
* @param channelFactory The factory to use to create channels.
|
216
|
220
|
* @param queryFactory The factory to use to create queries.
|
|
@@ -227,6 +231,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
|
227
|
231
|
final TabCompleterFactory tabCompleterFactory,
|
228
|
232
|
final IdentityFactory identityFactory,
|
229
|
233
|
final MessageSinkManager messageSinkManager,
|
|
234
|
+ final StatusBarManager statusBarManager,
|
230
|
235
|
final WindowManager windowManager,
|
231
|
236
|
final ChannelFactory channelFactory,
|
232
|
237
|
final QueryFactory queryFactory,
|
|
@@ -254,6 +259,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
|
254
|
259
|
this.queryFactory = queryFactory;
|
255
|
260
|
this.rawFactory = rawFactory;
|
256
|
261
|
this.userSettings = userSettings;
|
|
262
|
+ this.statusBarManager = statusBarManager;
|
257
|
263
|
|
258
|
264
|
setConnectionDetails(uri, profile);
|
259
|
265
|
|
|
@@ -1420,7 +1426,7 @@ public class Server extends WritableFrameContainer implements ConfigChangeListen
|
1420
|
1426
|
* Called when we fail to receive a ping reply within a set period of time.
|
1421
|
1427
|
*/
|
1422
|
1428
|
public void onPingFailed() {
|
1423
|
|
- StatusBarManager.getStatusBarManager().setMessage(new StatusMessage(
|
|
1429
|
+ statusBarManager.setMessage(new StatusMessage(
|
1424
|
1430
|
"No ping reply from " + getName() + " for over "
|
1425
|
1431
|
+ ((int) (Math.floor(parser.getPingTime() / 1000.0)))
|
1426
|
1432
|
+ " seconds.", getConfigManager()));
|