summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <dev@blino.org>2014-01-27 01:44:42 +0100
committerOlivier Blin <dev@blino.org>2014-01-27 01:44:42 +0100
commit188bc2d33d9172cdd51b6852aebecf13e3a058da (patch)
tree2173edd3edb303fb6d665c102094980d676ed520 /lib
parent360f3b5937e1fb1ff173240ec5c3ee9f8e9f9491 (diff)
downloaddrakx-net-188bc2d33d9172cdd51b6852aebecf13e3a058da.tar
drakx-net-188bc2d33d9172cdd51b6852aebecf13e3a058da.tar.gz
drakx-net-188bc2d33d9172cdd51b6852aebecf13e3a058da.tar.bz2
drakx-net-188bc2d33d9172cdd51b6852aebecf13e3a058da.tar.xz
drakx-net-188bc2d33d9172cdd51b6852aebecf13e3a058da.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/network/connection.pm10
1 files changed, 9 insertions, 1 deletions
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.") },