From 8a8a92a20f34c433c5a2e249f1095811137b560b Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 31 May 2005 09:04:56 +0000 Subject: if__(exists $foo, $bar) returns $bar whatever $foo is, don't try to make smart code that don't work (initial goal was probably to hide some isdn settings if they weren't set) --- perl-install/network/netconnect.pm | 43 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 81df88dfb..0ab7b5c6b 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -343,31 +343,24 @@ sub real_main { name => N("Connection Configuration") . "\n\n" . N("Please fill or check the field below"), data => sub { - [ - (map { - my ($dstruct, $field, $item) = @$_; - $item->{val} = \$dstruct->{$field}; - if__(exists $dstruct->{$field}, $item); - } ([ $isdn, "irq", { label => N("Card IRQ") } ], - [ $isdn, "mem", { label => N("Card mem (DMA)") } ], - [ $isdn, "io", { label => N("Card IO") } ], - [ $isdn, "io0", { label => N("Card IO_0") } ], - [ $isdn, "io1", { label => N("Card IO_1") } ], - [ $isdn, "phone_in", { label => N("Your personal phone number") } ], - [ $netc, "DOMAINNAME2", { label => N("Provider name (ex provider.net)") } ], - [ $isdn, "phone_out", { label => N("Provider phone number") } ], - [ $netc, "dnsServer2", { label => N("Provider DNS 1 (optional)") } ], - [ $netc, "dnsServer3", { label => N("Provider DNS 2 (optional)") } ], - [ $isdn, "dialing_mode", { label => N("Dialing mode"), list => ["auto", "manual"] } ], - [ $isdn, "speed", { label => N("Connection speed"), list => ["64 Kb/s", "128 Kb/s"] } ], - [ $isdn, "huptimeout", { label => N("Connection timeout (in sec)") } ], - ) - ), - ({ label => N("Account Login (user name)"), val => \$isdn->{login} }, - { label => N("Account Password"), val => \$isdn->{passwd}, hidden => 1 }, - ) - ]; - }, + [ + { label => N("Card IRQ"), val => \$isdn->{irq} }, + { label => N("Card mem (DMA)"), val => \$isdn->{mem} }, + { label => N("Card IO"), val => \$isdn->{io} }, + { label => N("Card IO_0"), val => \$isdn->{io0} }, + { label => N("Card IO_1"), val => \$isdn->{io1} }, + { label => N("Your personal phone number"), val => \$isdn->{phone_in} }, + { label => N("Provider name (ex provider.net)"), val => \$netc->{DOMAINNAME2} }, + { label => N("Provider phone number"), val => \$isdn->{phone_out} }, + { label => N("Provider DNS 1 (optional)"), val => \$netc->{dnsServer2} }, + { label => N("Provider DNS 2 (optional)"), val => \$netc->{dnsServer3} }, + { label => N("Dialing mode"), list => ["auto", "manual"], val => \$isdn->{dialing_mode} }, + { label => N("Connection speed"), list => ["64 Kb/s", "128 Kb/s"], val => \$isdn->{speed} }, + { label => N("Connection timeout (in sec)"), val => \$isdn->{huptimeout} }, + { label => N("Account Login (user name)"), val => \$isdn->{login} }, + { label => N("Account Password"), val => \$isdn->{passwd}, hidden => 1 }, + ]; + }, post => sub { network::isdn::write_config($isdn); $netc->{$_} = 'ippp0' foreach 'NET_DEVICE', 'NET_INTERFACE'; -- cgit v1.2.1