From 775e9840115458aa09bc5c10a73123bc3c7f9c4c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 9 Jan 2001 12:43:45 +0000 Subject: (ask_from_listf_no_check): add focus_cancel set if defaults to second element of the list (for a 2 element list) --- perl-install/interactive.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'perl-install') diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index e23206d4c..84c5fe6cc 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -123,8 +123,10 @@ sub ask_from_listf_no_check { my ($o, $title, $message, $f, $l, $def, $help) = @_; if (@$l <= 2) { - ask_from_entries_refH_powered_no_check($o, { title => $title, messages => $message, ok => $l->[0] && may_apply($f, $l->[0]), cancel => $l->[1] && may_apply($f, $l->[1]) }, []) - ? $l->[0] : $l->[1]; + ask_from_entries_refH_powered_no_check($o, + { title => $title, messages => $message, ok => $l->[0] && may_apply($f, $l->[0]), + if_($l->[1], cancel => may_apply($f, $l->[1]), focus_cancel => $def eq $l->[1]) }, [] + ) ? $l->[0] : $l->[1]; } else { ask_from_entries_refH($o, $title, $message, [ { val => \$def, type => 'list', list => $l, help => $help, format => $f } ]); $def; -- cgit v1.2.1