[gnome-control-center] network: Add a vfunc so a NetObject can be deleted
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Add a vfunc so a NetObject can be deleted
- Date: Thu, 12 Jul 2012 16:01:34 +0000 (UTC)
commit ddabc6049f8aaf7e7123970ee289a1d8af309332
Author: Richard Hughes <richard hughsie com>
Date: Thu Jul 12 16:55:20 2012 +0100
network: Add a vfunc so a NetObject can be deleted
We will only support this for VPN 'devices' but it seemed a cleaner abstraction this way.
panels/network/net-object.c | 8 ++++++++
panels/network/net-object.h | 2 ++
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/net-object.c b/panels/network/net-object.c
index eeb2c1b..a447c76 100644
--- a/panels/network/net-object.c
+++ b/panels/network/net-object.c
@@ -146,6 +146,14 @@ net_object_add_to_notebook (NetObject *object,
return NULL;
}
+void
+net_object_delete (NetObject *object)
+{
+ NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
+ if (klass->delete != NULL)
+ klass->delete (object);
+}
+
/**
* net_object_get_property:
**/
diff --git a/panels/network/net-object.h b/panels/network/net-object.h
index f42ecb2..1cb9354 100644
--- a/panels/network/net-object.h
+++ b/panels/network/net-object.h
@@ -53,6 +53,7 @@ struct _NetObjectClass
GtkWidget *(*add_to_notebook) (NetObject *object,
GtkNotebook *notebook,
GtkSizeGroup *heading_size_group);
+ void (*delete) (NetObject *object);
/* signal */
void (* changed) (NetObject *object);
@@ -72,6 +73,7 @@ void net_object_set_client (NetObject *object,
NMClient *client);
void net_object_emit_changed (NetObject *object);
void net_object_emit_removed (NetObject *object);
+void net_object_delete (NetObject *object);
GtkWidget *net_object_add_to_notebook (NetObject *object,
GtkNotebook *notebook,
GtkSizeGroup *heading_size_group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]