[network-manager-applet/nma-0-9-8] editor: save bonding mode in nm-connection-editor
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nma-0-9-8] editor: save bonding mode in nm-connection-editor
- Date: Wed, 10 Jul 2013 14:49:49 +0000 (UTC)
commit bfc3e2576b5ee240b2af57d80cfef4ecb1a15ba4
Author: Jiří Klimeš <jklimes redhat com>
Date: Wed Jul 10 16:10:32 2013 +0200
editor: save bonding mode in nm-connection-editor
In addition, only allow MII monitoring for "balance-tlb" and "balance-alb"
modes.
RHEL6:
https://bugzilla.redhat.com/show_bug.cgi?id=953076
src/connection-editor/page-bond.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/connection-editor/page-bond.c b/src/connection-editor/page-bond.c
index a211f79..ddd25e8 100644
--- a/src/connection-editor/page-bond.c
+++ b/src/connection-editor/page-bond.c
@@ -150,6 +150,22 @@ connection_added (CEPageMaster *master, NMConnection *connection)
}
static void
+bonding_mode_changed (GtkComboBox *combo, gpointer user_data)
+{
+ CEPageBond *self = user_data;
+ CEPageBondPrivate *priv = CE_PAGE_BOND_GET_PRIVATE (self);
+
+ /* balance-tlb and balance-alb work only with MII monitoring */
+ if ( gtk_combo_box_get_active (combo) == MODE_BALANCE_TLB
+ || gtk_combo_box_get_active (combo) == MODE_BALANCE_ALB) {
+ gtk_combo_box_set_active (priv->monitoring, MONITORING_MII);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->monitoring), FALSE);
+ } else {
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->monitoring), TRUE);
+ }
+}
+
+static void
monitoring_mode_changed (GtkComboBox *combo, gpointer user_data)
{
CEPageBond *self = user_data;
@@ -300,6 +316,10 @@ populate_ui (CEPageBond *self)
mode_idx = MODE_BALANCE_ALB;
}
gtk_combo_box_set_active (priv->mode, mode_idx);
+ g_signal_connect (priv->mode, "changed",
+ G_CALLBACK (bonding_mode_changed),
+ self);
+ bonding_mode_changed (priv->mode, self);
/* Monitoring mode/frequency */
frequency = nm_setting_bond_get_option_by_name (setting, NM_SETTING_BOND_OPTION_ARP_INTERVAL);
@@ -481,6 +501,9 @@ ui_to_setting (CEPageBond *self)
downdelay = gtk_entry_get_text (GTK_ENTRY (priv->downdelay));
targets = uglify_targets (gtk_entry_get_text (priv->arp_targets));
+ /* Set bond mode */
+ nm_setting_bond_add_option (priv->setting, NM_SETTING_BOND_OPTION_MODE, mode);
+
switch (gtk_combo_box_get_active (priv->monitoring)) {
case MONITORING_MII:
nm_setting_bond_add_option (priv->setting, NM_SETTING_BOND_OPTION_MIIMON, frequency);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]