summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-18 17:52:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-18 17:52:21 +0000
commit3c449c259f3c6325a00bf542511bb1ccbce55054 (patch)
tree31ff76977b035edd10a498a43cd3abd2ed1861d9 /perl-install/network
parent42a56d315a86b9fa19d9330583a26a86c7453ab0 (diff)
downloaddrakx-backup-do-not-use-3c449c259f3c6325a00bf542511bb1ccbce55054.tar
drakx-backup-do-not-use-3c449c259f3c6325a00bf542511bb1ccbce55054.tar.gz
drakx-backup-do-not-use-3c449c259f3c6325a00bf542511bb1ccbce55054.tar.bz2
drakx-backup-do-not-use-3c449c259f3c6325a00bf542511bb1ccbce55054.tar.xz
drakx-backup-do-not-use-3c449c259f3c6325a00bf542511bb1ccbce55054.zip
big renaming of ask_from_entries_refH in ask_from and ask_from_entries_refH_powered in ask_from_
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/ethernet.pm4
-rw-r--r--perl-install/network/modem.pm2
-rw-r--r--perl-install/network/netconnect.pm40
-rw-r--r--perl-install/network/network.pm93
-rw-r--r--perl-install/network/tools.pm40
5 files changed, 88 insertions, 91 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm
index fcc07b5d0..74a23a029 100644
--- a/perl-install/network/ethernet.pm
+++ b/perl-install/network/ethernet.pm
@@ -209,12 +209,12 @@ sub configureNetwork {
$netc->{minus_one} = 1;
my $dhcp_hostname = $netc->{HOSTNAME};
$::isInstall and $in->set_help('configureNetworkHostDHCP');
- $in->ask_from_entries_refH(_("Configuring network"),
+ $in->ask_from(_("Configuring network"),
_("Please enter your host name if you know it.
Some DHCP servers require the hostname to work.
Your host name should be a fully-qualified host name,
such as ``mybox.mylab.myco.com''."),
- [ { label => _("Host name"), val => \$netc->{HOSTNAME} }]) or goto configureNetwork_step_1;
+ [ { label => _("Host name"), val => \$netc->{HOSTNAME} }]) or goto configureNetwork_step_1;
$netc->{HOSTNAME} ne $dhcp_hostname and $netc->{DHCP_HOSTNAME} = $netc->{HOSTNAME};
} else {
configureNetworkNet($in, $netc, $last ||= {}, @l) or goto configureNetwork_step_1;
diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm
index f06c60219..b529d2357 100644
--- a/perl-install/network/modem.pm
+++ b/perl-install/network/modem.pm
@@ -41,7 +41,7 @@ sub pppConfig {
[ grep { $_ ne $mouse->{device} } (mouse::serial_ports, if_(-e '/dev/modem', '/dev/modem')) ]) || return;
$::isStandalone || $in->set_help('configureNetworkISP');
- $in->ask_from_entries_refH('', _("Dialup options"), [
+ $in->ask_from('', _("Dialup options"), [
{ label => _("Connection name"), val => \$modem->{connection} },
{ label => _("Phone number"), val => \$modem->{phone} },
{ label => _("Login ID"), val => \$modem->{login} },
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 456c9276d..b8b327bde 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -154,13 +154,13 @@ ifdown eth0
step_1:
$::Wizard_no_previous=1;
my @profiles=get_profiles();
- $in->ask_from_entries_refH(_("Network Configuration Wizard"),
- _("Welcome to The Network Configuration Wizard\n\nWe are about to configure your internet/network connection.\nIf you don't want to use the auto detection, deselect the checkbox.\n"),
- [
- if_(@profiles > 1, { label => _("Choose the profile to configure"), val => \$netcnx->{PROFILE}, list => \@profiles }),
- { label => _("Use auto detection"), val => \$netc->{autodetection}, type => 'bool' },
- ]
- ) or goto step_5;
+ $in->ask_from(_("Network Configuration Wizard"),
+ _("Welcome to The Network Configuration Wizard\n\nWe are about to configure your internet/network connection.\nIf you don't want to use the auto detection, deselect the checkbox.\n"),
+ [
+ if_(@profiles > 1, { label => _("Choose the profile to configure"), val => \$netcnx->{PROFILE}, list => \@profiles }),
+ { label => _("Use auto detection"), val => \$netc->{autodetection}, type => 'bool' },
+ ]
+ ) or goto step_5;
undef $::Wizard_no_previous;
set_profile($netcnx);
if ($netc->{autodetection}) {
@@ -183,14 +183,14 @@ ifdown eth0
);
my $i=0;
map { defined $set_default or do { $_->[1] and $set_default=$i; }; $i++; } @l;
- my $e = $in->ask_from_entries_refH(_("Network Configuration Wizard"),
- _("Choose the connection you want to configure"),
- [
- map { {
- label => $_->[0] . if_($_->[1], " - " . _ ($_->[2], $_->[1])),
- val => $_->[3], type => 'bool'} } @l
- ]
- ) or goto step_1;
+ my $e = $in->ask_from(_("Network Configuration Wizard"),
+ _("Choose the connection you want to configure"),
+ [
+ map { {
+ label => $_->[0] . if_($_->[1], " - " . _ ($_->[2], $_->[1])),
+ val => $_->[3], type => 'bool'} } @l
+ ]
+ ) or goto step_1;
# load_conf ($netcnx, $netc, $intf);
@@ -204,12 +204,10 @@ ifdown eth0
my $nb = keys %{$netc->{internet_cnx}};
if ($nb < 1) {
} elsif ($nb > 1) {
- $in->ask_from_entries_refH(_("Network Configuration Wizard"),
- _("You have configured multiple ways to connect to the Internet.\nChoose the one you want to use.\n\n" . if_(!$::isStandalone, "You may want to configure some profiles after the installation, in the Mandrake Control Center")),
- [
- { label => _("Internet connection"), val => \$netc->{internet_cnx_choice}, list => [ keys %{$netc->{internet_cnx}} ]}
- ]
- ) or goto step_2;
+ $in->ask_from(_("Network Configuration Wizard"),
+ _("You have configured multiple ways to connect to the Internet.\nChoose the one you want to use.\n\n" . if_(!$::isStandalone, "You may want to configure some profiles after the installation, in the Mandrake Control Center")),
+ [ { label => _("Internet connection"), val => \$netc->{internet_cnx_choice}, list => [ keys %{$netc->{internet_cnx}} ]} ]
+ ) or goto step_2;
} elsif ($nb == 1) {
$netc->{internet_cnx_choice} = (keys %{$netc->{internet_cnx}})[0];
}
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 14706ea01..40f2e6053 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -286,51 +286,50 @@ notation (for example, 1.2.3.4).");
delete $intf->{BROADCAST};
my @fields = qw(IPADDR NETMASK);
$::isStandalone or $in->set_help('configureNetworkIP');
- $in->ask_from_entries_refH(_("Configuring network device %s", $intf->{DEVICE}),
- (_("Configuring network device %s", $intf->{DEVICE}) . ( $module ? _(" (driver %s)", $module) : '' ) ."\n\n") .
- $text,
- [ { label => _("IP address"), val => \$intf->{IPADDR}, disabled => sub { $pump } },
- { label => _("Netmask"), val => \$intf->{NETMASK}, disabled => sub { $pump } },
- { label => _("Automatic IP"), val => \$pump, type => "bool", text => _("(bootp/dhcp)") },
- if_($intf->{wireless_eth},
- { label => "WIRELESS_MODE", val => \$intf->{WIRELESS_MODE}, list => [ "Ad-hoc", "Managed", "Master", "Repeater", "Secondary", "Auto"] },
- { label => "WIRELESS_ESSID", val => \$intf->{WIRELESS_ESSID} },
- { label => "WIRELESS_NWID", val => \$intf->{WIRELESS_NWID} },
- { label => "WIRELESS_FREQ", val => \$intf->{WIRELESS_FREQ} },
- { label => "WIRELESS_SENS", val => \$intf->{WIRELESS_SENS} },
- { label => "WIRELESS_RATE", val => \$intf->{WIRELESS_RATE} },
- { label => "WIRELESS_ENC_KEY", val => \$intf->{WIRELESS_ENC_KEY} },
- { label => "WIRELESS_RTS", val => \$intf->{WIRELESS_RTS} },
- { label => "WIRELESS_FRAG", val => \$intf->{WIRELESS_FRAG} },
- { label => "WIRELESS_IWCONFIG", val => \$intf->{WIRELESS_IWCONFIG} },
- { label => "WIRELESS_IWSPY", val => \$intf->{WIRELESS_IWSPY} },
- { label => "WIRELESS_IWPRIV", val => \$intf->{WIRELESS_IWPRIV} }
- ),
- ],
- complete => sub {
- $intf->{BOOTPROTO} = $pump ? "dhcp" : "static";
- return 0 if $pump;
- for (my $i = 0; $i < @fields; $i++) {
- unless (is_ip($intf->{$fields[$i]})) {
- $in->ask_warn('', _("IP address should be in format 1.2.3.4"));
- return (1,$i);
- }
- return 0;
- }
- if ($intf->{WIRELESS_FREQ} !~ /[0-9.]*[kGM]/) {
- $in->ask_warn('', _('Freq should have the suffix k, M or G (for example, "2.46G" for 2.46 GHz fre­
- quency), or add enough \'0\'.'));
- return (1,6);
- }
- if ($intf->{WIRELESS_RATE} !~ /[0-9.]*[kGM]/) {
- $in->ask_warn('', _('Rate should have the suffix k, M or G (for example, "11M" for 11M), or add enough \'0\'.'));
- return (1,8);
- }
- },
- focus_out => sub {
- $intf->{NETMASK} ||= netmask($intf->{IPADDR}) unless $_[0]
- }
- );
+ $in->ask_from(_("Configuring network device %s", $intf->{DEVICE}),
+ (_("Configuring network device %s", $intf->{DEVICE}) . ( $module ? _(" (driver %s)", $module) : '' ) ."\n\n") .
+ $text,
+ [ { label => _("IP address"), val => \$intf->{IPADDR}, disabled => sub { $pump } },
+ { label => _("Netmask"), val => \$intf->{NETMASK}, disabled => sub { $pump } },
+ { label => _("Automatic IP"), val => \$pump, type => "bool", text => _("(bootp/dhcp)") },
+ if_($intf->{wireless_eth},
+ { label => "WIRELESS_MODE", val => \$intf->{WIRELESS_MODE}, list => [ "Ad-hoc", "Managed", "Master", "Repeater", "Secondary", "Auto"] },
+ { label => "WIRELESS_ESSID", val => \$intf->{WIRELESS_ESSID} },
+ { label => "WIRELESS_NWID", val => \$intf->{WIRELESS_NWID} },
+ { label => "WIRELESS_FREQ", val => \$intf->{WIRELESS_FREQ} },
+ { label => "WIRELESS_SENS", val => \$intf->{WIRELESS_SENS} },
+ { label => "WIRELESS_RATE", val => \$intf->{WIRELESS_RATE} },
+ { label => "WIRELESS_ENC_KEY", val => \$intf->{WIRELESS_ENC_KEY} },
+ { label => "WIRELESS_RTS", val => \$intf->{WIRELESS_RTS} },
+ { label => "WIRELESS_FRAG", val => \$intf->{WIRELESS_FRAG} },
+ { label => "WIRELESS_IWCONFIG", val => \$intf->{WIRELESS_IWCONFIG} },
+ { label => "WIRELESS_IWSPY", val => \$intf->{WIRELESS_IWSPY} },
+ { label => "WIRELESS_IWPRIV", val => \$intf->{WIRELESS_IWPRIV} }
+ ),
+ ],
+ complete => sub {
+ $intf->{BOOTPROTO} = $pump ? "dhcp" : "static";
+ return 0 if $pump;
+ for (my $i = 0; $i < @fields; $i++) {
+ unless (is_ip($intf->{$fields[$i]})) {
+ $in->ask_warn('', _("IP address should be in format 1.2.3.4"));
+ return (1,$i);
+ }
+ return 0;
+ }
+ if ($intf->{WIRELESS_FREQ} !~ /[0-9.]*[kGM]/) {
+ $in->ask_warn('', _('Freq should have the suffix k, M or G (for example, "2.46G" for 2.46 GHz frequency), or add enough \'0\'.'));
+ return (1,6);
+ }
+ if ($intf->{WIRELESS_RATE} !~ /[0-9.]*[kGM]/) {
+ $in->ask_warn('', _('Rate should have the suffix k, M or G (for example, "11M" for 11M), or add enough \'0\'.'));
+ return (1,8);
+ }
+ },
+ focus_out => sub {
+ $intf->{NETMASK} ||= netmask($intf->{IPADDR}) unless $_[0]
+ }
+ );
}
sub configureNetworkNet {
@@ -340,7 +339,7 @@ sub configureNetworkNet {
$netc->{GATEWAY} ||= gateway($intf->{IPADDR});
$::isInstall and $in->set_help('configureNetworkHost');
- $in->ask_from_entries_refH(_("Configuring network"),
+ $in->ask_from(_("Configuring network"),
_("Please enter your host name.
Your host name should be a fully-qualified host name,
such as ``mybox.mylab.myco.com''.
@@ -359,7 +358,7 @@ sub miscellaneousNetwork {
my ($in, $clicked) = @_;
my $u = $::o->{miscellaneous} ||= {};
$::isInstall and $in->set_help('configureNetworkProxy');
- $::expert || $clicked and $in->ask_from_entries_refH('',
+ $::expert || $clicked and $in->ask_from('',
_("Proxies configuration"),
[ { label => _("HTTP proxy"), val => \$u->{http_proxy} },
{ label => _("FTP proxy"), val => \$u->{ftp_proxy} },
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 4c164f2ad..47abf7892 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -65,26 +65,26 @@ sub read_providers_backend { my ($file) = @_; map { /(.*?)=>/ } catMaybeCompress
sub ask_info2 {
my ($cnx, $netc) = @_;
$::isInstall and $in->set_help('configureNetworkDNS');
- $in->ask_from_entries_refH(_("Connection Configuration"),
- _("Please fill or check the field below"),
- [
- if__ ($cnx->{irq}, { label => _("Card IRQ"), val => \$cnx->{irq} }) ,
- if__ ($cnx->{mem}, { label => _("Card mem (DMA)"), val => \$cnx->{mem} }),
- if__ ($cnx->{io}, { label => _("Card IO"), val => \$cnx->{io} }),
- if__ ($cnx->{io0}, { label => _("Card IO_0"), val => \$cnx->{io0} }),
- if__ ($cnx->{io1}, { label => _("Card IO_1"), val => \$cnx->{io1} }),
- if__ ($cnx->{phone_in}, { label => _("Your personal phone number"), val => \$cnx->{phone_in} }),
- if__ ($netc->{DOMAINNAME2}, { label => _("Provider name (ex provider.net)"), val => \$netc->{DOMAINNAME2} }),
- if__ ($cnx->{phone_out}, { label => _("Provider phone number"), val => \$cnx->{phone_out} }),
- if__ ($netc->{dnsServer2}, { label => _("Provider dns 1 (optional)"), val => \$netc->{dnsServer2} }),
- if__ ($netc->{dnsServer3}, { label => _("Provider dns 2 (optional)"), val => \$netc->{dnsServer3} }),
- if__ ($cnx->{dialing_mode}, { label => _("Dialing mode"), val => \$cnx->{dialing_mode},list=>["auto","manual"]}),
- if__ ($cnx->{speed}, { label => _("Connection speed"), val => \$cnx->{speed}, list => ["64 Kb/s", "128 Kb/s"]}),
- if__ ($cnx->{huptimeout}, { label => _("Connection timeout (in sec)"), val => \$cnx->{huptimeout} }),
- if__ ($cnx->{login}, { label => _("Account Login (user name)"), val => \$cnx->{login} }),
- if__ ($cnx->{passwd}, { label => _("Account Password"), val => \$cnx->{passwd} }),
- ]
- ) or return;
+ $in->ask_from(_("Connection Configuration"),
+ _("Please fill or check the field below"),
+ [
+ if __ ($cnx->{irq}, { label => _("Card IRQ"), val => \$cnx->{irq} }) ,
+ if __ ($cnx->{mem}, { label => _("Card mem (DMA)"), val => \$cnx->{mem} }),
+ if __ ($cnx->{io}, { label => _("Card IO"), val => \$cnx->{io} }),
+ if __ ($cnx->{io0}, { label => _("Card IO_0"), val => \$cnx->{io0} }),
+ if __ ($cnx->{io1}, { label => _("Card IO_1"), val => \$cnx->{io1} }),
+ if __ ($cnx->{phone_in}, { label => _("Your personal phone number"), val => \$cnx->{phone_in} }),
+ if __ ($netc->{DOMAINNAME2}, { label => _("Provider name (ex provider.net)"), val => \$netc->{DOMAINNAME2} }),
+ if __ ($cnx->{phone_out}, { label => _("Provider phone number"), val => \$cnx->{phone_out} }),
+ if __ ($netc->{dnsServer2}, { label => _("Provider dns 1 (optional)"), val => \$netc->{dnsServer2} }),
+ if __ ($netc->{dnsServer3}, { label => _("Provider dns 2 (optional)"), val => \$netc->{dnsServer3} }),
+ if __ ($cnx->{dialing_mode}, { label => _("Dialing mode"), val => \$cnx->{dialing_mode},list=>["auto","manual"]}),
+ if __ ($cnx->{speed}, { label => _("Connection speed"), val => \$cnx->{speed}, list => ["64 Kb/s", "128 Kb/s"]}),
+ if __ ($cnx->{huptimeout}, { label => _("Connection timeout (in sec)"), val => \$cnx->{huptimeout} }),
+ if __ ($cnx->{login}, { label => _("Account Login (user name)"), val => \$cnx->{login} }),
+ if __ ($cnx->{passwd}, { label => _("Account Password"), val => \$cnx->{passwd} }),
+ ]
+ ) or return;
1;
}