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
|
@ -142,24 +142,20 @@ net_object_get_panel (NetObject *self)
|
|||
}
|
||||
|
||||
GtkWidget *
|
||||
net_object_add_to_stack (NetObject *self,
|
||||
GtkStack *stack,
|
||||
GtkSizeGroup *heading_size_group)
|
||||
net_object_get_widget (NetObject *self,
|
||||
GtkSizeGroup *heading_size_group)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
NetObjectClass *klass = NET_OBJECT_GET_CLASS (self);
|
||||
NetObjectPrivate *priv = net_object_get_instance_private (self);
|
||||
|
||||
if (klass->add_to_stack != NULL) {
|
||||
widget = klass->add_to_stack (self, stack, heading_size_group);
|
||||
g_object_set_data_full (G_OBJECT (widget),
|
||||
"NetObject::id",
|
||||
g_strdup (priv->id),
|
||||
g_free);
|
||||
return widget;
|
||||
}
|
||||
g_debug ("no klass->add_to_stack for %s", priv->id);
|
||||
return NULL;
|
||||
widget = klass->get_widget (self, heading_size_group);
|
||||
g_object_set_data_full (G_OBJECT (widget),
|
||||
"NetObject::id",
|
||||
g_strdup (priv->id),
|
||||
g_free);
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue