Merge lp:~kvalo/indicator-network/libconnman-control-technology into lp:~indicator-applet-developers/indicator-network/indicator-network
- libconnman-control-technology
- Merge into indicator-network
Proposed by
Kalle Valo
Status: | Merged |
---|---|
Merged at revision: | 152 |
Proposed branch: | lp:~kvalo/indicator-network/libconnman-control-technology |
Merge into: | lp:~indicator-applet-developers/indicator-network/indicator-network |
Diff against target: |
534 lines (+361/-8) 5 files modified
src/libconnman/Connman-1.0.vapi (+15/-0) src/libconnman/connman-manager.c (+236/-8) src/libconnman/connman-manager.h (+26/-0) src/libconnman/connman.h (+1/-0) tests/libconnman-vala/libconnman-vala.vala (+83/-0) |
To merge this branch: | bzr merge lp:~kvalo/indicator-network/libconnman-control-technology |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mikkel Kamstrup Erlandsen (community) | Approve | ||
Review via email: mp+50750@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/libconnman/Connman-1.0.vapi' |
2 | --- src/libconnman/Connman-1.0.vapi 2011-02-21 15:25:04 +0000 |
3 | +++ src/libconnman/Connman-1.0.vapi 2011-02-22 14:03:59 +0000 |
4 | @@ -26,6 +26,8 @@ |
5 | [CCode (has_construct_function = false)] |
6 | public Manager (); |
7 | public async void connect_service (Connman.ServiceType type, Connman.ServiceMode mode, Connman.ServiceSecurity security, [CCode (array_length = false)] uint8[] ssid, uint ssid_len, GLib.Cancellable? cancellable) throws GLib.Error; |
8 | + public async void disable_technology (Connman.TechnologyType type, GLib.Cancellable? cancellable) throws GLib.Error; |
9 | + public async void enable_technology (Connman.TechnologyType type, GLib.Cancellable? cancellable) throws GLib.Error; |
10 | public Connman.Service get_default_service (); |
11 | [CCode (array_length = false, array_null_terminated = true)] |
12 | public unowned Connman.Service[] get_services (); |
13 | @@ -34,8 +36,11 @@ |
14 | public Connman.TechnologyState get_cellular_state (); |
15 | public Connman.TechnologyState get_ethernet_state (); |
16 | public Connman.TechnologyState get_wifi_state (); |
17 | + public bool get_offline_mode (); |
18 | + public void set_offline_mode (bool mode); |
19 | public bool get_connected (); |
20 | public bool connected { get; } |
21 | + public bool offline_mode { get; set; } |
22 | public Connman.Service default_service { get; } |
23 | public signal void service_added (Connman.Service object); |
24 | public signal void service_removed (string object); |
25 | @@ -166,6 +171,14 @@ |
26 | ENABLED, |
27 | CONNECTED |
28 | } |
29 | + [CCode (cprefix = "CONNMAN_TECHNOLOGY_TYPE_", cheader_filename = "connman-manager.h")] |
30 | + public enum TechnologyType { |
31 | + UNKNOWN, |
32 | + ETHERNET, |
33 | + WIFI, |
34 | + BLUETOOTH, |
35 | + CELLULAR |
36 | + } |
37 | [CCode (cheader_filename = "connman-service.h")] |
38 | public const string MANAGER_PATH; |
39 | [CCode (cheader_filename = "connman-service.h")] |
40 | @@ -179,6 +192,8 @@ |
41 | [CCode (cheader_filename = "connman-service.h")] |
42 | public const string PROPERTY_NAME; |
43 | [CCode (cheader_filename = "connman-service.h")] |
44 | + public const string PROPERTY_OFFLINE_MODE; |
45 | + [CCode (cheader_filename = "connman-service.h")] |
46 | public const string PROPERTY_PASSPHRASE; |
47 | [CCode (cheader_filename = "connman-service.h")] |
48 | public const string PROPERTY_SECURITY; |
49 | |
50 | === modified file 'src/libconnman/connman-manager.c' |
51 | --- src/libconnman/connman-manager.c 2011-02-21 16:00:36 +0000 |
52 | +++ src/libconnman/connman-manager.c 2011-02-22 14:03:59 +0000 |
53 | @@ -67,16 +67,10 @@ |
54 | ConnmanTechnologyState ethernet_state; |
55 | ConnmanTechnologyState cellular_state; |
56 | ConnmanTechnologyState bluetooth_state; |
57 | + |
58 | + gboolean offline_mode; |
59 | }; |
60 | |
61 | -typedef enum { |
62 | - CONNMAN_TECHNOLOGY_TYPE_UNKNOWN, |
63 | - CONNMAN_TECHNOLOGY_TYPE_ETHERNET, |
64 | - CONNMAN_TECHNOLOGY_TYPE_WIFI, |
65 | - CONNMAN_TECHNOLOGY_TYPE_BLUETOOTH, |
66 | - CONNMAN_TECHNOLOGY_TYPE_CELLULAR, |
67 | -} ConnmanTechnologyType; |
68 | - |
69 | struct technology_type_string |
70 | { |
71 | const gchar *str; |
72 | @@ -128,8 +122,145 @@ |
73 | PROP_ETHERNET_STATE, |
74 | PROP_CELLULAR_STATE, |
75 | PROP_BLUETOOTH_STATE, |
76 | + PROP_OFFLINE_MODE, |
77 | }; |
78 | |
79 | +static const gchar *technology_type2str(ConnmanTechnologyType type) |
80 | +{ |
81 | + const struct technology_type_string *s; |
82 | + guint i; |
83 | + |
84 | + for (i = 0; i < G_N_ELEMENTS(technology_type_map); i++) { |
85 | + s = &technology_type_map[i]; |
86 | + if (s->type == type) |
87 | + return s->str; |
88 | + } |
89 | + |
90 | + g_warning("%s(): unknown technology type %d", __func__, type); |
91 | + |
92 | + return "unknown"; |
93 | +} |
94 | + |
95 | +static void enable_technology_cb(GObject *object, GAsyncResult *res, |
96 | + gpointer user_data) |
97 | +{ |
98 | + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(user_data); |
99 | + GDBusProxy *proxy = G_DBUS_PROXY(object); |
100 | + GError *error = NULL; |
101 | + |
102 | + g_dbus_proxy_call_finish(proxy, res, &error); |
103 | + |
104 | + if (error != NULL) { |
105 | + g_simple_async_result_set_from_error(simple, error); |
106 | + g_error_free(error); |
107 | + goto out; |
108 | + } |
109 | + |
110 | + out: |
111 | + g_simple_async_result_complete(simple); |
112 | + g_object_unref(simple); |
113 | +} |
114 | + |
115 | +void connman_manager_enable_technology(ConnmanManager *self, |
116 | + ConnmanTechnologyType type, |
117 | + GCancellable *cancellable, |
118 | + GAsyncReadyCallback callback, |
119 | + gpointer user_data) |
120 | +{ |
121 | + ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
122 | + GSimpleAsyncResult *simple; |
123 | + GVariant *parameters; |
124 | + const gchar *s; |
125 | + |
126 | + g_return_if_fail(CONNMAN_IS_MANAGER(self)); |
127 | + g_return_if_fail(priv != NULL); |
128 | + |
129 | + simple = g_simple_async_result_new(G_OBJECT(self), callback, |
130 | + user_data, |
131 | + connman_manager_enable_technology); |
132 | + |
133 | + s = technology_type2str(type); |
134 | + parameters = g_variant_new("(s)", s); |
135 | + |
136 | + /* FIXME: cancel the call on dispose */ |
137 | + g_dbus_proxy_call(priv->proxy, "EnableTechnology", parameters, |
138 | + G_DBUS_CALL_FLAGS_NONE, CONNECT_TIMEOUT, cancellable, |
139 | + enable_technology_cb, simple); |
140 | +} |
141 | + |
142 | +void connman_manager_enable_technology_finish(ConnmanManager *self, |
143 | + GAsyncResult *res, |
144 | + GError **error) |
145 | +{ |
146 | + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(res); |
147 | + |
148 | + g_return_if_fail(CONNMAN_IS_MANAGER(self)); |
149 | + g_return_if_fail(g_simple_async_result_get_source_tag(simple) == |
150 | + connman_manager_enable_technology); |
151 | + |
152 | + g_simple_async_result_propagate_error(simple, error); |
153 | +} |
154 | + |
155 | +static void disable_technology_cb(GObject *object, GAsyncResult *res, |
156 | + gpointer user_data) |
157 | +{ |
158 | + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(user_data); |
159 | + GDBusProxy *proxy = G_DBUS_PROXY(object); |
160 | + GError *error = NULL; |
161 | + |
162 | + g_dbus_proxy_call_finish(proxy, res, &error); |
163 | + |
164 | + if (error != NULL) { |
165 | + g_simple_async_result_set_from_error(simple, error); |
166 | + g_error_free(error); |
167 | + goto out; |
168 | + } |
169 | + |
170 | + out: |
171 | + g_simple_async_result_complete(simple); |
172 | + g_object_unref(simple); |
173 | +} |
174 | + |
175 | +void connman_manager_disable_technology(ConnmanManager *self, |
176 | + ConnmanTechnologyType type, |
177 | + GCancellable *cancellable, |
178 | + GAsyncReadyCallback callback, |
179 | + gpointer user_data) |
180 | +{ |
181 | + ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
182 | + GSimpleAsyncResult *simple; |
183 | + GVariant *parameters; |
184 | + const gchar *s; |
185 | + |
186 | + g_return_if_fail(CONNMAN_IS_MANAGER(self)); |
187 | + g_return_if_fail(priv != NULL); |
188 | + |
189 | + simple = g_simple_async_result_new(G_OBJECT(self), callback, |
190 | + user_data, |
191 | + connman_manager_disable_technology); |
192 | + |
193 | + s = technology_type2str(type); |
194 | + parameters = g_variant_new("(s)", s); |
195 | + |
196 | + /* FIXME: cancel the call on dispose */ |
197 | + g_dbus_proxy_call(priv->proxy, "DisableTechnology", parameters, |
198 | + G_DBUS_CALL_FLAGS_NONE, CONNECT_TIMEOUT, cancellable, |
199 | + disable_technology_cb, simple); |
200 | +} |
201 | + |
202 | +void connman_manager_disable_technology_finish(ConnmanManager *self, |
203 | + GAsyncResult *res, |
204 | + GError **error) |
205 | +{ |
206 | + GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(res); |
207 | + |
208 | + g_return_if_fail(CONNMAN_IS_MANAGER(self)); |
209 | + g_return_if_fail(g_simple_async_result_get_source_tag(simple) == |
210 | + connman_manager_disable_technology); |
211 | + |
212 | + g_simple_async_result_propagate_error(simple, error); |
213 | +} |
214 | + |
215 | static void connect_service_cb(GObject *object, GAsyncResult *res, |
216 | gpointer user_data) |
217 | { |
218 | @@ -370,6 +501,26 @@ |
219 | return priv->bluetooth_state; |
220 | } |
221 | |
222 | +gboolean connman_manager_get_offline_mode(ConnmanManager *self) |
223 | +{ |
224 | + ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
225 | + |
226 | + g_return_val_if_fail(CONNMAN_IS_MANAGER(self), FALSE); |
227 | + g_return_val_if_fail(priv != NULL, FALSE); |
228 | + |
229 | + return priv->offline_mode; |
230 | +} |
231 | + |
232 | +void connman_manager_set_offline_mode(ConnmanManager *self, gboolean mode) |
233 | +{ |
234 | + ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
235 | + |
236 | + g_return_if_fail(CONNMAN_IS_MANAGER(self)); |
237 | + g_return_if_fail(priv != NULL); |
238 | + |
239 | + g_object_set(self, "offline-mode", mode, NULL); |
240 | +} |
241 | + |
242 | static void update_default_service(ConnmanManager *self) |
243 | { |
244 | ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
245 | @@ -987,6 +1138,22 @@ |
246 | g_variant_unref(variant); |
247 | } |
248 | |
249 | +static void offline_mode_updated(ConnmanManager *self, GVariant *value) |
250 | +{ |
251 | + ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
252 | + gboolean mode; |
253 | + |
254 | + mode = g_variant_get_boolean(value); |
255 | + |
256 | + if (priv->offline_mode == mode) |
257 | + return; |
258 | + |
259 | + priv->offline_mode = mode; |
260 | + g_object_notify(G_OBJECT(self), "offline-mode"); |
261 | + |
262 | + g_variant_unref(value); |
263 | +} |
264 | + |
265 | static void update_property(ConnmanManager *self, const gchar *property, |
266 | GVariant *variant) |
267 | { |
268 | @@ -994,6 +1161,8 @@ |
269 | update_services(self, variant); |
270 | } else if (g_strcmp0(property, CONNMAN_PROPERTY_TECHNOLOGIES) == 0) { |
271 | technologies_updated(self, variant); |
272 | + } else if (g_strcmp0(property, CONNMAN_PROPERTY_OFFLINE_MODE) == 0) { |
273 | + offline_mode_updated(self, variant); |
274 | } else { |
275 | /* unknown property */ |
276 | g_variant_unref(variant); |
277 | @@ -1177,6 +1346,52 @@ |
278 | NULL); |
279 | } |
280 | |
281 | +static void set_dbus_property_cb(GObject *object, |
282 | + GAsyncResult *res, |
283 | + gpointer user_data) |
284 | +{ |
285 | + ConnmanManager *self = CONNMAN_MANAGER(user_data); |
286 | + GDBusProxy *proxy = G_DBUS_PROXY(object); |
287 | + GError *error = NULL; |
288 | + |
289 | + g_dbus_proxy_call_finish(proxy, res, &error); |
290 | + |
291 | + if (error != NULL) { |
292 | + g_warning("ConnmanManager SetProperty() failed: %s", error->message); |
293 | + g_error_free(error); |
294 | + } |
295 | + |
296 | + /* trick to avoid destroying self during async call */ |
297 | + g_object_unref(self); |
298 | +} |
299 | + |
300 | +static void set_dbus_property(ConnmanManager *self, |
301 | + const gchar *property, |
302 | + GVariant *value) |
303 | +{ |
304 | + ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
305 | + GVariant *parameters; |
306 | + |
307 | + g_return_if_fail(CONNMAN_IS_MANAGER(self)); |
308 | + g_return_if_fail(priv != NULL); |
309 | + |
310 | + parameters = g_variant_new("(sv)", property, value); |
311 | + |
312 | + g_dbus_proxy_call(priv->proxy, "SetProperty", parameters, |
313 | + G_DBUS_CALL_FLAGS_NONE, -1, NULL, |
314 | + set_dbus_property_cb, g_object_ref(self)); |
315 | +} |
316 | + |
317 | +static void update_offline_mode(ConnmanManager *self) |
318 | +{ |
319 | + ConnmanManagerPrivate *priv = GET_PRIVATE(self); |
320 | + GVariant *value; |
321 | + |
322 | + value = g_variant_new("b", priv->offline_mode); |
323 | + |
324 | + set_dbus_property(self, "OfflineMode", value); |
325 | +} |
326 | + |
327 | static void set_property(GObject *object, guint property_id, |
328 | const GValue *value, GParamSpec *pspec) |
329 | { |
330 | @@ -1204,6 +1419,10 @@ |
331 | case PROP_BLUETOOTH_STATE: |
332 | priv->bluetooth_state = g_value_get_uint(value); |
333 | break; |
334 | + case PROP_OFFLINE_MODE: |
335 | + priv->offline_mode = g_value_get_boolean(value); |
336 | + update_offline_mode(self); |
337 | + break; |
338 | default: |
339 | /* We don't have any other property... */ |
340 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); |
341 | @@ -1236,6 +1455,9 @@ |
342 | case PROP_BLUETOOTH_STATE: |
343 | g_value_set_uint(value, priv->bluetooth_state); |
344 | break; |
345 | + case PROP_OFFLINE_MODE: |
346 | + g_value_set_boolean(value, priv->offline_mode); |
347 | + break; |
348 | default: |
349 | /* We don't have any other property... */ |
350 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); |
351 | @@ -1366,6 +1588,12 @@ |
352 | CONNMAN_TECHNOLOGY_STATE_UNKNOWN, |
353 | G_PARAM_READABLE); |
354 | g_object_class_install_property(gobject_class, PROP_BLUETOOTH_STATE, pspec); |
355 | + |
356 | + pspec = g_param_spec_boolean("offline-mode", |
357 | + "ConnmanManager's offline mode property", |
358 | + "Set offline mode", FALSE, |
359 | + G_PARAM_READWRITE); |
360 | + g_object_class_install_property(gobject_class, PROP_OFFLINE_MODE, pspec); |
361 | } |
362 | |
363 | static void connman_manager_init(ConnmanManager *self) |
364 | |
365 | === modified file 'src/libconnman/connman-manager.h' |
366 | --- src/libconnman/connman-manager.h 2011-02-21 15:25:04 +0000 |
367 | +++ src/libconnman/connman-manager.h 2011-02-22 14:03:59 +0000 |
368 | @@ -54,6 +54,14 @@ |
369 | } ConnmanManagerClass; |
370 | |
371 | typedef enum { |
372 | + CONNMAN_TECHNOLOGY_TYPE_UNKNOWN, |
373 | + CONNMAN_TECHNOLOGY_TYPE_ETHERNET, |
374 | + CONNMAN_TECHNOLOGY_TYPE_WIFI, |
375 | + CONNMAN_TECHNOLOGY_TYPE_BLUETOOTH, |
376 | + CONNMAN_TECHNOLOGY_TYPE_CELLULAR, |
377 | +} ConnmanTechnologyType; |
378 | + |
379 | +typedef enum { |
380 | CONNMAN_TECHNOLOGY_STATE_UNKNOWN, |
381 | CONNMAN_TECHNOLOGY_STATE_UNAVAILABLE, |
382 | CONNMAN_TECHNOLOGY_STATE_AVAILABLE, |
383 | @@ -64,6 +72,22 @@ |
384 | |
385 | GType connman_manager_get_type(void); |
386 | |
387 | +void connman_manager_enable_technology(ConnmanManager *self, |
388 | + ConnmanTechnologyType type, |
389 | + GCancellable *cancellable, |
390 | + GAsyncReadyCallback callback, |
391 | + gpointer user_data); |
392 | +void connman_manager_enable_technology_finish(ConnmanManager *self, |
393 | + GAsyncResult *res, |
394 | + GError **error); |
395 | +void connman_manager_disable_technology(ConnmanManager *self, |
396 | + ConnmanTechnologyType type, |
397 | + GCancellable *cancellable, |
398 | + GAsyncReadyCallback callback, |
399 | + gpointer user_data); |
400 | +void connman_manager_disable_technology_finish(ConnmanManager *self, |
401 | + GAsyncResult *res, |
402 | + GError **error); |
403 | void connman_manager_connect_service(ConnmanManager *self, |
404 | ConnmanServiceType type, |
405 | ConnmanServiceMode mode, |
406 | @@ -85,6 +109,8 @@ |
407 | ConnmanTechnologyState connman_manager_get_ethernet_state(ConnmanManager *self); |
408 | ConnmanTechnologyState connman_manager_get_cellular_state(ConnmanManager *self); |
409 | ConnmanTechnologyState connman_manager_get_bluetooth_state(ConnmanManager *self); |
410 | +gboolean connman_manager_get_offline_mode(ConnmanManager *self); |
411 | +void connman_manager_set_offline_mode(ConnmanManager *self, gboolean mode); |
412 | ConnmanManager *connman_manager_new(void); |
413 | |
414 | #endif |
415 | |
416 | === modified file 'src/libconnman/connman.h' |
417 | --- src/libconnman/connman.h 2011-02-21 15:25:04 +0000 |
418 | +++ src/libconnman/connman.h 2011-02-22 14:03:59 +0000 |
419 | @@ -75,6 +75,7 @@ |
420 | #define CONNMAN_PROPERTY_IPV4 "IPv4" |
421 | #define CONNMAN_PROPERTY_IPV4_CONFIGURATION "IPv4.Configuration" |
422 | #define CONNMAN_PROPERTY_TECHNOLOGIES "Technologies" |
423 | +#define CONNMAN_PROPERTY_OFFLINE_MODE "OfflineMode" |
424 | |
425 | #define CONNMAN_TECHNOLOGY_PROPERTY_STATE "State" |
426 | #define CONNMAN_TECHNOLOGY_PROPERTY_TYPE "Type" |
427 | |
428 | === modified file 'tests/libconnman-vala/libconnman-vala.vala' |
429 | --- tests/libconnman-vala/libconnman-vala.vala 2011-02-21 16:01:54 +0000 |
430 | +++ tests/libconnman-vala/libconnman-vala.vala 2011-02-22 14:03:59 +0000 |
431 | @@ -260,6 +260,75 @@ |
432 | stdout.printf(" bluetooth %d\n", manager.get_bluetooth_state()); |
433 | } |
434 | |
435 | +static Connman.TechnologyType str2tech(string s) |
436 | +{ |
437 | + switch (s) { |
438 | + case "wifi": |
439 | + return Connman.TechnologyType.WIFI; |
440 | + case "ethernet": |
441 | + return Connman.TechnologyType.ETHERNET; |
442 | + case "cellular": |
443 | + return Connman.TechnologyType.CELLULAR; |
444 | + case "bluetooth": |
445 | + return Connman.TechnologyType.BLUETOOTH; |
446 | + default: |
447 | + stdout.printf("Unknown tech: %s\n", s); |
448 | + return Connman.TechnologyType.UNKNOWN; |
449 | + } |
450 | +} |
451 | + |
452 | +static void enable(string[] args) { |
453 | + |
454 | + if (args.length != 1) { |
455 | + stdout.printf("Invalid number of arguments for enable: %d\n", |
456 | + args.length); |
457 | + return; |
458 | + } |
459 | + |
460 | + var tech = str2tech(args[0]); |
461 | + |
462 | + manager.enable_technology(tech, null); |
463 | +} |
464 | + |
465 | +static void disable(string[] args) { |
466 | + |
467 | + if (args.length != 1) { |
468 | + stdout.printf("Invalid number of arguments for enable: %d\n", |
469 | + args.length); |
470 | + return; |
471 | + } |
472 | + |
473 | + var tech = str2tech(args[0]); |
474 | + |
475 | + manager.disable_technology(tech, null); |
476 | +} |
477 | + |
478 | +static void offline(string[] args) { |
479 | + |
480 | + if (args.length != 1) { |
481 | + stdout.printf("Invalid number of arguments for offline: %d\n", |
482 | + args.length); |
483 | + return; |
484 | + } |
485 | + |
486 | + var mode = args[0]; |
487 | + bool value; |
488 | + |
489 | + switch (mode) { |
490 | + case "on": |
491 | + value = true; |
492 | + break; |
493 | + case "off": |
494 | + value = false; |
495 | + break; |
496 | + default: |
497 | + stdout.printf("Unknown mode for offline: %s\n", mode); |
498 | + return; |
499 | + } |
500 | + |
501 | + manager.offline_mode = value; |
502 | +} |
503 | + |
504 | static bool cmd_handler() { |
505 | var line = cmd_queue.pop(); |
506 | var tokens = line.split(" "); |
507 | @@ -296,6 +365,15 @@ |
508 | case "tech": |
509 | tech(args); |
510 | break; |
511 | + case "enable": |
512 | + enable(args); |
513 | + break; |
514 | + case "disable": |
515 | + disable(args); |
516 | + break; |
517 | + case "offline": |
518 | + offline(args); |
519 | + break; |
520 | default: |
521 | stdout.printf("Unknown command: %s\n", cmd); |
522 | break; |
523 | @@ -363,6 +441,11 @@ |
524 | manager.get_bluetooth_state()); |
525 | }); |
526 | |
527 | + manager.notify["offline-mode"].connect((s, p) => { |
528 | + stdout.printf("offline-mode %s\n", |
529 | + manager.offline_mode ? "on" : "off"); |
530 | + }); |
531 | + |
532 | loop.run(); |
533 | |
534 | return 0; |
Looks good