network: Simplify net_object_add_to_stack function
Except in the WiFi case it was creating a stack with one child. All the non-WiFi cases had the same logic.
This commit is contained in:
parent
8335c088ec
commit
76de0ce408
10 changed files with 53 additions and 86 deletions
|
@ -57,7 +57,7 @@ struct _CcNetworkPanel
|
||||||
CcPanel parent;
|
CcPanel parent;
|
||||||
|
|
||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
GHashTable *device_to_stack;
|
GHashTable *device_to_widget;
|
||||||
GPtrArray *devices;
|
GPtrArray *devices;
|
||||||
NMClient *client;
|
NMClient *client;
|
||||||
MMManager *modem_manager;
|
MMManager *modem_manager;
|
||||||
|
@ -215,7 +215,7 @@ cc_network_panel_dispose (GObject *object)
|
||||||
g_clear_object (&self->client);
|
g_clear_object (&self->client);
|
||||||
g_clear_object (&self->modem_manager);
|
g_clear_object (&self->modem_manager);
|
||||||
|
|
||||||
g_clear_pointer (&self->device_to_stack, g_hash_table_destroy);
|
g_clear_pointer (&self->device_to_widget, g_hash_table_destroy);
|
||||||
g_clear_pointer (&self->devices, g_ptr_array_unref);
|
g_clear_pointer (&self->devices, g_ptr_array_unref);
|
||||||
|
|
||||||
G_OBJECT_CLASS (cc_network_panel_parent_class)->dispose (object);
|
G_OBJECT_CLASS (cc_network_panel_parent_class)->dispose (object);
|
||||||
|
@ -240,12 +240,12 @@ cc_network_panel_get_help_uri (CcPanel *self)
|
||||||
static void
|
static void
|
||||||
object_removed_cb (CcNetworkPanel *self, NetObject *object)
|
object_removed_cb (CcNetworkPanel *self, NetObject *object)
|
||||||
{
|
{
|
||||||
GtkWidget *stack;
|
GtkWidget *widget;
|
||||||
|
|
||||||
/* remove device */
|
/* remove device */
|
||||||
stack = g_hash_table_lookup (self->device_to_stack, object);
|
widget = g_hash_table_lookup (self->device_to_widget, object);
|
||||||
if (stack != NULL)
|
if (widget != NULL)
|
||||||
gtk_widget_destroy (stack);
|
gtk_widget_destroy (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
GPtrArray *
|
GPtrArray *
|
||||||
|
@ -431,18 +431,14 @@ update_bluetooth_section (CcNetworkPanel *self)
|
||||||
gtk_widget_set_visible (self->container_bluetooth, n_bluetooth > 0);
|
gtk_widget_set_visible (self->container_bluetooth, n_bluetooth > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static void
|
||||||
add_device_stack (CcNetworkPanel *self, NetObject *object)
|
add_object (CcNetworkPanel *self, NetObject *object, GtkContainer *container)
|
||||||
{
|
{
|
||||||
GtkWidget *stack;
|
GtkWidget *widget;
|
||||||
|
|
||||||
stack = gtk_stack_new ();
|
widget = net_object_get_widget (object, self->sizegroup);
|
||||||
gtk_widget_show (stack);
|
g_hash_table_insert (self->device_to_widget, object, widget);
|
||||||
g_hash_table_insert (self->device_to_stack, object, stack);
|
gtk_container_add (container, widget);
|
||||||
|
|
||||||
net_object_add_to_stack (object, GTK_STACK (stack), self->sizegroup);
|
|
||||||
|
|
||||||
return stack;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -451,7 +447,6 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
|
||||||
NMDeviceType type;
|
NMDeviceType type;
|
||||||
NetDevice *net_device;
|
NetDevice *net_device;
|
||||||
const char *udi;
|
const char *udi;
|
||||||
GtkWidget *stack;
|
|
||||||
|
|
||||||
if (!nm_device_get_managed (device))
|
if (!nm_device_get_managed (device))
|
||||||
return;
|
return;
|
||||||
|
@ -475,8 +470,7 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
|
||||||
self->client,
|
self->client,
|
||||||
device,
|
device,
|
||||||
nm_device_get_udi (device)));
|
nm_device_get_udi (device)));
|
||||||
stack = add_device_stack (self, NET_OBJECT (net_device));
|
add_object (self, NET_OBJECT (net_device), GTK_CONTAINER (self->box_wired));
|
||||||
gtk_container_add (GTK_CONTAINER (self->box_wired), stack);
|
|
||||||
break;
|
break;
|
||||||
case NM_DEVICE_TYPE_MODEM:
|
case NM_DEVICE_TYPE_MODEM:
|
||||||
net_device = NET_DEVICE (net_device_mobile_new (CC_PANEL (self),
|
net_device = NET_DEVICE (net_device_mobile_new (CC_PANEL (self),
|
||||||
|
@ -484,8 +478,7 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
|
||||||
self->client,
|
self->client,
|
||||||
device,
|
device,
|
||||||
nm_device_get_udi (device)));
|
nm_device_get_udi (device)));
|
||||||
stack = add_device_stack (self, NET_OBJECT (net_device));
|
add_object (self, NET_OBJECT (net_device), GTK_CONTAINER (self->box_wired));
|
||||||
gtk_container_add (GTK_CONTAINER (self->box_wired), stack);
|
|
||||||
break;
|
break;
|
||||||
case NM_DEVICE_TYPE_BT:
|
case NM_DEVICE_TYPE_BT:
|
||||||
net_device = NET_DEVICE (net_device_bluetooth_new (CC_PANEL (self),
|
net_device = NET_DEVICE (net_device_bluetooth_new (CC_PANEL (self),
|
||||||
|
@ -493,8 +486,7 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
|
||||||
self->client,
|
self->client,
|
||||||
device,
|
device,
|
||||||
nm_device_get_udi (device)));
|
nm_device_get_udi (device)));
|
||||||
stack = add_device_stack (self, NET_OBJECT (net_device));
|
add_object (self, NET_OBJECT (net_device), GTK_CONTAINER (self->box_bluetooth));
|
||||||
gtk_container_add (GTK_CONTAINER (self->box_bluetooth), stack);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* For Wi-Fi and VPN we handle connections separately; we correctly manage
|
/* For Wi-Fi and VPN we handle connections separately; we correctly manage
|
||||||
|
@ -569,14 +561,12 @@ panel_remove_device (CcNetworkPanel *self, NMDevice *device)
|
||||||
static void
|
static void
|
||||||
panel_add_proxy_device (CcNetworkPanel *self)
|
panel_add_proxy_device (CcNetworkPanel *self)
|
||||||
{
|
{
|
||||||
GtkWidget *stack;
|
|
||||||
NetProxy *proxy;
|
NetProxy *proxy;
|
||||||
|
|
||||||
proxy = net_proxy_new ();
|
proxy = net_proxy_new ();
|
||||||
|
|
||||||
/* add proxy to stack */
|
/* add proxy to stack */
|
||||||
stack = add_device_stack (self, NET_OBJECT (proxy));
|
add_object (self, NET_OBJECT (proxy), GTK_CONTAINER (self->box_proxy));
|
||||||
gtk_container_add (GTK_CONTAINER (self->box_proxy), stack);
|
|
||||||
|
|
||||||
/* add proxy to device list */
|
/* add proxy to device list */
|
||||||
net_object_set_title (NET_OBJECT (proxy), _("Network proxy"));
|
net_object_set_title (NET_OBJECT (proxy), _("Network proxy"));
|
||||||
|
@ -687,7 +677,6 @@ find_net_object_by_id (CcNetworkPanel *self, const gchar *id)
|
||||||
static void
|
static void
|
||||||
panel_add_vpn_device (CcNetworkPanel *self, NMConnection *connection)
|
panel_add_vpn_device (CcNetworkPanel *self, NMConnection *connection)
|
||||||
{
|
{
|
||||||
GtkWidget *stack;
|
|
||||||
NetVpn *net_vpn;
|
NetVpn *net_vpn;
|
||||||
const gchar *id;
|
const gchar *id;
|
||||||
|
|
||||||
|
@ -705,8 +694,7 @@ panel_add_vpn_device (CcNetworkPanel *self, NMConnection *connection)
|
||||||
G_CALLBACK (object_removed_cb), self, G_CONNECT_SWAPPED);
|
G_CALLBACK (object_removed_cb), self, G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
/* add as a panel */
|
/* add as a panel */
|
||||||
stack = add_device_stack (self, NET_OBJECT (net_vpn));
|
add_object (self, NET_OBJECT (net_vpn), GTK_CONTAINER (self->box_vpn));
|
||||||
gtk_container_add (GTK_CONTAINER (self->box_vpn), stack);
|
|
||||||
|
|
||||||
net_object_set_title (NET_OBJECT (net_vpn), nm_connection_get_id (connection));
|
net_object_set_title (NET_OBJECT (net_vpn), nm_connection_get_id (connection));
|
||||||
|
|
||||||
|
@ -852,7 +840,7 @@ cc_network_panel_init (CcNetworkPanel *self)
|
||||||
|
|
||||||
self->cancellable = g_cancellable_new ();
|
self->cancellable = g_cancellable_new ();
|
||||||
self->devices = g_ptr_array_new_with_free_func (g_object_unref);
|
self->devices = g_ptr_array_new_with_free_func (g_object_unref);
|
||||||
self->device_to_stack = g_hash_table_new (g_direct_hash, g_direct_equal);
|
self->device_to_widget = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||||
|
|
||||||
/* add the virtual proxy device */
|
/* add the virtual proxy device */
|
||||||
panel_add_proxy_device (self);
|
panel_add_proxy_device (self);
|
||||||
|
|
|
@ -150,6 +150,7 @@ add_wifi_device (CcWifiPanel *self,
|
||||||
{
|
{
|
||||||
GtkWidget *header_widget;
|
GtkWidget *header_widget;
|
||||||
NetDeviceWifi *net_device;
|
NetDeviceWifi *net_device;
|
||||||
|
GtkWidget *widget;
|
||||||
|
|
||||||
/* Only manage Wi-Fi devices */
|
/* Only manage Wi-Fi devices */
|
||||||
if (!NM_IS_DEVICE_WIFI (device) || !nm_device_get_managed (device))
|
if (!NM_IS_DEVICE_WIFI (device) || !nm_device_get_managed (device))
|
||||||
|
@ -173,7 +174,10 @@ add_wifi_device (CcWifiPanel *self,
|
||||||
update_devices_names (self);
|
update_devices_names (self);
|
||||||
|
|
||||||
/* Needs to be added after the device is added to the self->devices array */
|
/* Needs to be added after the device is added to the self->devices array */
|
||||||
net_object_add_to_stack (NET_OBJECT (net_device), self->stack, self->sizegroup);
|
widget = net_object_get_widget (NET_OBJECT (net_device), self->sizegroup);
|
||||||
|
gtk_stack_add_titled (self->stack, widget,
|
||||||
|
net_object_get_id (NET_OBJECT (net_device)),
|
||||||
|
nm_device_get_description (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -56,14 +56,11 @@ net_device_bluetooth_set_show_separator (NetDeviceBluetooth *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
device_bluetooth_add_to_stack (NetObject *object,
|
device_bluetooth_get_widget (NetObject *object,
|
||||||
GtkStack *stack,
|
GtkSizeGroup *heading_size_group)
|
||||||
GtkSizeGroup *heading_size_group)
|
|
||||||
{
|
{
|
||||||
NetDeviceBluetooth *self = NET_DEVICE_BLUETOOTH (object);
|
NetDeviceBluetooth *self = NET_DEVICE_BLUETOOTH (object);
|
||||||
|
|
||||||
/* add widgets to size group */
|
|
||||||
gtk_stack_add_named (stack, GTK_WIDGET (self->box), net_object_get_id (object));
|
|
||||||
return GTK_WIDGET (self->box);
|
return GTK_WIDGET (self->box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +200,7 @@ net_device_bluetooth_class_init (NetDeviceBluetoothClass *klass)
|
||||||
|
|
||||||
object_class->finalize = net_device_bluetooth_finalize;
|
object_class->finalize = net_device_bluetooth_finalize;
|
||||||
object_class->constructed = net_device_bluetooth_constructed;
|
object_class->constructed = net_device_bluetooth_constructed;
|
||||||
parent_class->add_to_stack = device_bluetooth_add_to_stack;
|
parent_class->get_widget = device_bluetooth_get_widget;
|
||||||
parent_class->refresh = device_bluetooth_refresh;
|
parent_class->refresh = device_bluetooth_refresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,13 +58,11 @@ struct _NetDeviceEthernet
|
||||||
G_DEFINE_TYPE (NetDeviceEthernet, net_device_ethernet, NET_TYPE_DEVICE)
|
G_DEFINE_TYPE (NetDeviceEthernet, net_device_ethernet, NET_TYPE_DEVICE)
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
device_ethernet_add_to_stack (NetObject *object,
|
device_ethernet_get_widget (NetObject *object,
|
||||||
GtkStack *stack,
|
GtkSizeGroup *heading_size_group)
|
||||||
GtkSizeGroup *heading_size_group)
|
|
||||||
{
|
{
|
||||||
NetDeviceEthernet *self = NET_DEVICE_ETHERNET (object);
|
NetDeviceEthernet *self = NET_DEVICE_ETHERNET (object);
|
||||||
|
|
||||||
gtk_stack_add_named (stack, GTK_WIDGET (self->box), net_object_get_id (object));
|
|
||||||
return GTK_WIDGET (self->box);
|
return GTK_WIDGET (self->box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,7 +558,7 @@ net_device_ethernet_class_init (NetDeviceEthernetClass *klass)
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
obj_class->refresh = device_ethernet_refresh;
|
obj_class->refresh = device_ethernet_refresh;
|
||||||
obj_class->add_to_stack = device_ethernet_add_to_stack;
|
obj_class->get_widget = device_ethernet_get_widget;
|
||||||
object_class->constructed = device_ethernet_constructed;
|
object_class->constructed = device_ethernet_constructed;
|
||||||
object_class->finalize = device_ethernet_finalize;
|
object_class->finalize = device_ethernet_finalize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,9 +89,8 @@ enum {
|
||||||
G_DEFINE_TYPE (NetDeviceMobile, net_device_mobile, NET_TYPE_DEVICE)
|
G_DEFINE_TYPE (NetDeviceMobile, net_device_mobile, NET_TYPE_DEVICE)
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
device_mobile_proxy_add_to_stack (NetObject *object,
|
device_mobile_get_widget (NetObject *object,
|
||||||
GtkStack *stack,
|
GtkSizeGroup *heading_size_group)
|
||||||
GtkSizeGroup *heading_size_group)
|
|
||||||
{
|
{
|
||||||
NetDeviceMobile *self = NET_DEVICE_MOBILE (object);
|
NetDeviceMobile *self = NET_DEVICE_MOBILE (object);
|
||||||
|
|
||||||
|
@ -99,7 +98,6 @@ device_mobile_proxy_add_to_stack (NetObject *object,
|
||||||
gtk_size_group_add_widget (heading_size_group, GTK_WIDGET (self->imei_heading_label));
|
gtk_size_group_add_widget (heading_size_group, GTK_WIDGET (self->imei_heading_label));
|
||||||
gtk_size_group_add_widget (heading_size_group, GTK_WIDGET (self->network_label));
|
gtk_size_group_add_widget (heading_size_group, GTK_WIDGET (self->network_label));
|
||||||
|
|
||||||
gtk_stack_add_named (stack, GTK_WIDGET (self->box), net_object_get_id (object));
|
|
||||||
return GTK_WIDGET (self->box);
|
return GTK_WIDGET (self->box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -914,7 +912,7 @@ net_device_mobile_class_init (NetDeviceMobileClass *klass)
|
||||||
object_class->constructed = net_device_mobile_constructed;
|
object_class->constructed = net_device_mobile_constructed;
|
||||||
object_class->get_property = net_device_mobile_get_property;
|
object_class->get_property = net_device_mobile_get_property;
|
||||||
object_class->set_property = net_device_mobile_set_property;
|
object_class->set_property = net_device_mobile_set_property;
|
||||||
parent_class->add_to_stack = device_mobile_proxy_add_to_stack;
|
parent_class->get_widget = device_mobile_get_widget;
|
||||||
parent_class->refresh = device_mobile_refresh;
|
parent_class->refresh = device_mobile_refresh;
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
|
|
|
@ -128,19 +128,11 @@ net_device_wifi_get_title_widget (NetDeviceWifi *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
device_wifi_proxy_add_to_stack (NetObject *object,
|
device_wifi_proxy_get_widget (NetObject *object,
|
||||||
GtkStack *stack,
|
GtkSizeGroup *heading_size_group)
|
||||||
GtkSizeGroup *heading_size_group)
|
|
||||||
{
|
{
|
||||||
NMDevice *nmdevice;
|
|
||||||
NetDeviceWifi *self = NET_DEVICE_WIFI (object);
|
NetDeviceWifi *self = NET_DEVICE_WIFI (object);
|
||||||
|
|
||||||
nmdevice = net_device_get_nm_device (NET_DEVICE (object));
|
|
||||||
|
|
||||||
gtk_stack_add_titled (stack, GTK_WIDGET (self->notebook),
|
|
||||||
net_object_get_id (object),
|
|
||||||
nm_device_get_description (nmdevice));
|
|
||||||
|
|
||||||
return GTK_WIDGET (self->notebook);
|
return GTK_WIDGET (self->notebook);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1025,7 +1017,7 @@ net_device_wifi_class_init (NetDeviceWifiClass *klass)
|
||||||
object_class->finalize = net_device_wifi_finalize;
|
object_class->finalize = net_device_wifi_finalize;
|
||||||
object_class->constructed = net_device_wifi_constructed;
|
object_class->constructed = net_device_wifi_constructed;
|
||||||
object_class->get_property = net_device_wifi_get_property;
|
object_class->get_property = net_device_wifi_get_property;
|
||||||
parent_class->add_to_stack = device_wifi_proxy_add_to_stack;
|
parent_class->get_widget = device_wifi_proxy_get_widget;
|
||||||
parent_class->refresh = device_wifi_refresh;
|
parent_class->refresh = device_wifi_refresh;
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
|
|
|
@ -142,24 +142,20 @@ net_object_get_panel (NetObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
net_object_add_to_stack (NetObject *self,
|
net_object_get_widget (NetObject *self,
|
||||||
GtkStack *stack,
|
GtkSizeGroup *heading_size_group)
|
||||||
GtkSizeGroup *heading_size_group)
|
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
NetObjectClass *klass = NET_OBJECT_GET_CLASS (self);
|
NetObjectClass *klass = NET_OBJECT_GET_CLASS (self);
|
||||||
NetObjectPrivate *priv = net_object_get_instance_private (self);
|
NetObjectPrivate *priv = net_object_get_instance_private (self);
|
||||||
|
|
||||||
if (klass->add_to_stack != NULL) {
|
widget = klass->get_widget (self, heading_size_group);
|
||||||
widget = klass->add_to_stack (self, stack, heading_size_group);
|
g_object_set_data_full (G_OBJECT (widget),
|
||||||
g_object_set_data_full (G_OBJECT (widget),
|
"NetObject::id",
|
||||||
"NetObject::id",
|
g_strdup (priv->id),
|
||||||
g_strdup (priv->id),
|
g_free);
|
||||||
g_free);
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
|
||||||
g_debug ("no klass->add_to_stack for %s", priv->id);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -38,8 +38,7 @@ struct _NetObjectClass
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
|
|
||||||
/* vtable */
|
/* vtable */
|
||||||
GtkWidget *(*add_to_stack) (NetObject *object,
|
GtkWidget *(*get_widget) (NetObject *object,
|
||||||
GtkStack *stack,
|
|
||||||
GtkSizeGroup *heading_size_group);
|
GtkSizeGroup *heading_size_group);
|
||||||
void (*refresh) (NetObject *object);
|
void (*refresh) (NetObject *object);
|
||||||
};
|
};
|
||||||
|
@ -56,8 +55,7 @@ CcNetworkPanel *net_object_get_panel (NetObject *object)
|
||||||
void net_object_emit_changed (NetObject *object);
|
void net_object_emit_changed (NetObject *object);
|
||||||
void net_object_emit_removed (NetObject *object);
|
void net_object_emit_removed (NetObject *object);
|
||||||
void net_object_refresh (NetObject *object);
|
void net_object_refresh (NetObject *object);
|
||||||
GtkWidget *net_object_add_to_stack (NetObject *object,
|
GtkWidget *net_object_get_widget (NetObject *object,
|
||||||
GtkStack *stack,
|
|
||||||
GtkSizeGroup *heading_size_group);
|
GtkSizeGroup *heading_size_group);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -193,14 +193,13 @@ show_dialog_cb (NetProxy *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
net_proxy_add_to_stack (NetObject *object,
|
net_proxy_get_widget (NetObject *object,
|
||||||
GtkStack *stack,
|
GtkSizeGroup *heading_size_group)
|
||||||
GtkSizeGroup *heading_size_group)
|
|
||||||
{
|
{
|
||||||
NetProxy *self = NET_PROXY (object);
|
NetProxy *self = NET_PROXY (object);
|
||||||
|
|
||||||
gtk_size_group_add_widget (heading_size_group, GTK_WIDGET (self->main_widget));
|
gtk_size_group_add_widget (heading_size_group, GTK_WIDGET (self->main_widget));
|
||||||
gtk_stack_add_named (stack, GTK_WIDGET (self->main_widget), net_object_get_id (object));
|
|
||||||
return GTK_WIDGET (self->main_widget);
|
return GTK_WIDGET (self->main_widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +223,7 @@ net_proxy_class_init (NetProxyClass *klass)
|
||||||
NetObjectClass *parent_class = NET_OBJECT_CLASS (klass);
|
NetObjectClass *parent_class = NET_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class->finalize = net_proxy_finalize;
|
object_class->finalize = net_proxy_finalize;
|
||||||
parent_class->add_to_stack = net_proxy_add_to_stack;
|
parent_class->get_widget = net_proxy_get_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -137,14 +137,11 @@ net_vpn_set_connection (NetVpn *self, NMConnection *connection)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
vpn_proxy_add_to_stack (NetObject *object,
|
vpn_proxy_get_widget (NetObject *object,
|
||||||
GtkStack *stack,
|
GtkSizeGroup *heading_size_group)
|
||||||
GtkSizeGroup *heading_size_group)
|
|
||||||
{
|
{
|
||||||
NetVpn *self = NET_VPN (object);
|
NetVpn *self = NET_VPN (object);
|
||||||
|
|
||||||
/* add widgets to size group */
|
|
||||||
gtk_stack_add_named (stack, GTK_WIDGET (self->box), net_object_get_id (object));
|
|
||||||
return GTK_WIDGET (self->box);
|
return GTK_WIDGET (self->box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,7 +373,7 @@ net_vpn_class_init (NetVpnClass *klass)
|
||||||
object_class->set_property = net_vpn_set_property;
|
object_class->set_property = net_vpn_set_property;
|
||||||
object_class->constructed = net_vpn_constructed;
|
object_class->constructed = net_vpn_constructed;
|
||||||
object_class->finalize = net_vpn_finalize;
|
object_class->finalize = net_vpn_finalize;
|
||||||
parent_class->add_to_stack = vpn_proxy_add_to_stack;
|
parent_class->get_widget = vpn_proxy_get_widget;
|
||||||
parent_class->refresh = vpn_proxy_refresh;
|
parent_class->refresh = vpn_proxy_refresh;
|
||||||
|
|
||||||
pspec = g_param_spec_object ("connection", NULL, NULL,
|
pspec = g_param_spec_object ("connection", NULL, NULL,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue