static void nmt_page_bond_constructed (GObject *object) { NmtPageBond *bond = NMT_PAGE_BOND (object); NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE (bond); NmtPageGrid *grid; NMSettingBond *s_bond; NmtNewtWidget *widget, *label; NMConnection *conn; conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (bond)); s_bond = nm_connection_get_setting_bond (conn); if (!s_bond) { nm_connection_add_setting (conn, nm_setting_bond_new ()); s_bond = nm_connection_get_setting_bond (conn); } priv->s_bond = s_bond; grid = NMT_PAGE_GRID (bond); widget = nmt_newt_separator_new (); nmt_page_grid_append (grid, _("Slaves"), widget, NULL); nmt_page_grid_set_row_flags (grid, widget, NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT); widget = nmt_slave_list_new (conn, bond_connection_type_filter, bond); g_signal_connect (widget, "notify::connections", G_CALLBACK (slaves_changed), bond); nmt_page_grid_append (grid, NULL, widget, NULL); priv->slaves = NMT_SLAVE_LIST (widget); widget = nmt_newt_popup_new (bond_mode); g_signal_connect (widget, "notify::active-id", G_CALLBACK (mode_widget_changed), bond); nmt_page_grid_append (grid, _("Mode"), widget, NULL); priv->mode = NMT_NEWT_POPUP (widget); widget = nmt_newt_entry_new (40, 0); g_signal_connect (widget, "notify::text", G_CALLBACK (primary_widget_changed), bond); nmt_page_grid_append (grid, _("Primary"), widget, NULL); priv->primary = NMT_NEWT_ENTRY (widget); widget = nmt_newt_popup_new (bond_monitoring); g_signal_connect (widget, "notify::active", G_CALLBACK (monitoring_widget_changed), bond); nmt_page_grid_append (grid, _("Link monitoring"), widget, NULL); priv->monitoring = NMT_NEWT_POPUP (widget); widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT); g_signal_connect (widget, "notify::text", G_CALLBACK (miimon_widget_changed), bond); label = nmt_newt_label_new (C_("milliseconds", "ms")); nmt_page_grid_append (grid, _("Monitoring frequency"), widget, label); priv->miimon = NMT_NEWT_ENTRY (widget); widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT); g_signal_connect (widget, "notify::text", G_CALLBACK (updelay_widget_changed), bond); label = nmt_newt_label_new (C_("milliseconds", "ms")); nmt_page_grid_append (grid, _("Link up delay"), widget, label); priv->updelay = NMT_NEWT_ENTRY (widget); widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT); g_signal_connect (widget, "notify::text", G_CALLBACK (downdelay_widget_changed), bond); label = nmt_newt_label_new (C_("milliseconds", "ms")); nmt_page_grid_append (grid, _("Link down delay"), widget, label); priv->downdelay = NMT_NEWT_ENTRY (widget); widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT); g_signal_connect (widget, "notify::text", G_CALLBACK (arp_interval_widget_changed), bond); label = nmt_newt_label_new (C_("milliseconds", "ms")); nmt_page_grid_append (grid, _("Monitoring frequency"), widget, label); priv->arp_interval = NMT_NEWT_ENTRY (widget); widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP4); g_signal_connect (widget, "notify::strings", G_CALLBACK (arp_ip_target_widget_changed), bond); nmt_page_grid_append (grid, _("ARP targets"), widget, NULL); priv->arp_ip_target = NMT_ADDRESS_LIST (widget); g_signal_connect (s_bond, "notify::" NM_SETTING_BOND_OPTIONS, G_CALLBACK (bond_options_changed), bond); bond_options_changed (G_OBJECT (s_bond), NULL, bond); slaves_changed (G_OBJECT (priv->slaves), NULL, bond); G_OBJECT_CLASS (nmt_page_bond_parent_class)->constructed (object); }
static void nmt_page_bridge_constructed (GObject *object) { NmtPageBridge *bridge = NMT_PAGE_BRIDGE (object); NmtDeviceEntry *deventry; NmtPageGrid *grid; NMSettingBridge *s_bridge; NmtNewtWidget *widget, *label, *stp; NMConnection *conn; conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (bridge)); s_bridge = nm_connection_get_setting_bridge (conn); if (!s_bridge) { nm_connection_add_setting (conn, nm_setting_bridge_new ()); s_bridge = nm_connection_get_setting_bridge (conn); } deventry = nmt_page_device_get_device_entry (NMT_PAGE_DEVICE (object)); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_INTERFACE_NAME, deventry, "interface-name", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); grid = NMT_PAGE_GRID (bridge); widget = nmt_newt_separator_new (); nmt_page_grid_append (grid, _("Slaves"), widget, NULL); nmt_page_grid_set_row_flags (grid, widget, NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT); widget = nmt_slave_list_new (conn, bridge_connection_type_filter, bridge); nmt_page_grid_append (grid, NULL, widget, NULL); widget = nmt_newt_entry_numeric_new (10, 0, 1000000); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_AGEING_TIME, widget, "text", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); label = nmt_newt_label_new (_("seconds")); nmt_page_grid_append (grid, _("Aging time"), widget, label); widget = stp = nmt_newt_checkbox_new (_("Enable STP (Spanning Tree Protocol)")); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP, widget, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); nmt_page_grid_append (grid, NULL, widget, NULL); widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_PRIORITY, widget, "text", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP, widget, "sensitive", G_BINDING_SYNC_CREATE); nmt_page_grid_append (grid, _("Priority"), widget, NULL); widget = nmt_newt_entry_numeric_new (10, 2, 30); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_FORWARD_DELAY, widget, "text", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP, widget, "sensitive", G_BINDING_SYNC_CREATE); label = nmt_newt_label_new (_("seconds")); nmt_page_grid_append (grid, _("Forward delay"), widget, label); widget = nmt_newt_entry_numeric_new (10, 1, 10); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_HELLO_TIME, widget, "text", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP, widget, "sensitive", G_BINDING_SYNC_CREATE); label = nmt_newt_label_new (_("seconds")); nmt_page_grid_append (grid, _("Hello time"), widget, label); widget = nmt_newt_entry_numeric_new (10, 6, 40); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_MAX_AGE, widget, "text", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP, widget, "sensitive", G_BINDING_SYNC_CREATE); label = nmt_newt_label_new (_("seconds")); nmt_page_grid_append (grid, _("Max age"), widget, label); G_OBJECT_CLASS (nmt_page_bridge_parent_class)->constructed (object); }