From dde7379145737062ece168593b07f11a78cb535b Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 12 May 2008 11:47:17 +0000 Subject: allow skipping interface choice if AUTOMATIC_IFACE_CHOICE is true in /etc/sysconfig/drakx-net and only one "automatic" interface is detected (i.e. not ndiswrapper) --- lib/network/netconnect.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/network/netconnect.pm b/lib/network/netconnect.pm index 607c115..3e90865 100644 --- a/lib/network/netconnect.pm +++ b/lib/network/netconnect.pm @@ -62,6 +62,9 @@ sub real_main { my $db_path = "/usr/share/apps/kppp/Provider"; my (%countries, @isp, $country, $provider, $old_provider); + my $system_file = '/etc/sysconfig/drakx-net'; + my %global_settings = getVarsFromSh($system_file); + my $_w = N("Protocol for the rest of the world"); my %isdn_protocols = ( 2 => N("European protocol (EDSS1)"), @@ -136,7 +139,7 @@ sub real_main { if (exists $steps_compat{$net->{type}}) { return $steps_compat{$net->{type}}; } - @connections_list = $net->{type}->get_connections; + @connections_list = $net->{type}->get_connections(automatic_only => text2bool($global_settings{AUTOMATIC_IFACE_CHOICE})); @connections_list ? "select_connection" : "no_connection"; }, }, @@ -144,7 +147,7 @@ sub real_main { select_connection => { name => sub { $net->{type}->get_type_name . "\n\n" . N("Select the network interface to configure:") }, data => [ { val => \$connection, type => 'list', list => \@connections_list, - format => sub { $_[0] && $_[0]->get_label }, allow_empty_list => 1 } ], + format => sub { $_[0] && $_[0]->get_description }, allow_empty_list => !text2bool($global_settings{AUTOMATIC_IFACE_CHOICE})} ], complete => sub { $connection->setup_thirdparty($in) or return 1; $connection->prepare_device; -- cgit v1.2.1