[gnome-control-center] online-accounts: Bind "accounts-button-add" to network availability
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] online-accounts: Bind "accounts-button-add" to network availability
- Date: Mon, 3 Dec 2012 12:23:39 +0000 (UTC)
commit ff186736dc2e063ee2df48a887ba394a20cd8d0e
Author: Ebru Akagunduz <ebru akagunduz gmail com>
Date: Mon Dec 3 13:14:34 2012 +0100
online-accounts: Bind "accounts-button-add" to network availability
Fixes: https://bugzilla.gnome.org/678161
panels/online-accounts/cc-online-accounts-panel.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c b/panels/online-accounts/cc-online-accounts-panel.c
index b663b06..12a5766 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -22,6 +22,7 @@
#include "config.h"
+#include <gio/gio.h>
#include <string.h>
#include <glib/gi18n-lib.h>
@@ -140,6 +141,7 @@ goa_panel_init (GoaPanel *panel)
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
GtkTreeIter iter;
+ GNetworkMonitor *monitor;
panel->builder = gtk_builder_new ();
error = NULL;
@@ -177,6 +179,12 @@ goa_panel_init (GoaPanel *panel)
panel);
button = GTK_WIDGET (gtk_builder_get_object (panel->builder, "accounts-button-add"));
+
+ monitor = g_network_monitor_get_default();
+ g_object_bind_property (monitor, "network-available",
+ button, "sensitive",
+ G_BINDING_SYNC_CREATE);
+
g_signal_connect (button,
"clicked",
G_CALLBACK (on_add_button_clicked),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]