summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-01-08 17:09:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-01-08 17:09:32 +0000
commit6daae2c3743007b992a106e30255cf8711c5b884 (patch)
tree872fec74b8f9171b57c7e86438092f6bc5519d73
parent3acf1ca79d7aa12274884ecf776f1c85729e4ddb (diff)
downloaddrakx-6daae2c3743007b992a106e30255cf8711c5b884.tar
drakx-6daae2c3743007b992a106e30255cf8711c5b884.tar.gz
drakx-6daae2c3743007b992a106e30255cf8711c5b884.tar.bz2
drakx-6daae2c3743007b992a106e30255cf8711c5b884.tar.xz
drakx-6daae2c3743007b992a106e30255cf8711c5b884.zip
(ask_from_treelistf, ask_from_treelist): now use ask_from_entries_refH
(ask_from_entries_refH_powered): remove "1;" (was there for debugging)
-rw-r--r--perl-install/interactive.pm20
1 files changed, 6 insertions, 14 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index a99b172ff..fd1fbe059 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -131,22 +131,15 @@ sub ask_from_listf_no_check {
}
}
-sub ask_from_treelistf {
- my ($o, $title, $message, $separator, $f, $l, $def) = @_;
- my (@l,%l); my $i = 0; foreach (@$l) {
- my $v = $f->($_, $i++);
- push @l, $v;
- $l{$v} = $_;
- }
- my $r = ask_from_treelist($o, $title, $message, $separator, \@l, defined $def ? $f->($def) : $def) or return;
- $l{$r};
-}
-
sub ask_from_treelist {
my ($o, $title, $message, $separator, $l, $def) = @_;
- $o->ask_from_treelistW($title, [ deref($message) ], $separator, [ sort @$l ], $def || $l->[0]);
+ ask_from_treelistf($o, $title, $message, $separator, undef, $l, $def);
+}
+sub ask_from_treelistf {
+ my ($o, $title, $message, $separator, $f, $l, $def) = @_;
+ ask_from_entries_refH($o, $title, $message, [ { val => \$def, separator => $separator, list => $l, format => $f } ]);
+ $def;
}
-
sub ask_many_from_list {
my ($o, $title, $message, @l) = @_;
@@ -232,7 +225,6 @@ sub ask_from_entries_refH_powered {
my ($o, $common, $l) = @_;
ask_from_entries_refH_powered_normalize($o, $common, $l);
$o->ask_from_entries_refW($common, [ grep { !$_->{advanced} } @$l ], [ grep { $_->{advanced} } @$l ]);
- 1;
}
sub ask_from_entries_refH_powered_no_check {
my ($o, $common, $l) = @_;