From 4fb359379d79b1adc17d6f94815ac08691a411d2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 3 Feb 2002 19:15:20 +0000 Subject: since "format" is now handled for combo boxes, combo boxes are used in much too many places. Fix this by forcing type "list" for some cases, and using type "list" when a ask_from has only one entry --- perl-install/interactive.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'perl-install/interactive.pm') diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index a9d98c9f4..c3c76c0af 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -260,7 +260,8 @@ sub ask_from_normalize { } $e->{type} = 'iconlist' if $e->{icon2f}; $e->{type} = 'treelist' if $e->{separator}; - add2hash_($e, { not_edit => 1, type => 'combo' }); + add2hash_($e, { not_edit => 1 }); + $e->{type} ||= $e->{not_edit} && @$l == 1 ? 'list' : 'combo'; ${$e->{val}} = $l->[0] if ($e->{type} ne 'combo' || $e->{not_edit}) && !member(${$e->{val}}, @$l); if ($e->{type} eq 'combo' && $e->{format}) { my @l = map { $e->{format}->($_) } @{$e->{list}}; -- cgit v1.2.1