network: Remove two common functions that are more simply done inside the few cases that use them

The existing code relied on using GtkBuilder, which will no longer work when we
switch to GtkTemplate.
This commit is contained in:
Robert Ancell 2019-10-01 12:50:30 +13:00
parent 4ba3a2c3d1
commit 3c32ee72ea
5 changed files with 19 additions and 43 deletions

View file

@ -269,9 +269,9 @@ device_state_reason_to_localized_string (NMDevice *device)
return value;
}
static gchar *
device_status_to_localized_string (NMDevice *nm_device,
const gchar *speed)
gchar *
panel_device_status_to_localized_string (NMDevice *nm_device,
const gchar *speed)
{
NMDeviceState state;
GString *string;
@ -314,34 +314,6 @@ device_status_to_localized_string (NMDevice *nm_device,
return g_string_free (string, FALSE);
}
void
panel_set_device_status (GtkBuilder *builder,
const gchar *label_name,
NMDevice *nm_device,
const gchar *speed)
{
GtkLabel *label;
g_autofree gchar *status = NULL;
label = GTK_LABEL (gtk_builder_get_object (builder, label_name));
status = device_status_to_localized_string (nm_device, speed);
gtk_label_set_label (label, status);
}
void
panel_set_device_row_status (GtkBuilder *builder,
const gchar *row_name,
NMDevice *nm_device,
const gchar *speed)
{
HdyActionRow *row;
g_autofree gchar *status = NULL;
row = HDY_ACTION_ROW (gtk_builder_get_object (builder, row_name));
status = device_status_to_localized_string (nm_device, speed);
hdy_action_row_set_title (row, status);
}
gboolean
panel_set_device_widget_details (GtkBuilder *builder,
const gchar *widget_suffix,