diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-03-31 23:03:52 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-04-01 03:48:01 +0800 |
commit | 4eec255877f060bf907704488397459f7612be86 (patch) | |
tree | 892def25f6709ca1618556802adf2e20a1f0b841 /shell/e-shell.c | |
parent | 9ed9a99baddcb87eab366e4f939dc146f2db9401 (diff) | |
download | gsoc2013-evolution-4eec255877f060bf907704488397459f7612be86.tar.gz gsoc2013-evolution-4eec255877f060bf907704488397459f7612be86.tar.zst gsoc2013-evolution-4eec255877f060bf907704488397459f7612be86.zip |
Use GNetworkMonitor to drive EShell:network-available.
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index dd0f4db19a..bc252845cd 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -766,12 +766,23 @@ shell_finalize (GObject *object) static void shell_constructed (GObject *object) { + GNetworkMonitor *monitor; + /* The first EShell instance is the default. */ if (default_shell == NULL) { default_shell = object; g_object_add_weak_pointer (object, &default_shell); } + /* Synchronize network monitoring. */ + + monitor = g_network_monitor_get_default (); + + g_object_bind_property ( + monitor, "network-available", + object, "network-available", + G_BINDING_SYNC_CREATE); + /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_shell_parent_class)->constructed (object); } @@ -972,8 +983,7 @@ e_shell_class_init (EShellClass *class) "Network Available", "Whether the network is available", TRUE, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT)); + G_PARAM_READWRITE)); /** * EShell:online |