network: Add some more widget setting common code

This commit is contained in:
Richard Hughes 2012-07-17 16:15:13 +01:00
parent f4c13e835b
commit 00c51443ae
2 changed files with 23 additions and 0 deletions

View file

@ -507,3 +507,23 @@ panel_set_device_widget_details (GtkBuilder *builder,
}
return TRUE;
}
gboolean
panel_set_device_widget_header (GtkBuilder *builder,
const gchar *widget_suffix,
const gchar *heading)
{
gchar *label_id = NULL;
GtkWidget *widget;
label_id = g_strdup_printf ("heading_%s", widget_suffix);
widget = GTK_WIDGET (gtk_builder_get_object (builder, label_id));
if (widget == NULL) {
g_critical ("no widget %s found", label_id);
return FALSE;
}
gtk_label_set_label (GTK_LABEL (widget), heading);
g_free (label_id);
return TRUE;
}

View file

@ -40,6 +40,9 @@ const gchar *panel_device_state_reason_to_localized_string (NMDevice *device
gboolean panel_set_device_widget_details (GtkBuilder *builder,
const gchar *widget_suffix,
const gchar *value);
gboolean panel_set_device_widget_header (GtkBuilder *builder,
const gchar *widget_suffix,
const gchar *value);
G_END_DECLS