From a36a3a9a522f98fecde80c1ebf1a35d94c630897 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 19 Sep 2014 12:24:24 +0200 Subject: [PATCH] tui/bond: remove primary option if mode is not active-backup (rh #1142864) Just drop it as we disable the widget in UI. https://bugzilla.redhat.com/show_bug.cgi?id=1142864 --- clients/tui/nmt-page-bond.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c index 5ea12ffc3e..0e7a08ccbb 100644 --- a/clients/tui/nmt-page-bond.c +++ b/clients/tui/nmt-page-bond.c @@ -252,10 +252,14 @@ mode_widget_changed (GObject *object, } else nmt_newt_component_set_sensitive (NMT_NEWT_COMPONENT (priv->monitoring), TRUE); - if (!strcmp (mode, "active-backup")) + if (!strcmp (mode, "active-backup")) { nmt_newt_widget_set_visible (NMT_NEWT_WIDGET (priv->primary), TRUE); - else + nm_setting_bond_add_option (priv->s_bond, NM_SETTING_BOND_OPTION_PRIMARY, + nmt_newt_entry_get_text (priv->primary)); + } else { nmt_newt_widget_set_visible (NMT_NEWT_WIDGET (priv->primary), FALSE); + nm_setting_bond_remove_option (priv->s_bond, NM_SETTING_BOND_OPTION_PRIMARY); + } } static void