From 188bc2d33d9172cdd51b6852aebecf13e3a058da Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 27 Jan 2014 01:44:42 +0100 Subject: ifcfg: do not force NM_CONTROLLED to no when previously unset (interactive UI) This introduces a new "Automatic" choice for the "NM controlled" option in the UI. This "Automatic" choice removes the NM_CONTROLLED variable from the ifcfg file. The system will then choose between NetworkManager and initscripts depending on the activation of the NetworkManager daemon. --- lib/network/connection.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/network/connection.pm') diff --git a/lib/network/connection.pm b/lib/network/connection.pm index 443c0e4..e705496 100644 --- a/lib/network/connection.pm +++ b/lib/network/connection.pm @@ -246,11 +246,19 @@ sub guess_control_settings { sub get_control_settings { my ($self) = @_; + + my %nm_controlled_modes = ( + undef => N_("Automatic"), + 0 => N_("No"), + 1 => N_("Yes"), + ); + [ { text => N("Allow users to manage the connection"), val => \$self->{control}{userctl}, type => "bool" }, { text => N("Start the connection at boot"), val => \$self->{control}{onboot}, type => "bool" }, { text => N("Enable traffic accounting"), val => \$self->{control}{accounting}, type => "bool" }, - { text => N("Allow interface to be controlled by Network Manager"), val => \$self->{control}{nm_controlled}, type => "bool" }, + { label => N("Allow interface to be controlled by Network Manager"), val => \$self->{control}{nm_controlled}, list => [ keys %nm_controlled_modes ], + sort => 1, format => sub { translate($nm_controlled_modes{$_[0]}) } }, { label => N("Metric"), val => \$self->{control}{metric}, advanced => 1 }, { label => N("MTU"), val => \$self->{control}{mtu}, advanced => 1, help => N("Maximum size of network message (MTU). If unsure, left blank.") }, -- cgit v1.2.1