[gnome-control-center] network: Provide a vfunc for refreshing a NetObject
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Provide a vfunc for refreshing a NetObject
- Date: Thu, 12 Jul 2012 16:51:54 +0000 (UTC)
commit 0a98c5a921225055af230dcf218e52c99035134d
Author: Richard Hughes <richard hughsie com>
Date: Thu Jul 12 17:29:47 2012 +0100
network: Provide a vfunc for refreshing a NetObject
panels/network/net-device.c | 1 +
panels/network/net-object.c | 8 ++++++++
panels/network/net-object.h | 2 ++
panels/network/net-vpn.c | 8 ++++++++
4 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/net-device.c b/panels/network/net-device.c
index 911744d..7ab8f6c 100644
--- a/panels/network/net-device.c
+++ b/panels/network/net-device.c
@@ -43,6 +43,7 @@ state_changed_cb (NMDevice *device,
NetDevice *net_device)
{
net_object_emit_changed (NET_OBJECT (net_device));
+ net_object_refresh (NET_OBJECT (net_device));
}
void
diff --git a/panels/network/net-object.c b/panels/network/net-object.c
index a447c76..b501d6c 100644
--- a/panels/network/net-object.c
+++ b/panels/network/net-object.c
@@ -154,6 +154,14 @@ net_object_delete (NetObject *object)
klass->delete (object);
}
+void
+net_object_refresh (NetObject *object)
+{
+ NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
+ if (klass->refresh != NULL)
+ klass->refresh (object);
+}
+
/**
* net_object_get_property:
**/
diff --git a/panels/network/net-object.h b/panels/network/net-object.h
index 1cb9354..06499d1 100644
--- a/panels/network/net-object.h
+++ b/panels/network/net-object.h
@@ -54,6 +54,7 @@ struct _NetObjectClass
GtkNotebook *notebook,
GtkSizeGroup *heading_size_group);
void (*delete) (NetObject *object);
+ void (*refresh) (NetObject *object);
/* signal */
void (* changed) (NetObject *object);
@@ -74,6 +75,7 @@ void net_object_set_client (NetObject *object,
void net_object_emit_changed (NetObject *object);
void net_object_emit_removed (NetObject *object);
void net_object_delete (NetObject *object);
+void net_object_refresh (NetObject *object);
GtkWidget *net_object_add_to_notebook (NetObject *object,
GtkNotebook *notebook,
GtkSizeGroup *heading_size_group);
diff --git a/panels/network/net-vpn.c b/panels/network/net-vpn.c
index aefe4f5..e4e0c8d 100644
--- a/panels/network/net-vpn.c
+++ b/panels/network/net-vpn.c
@@ -370,6 +370,13 @@ nm_device_refresh_vpn_ui (NetVpn *vpn)
}
static void
+vpn_proxy_refresh (NetObject *object)
+{
+ NetVpn *vpn = NET_VPN (object);
+ nm_device_refresh_vpn_ui (vpn);
+}
+
+static void
device_off_toggled (GtkSwitch *sw,
GParamSpec *pspec,
NetVpn *vpn)
@@ -442,6 +449,7 @@ net_vpn_class_init (NetVpnClass *klass)
object_class->finalize = net_vpn_finalize;
parent_class->add_to_notebook = vpn_proxy_add_to_notebook;
parent_class->delete = vpn_proxy_delete;
+ parent_class->refresh = vpn_proxy_refresh;
g_type_class_add_private (klass, sizeof (NetVpnPrivate));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]