network: Move non-shared code into the one module that uses it
This commit is contained in:
parent
4b9d8ac058
commit
d549c9e7bd
3 changed files with 19 additions and 21 deletions
|
@ -42,6 +42,25 @@ mtu_changed (GtkSpinButton *mtu, CEPageEthernet *page)
|
|||
gtk_widget_show (page->mtu_label);
|
||||
}
|
||||
|
||||
static gint
|
||||
ce_spin_output_with_default (GtkSpinButton *spin, gpointer user_data)
|
||||
{
|
||||
gint defvalue = GPOINTER_TO_INT (user_data);
|
||||
gint val;
|
||||
g_autofree gchar *buf = NULL;
|
||||
|
||||
val = gtk_spin_button_get_value_as_int (spin);
|
||||
if (val == defvalue)
|
||||
buf = g_strdup (_("automatic"));
|
||||
else
|
||||
buf = g_strdup_printf ("%d", val);
|
||||
|
||||
if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin))))
|
||||
gtk_entry_set_text (GTK_ENTRY (spin), buf);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
connect_ethernet_page (CEPageEthernet *page)
|
||||
{
|
||||
|
|
|
@ -518,25 +518,6 @@ ce_get_property_default (NMSetting *setting, const gchar *property_name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
gint
|
||||
ce_spin_output_with_default (GtkSpinButton *spin, gpointer user_data)
|
||||
{
|
||||
gint defvalue = GPOINTER_TO_INT (user_data);
|
||||
gint val;
|
||||
g_autofree gchar *buf = NULL;
|
||||
|
||||
val = gtk_spin_button_get_value_as_int (spin);
|
||||
if (val == defvalue)
|
||||
buf = g_strdup (_("automatic"));
|
||||
else
|
||||
buf = g_strdup_printf ("%d", val);
|
||||
|
||||
if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin))))
|
||||
gtk_entry_set_text (GTK_ENTRY (spin), buf);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gchar *
|
||||
ce_page_get_next_available_name (const GPtrArray *connections,
|
||||
NameFormat format,
|
||||
|
|
|
@ -94,8 +94,6 @@ void ce_page_setup_cloned_mac_combo (GtkComboBoxText *combo,
|
|||
const char *current);
|
||||
gint ce_get_property_default (NMSetting *setting,
|
||||
const gchar *property_name);
|
||||
gint ce_spin_output_with_default (GtkSpinButton *spin,
|
||||
gpointer user_data);
|
||||
gboolean ce_page_address_is_valid (const gchar *addr);
|
||||
gchar *ce_page_trim_address (const gchar *addr);
|
||||
char *ce_page_cloned_mac_get (GtkComboBoxText *combo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue