summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/interactive.pm22
1 files changed, 12 insertions, 10 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 619eeb3ab..3db0085f4 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -177,17 +177,19 @@ sub ask_from_listf_no_check {
my ($o, $title, $message, $f, $l, $def, $help) = @_;
if (@$l <= 2 && !$::isWizard) {
- my $ret = eval {
- ask_from_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];
- };
- die if $@ && $@ !~ /^wizcancel/;
- $@ ? undef : $ret;
- } else {
- ask_from($o, $title, $message, [ { val => \$def, type => 'list', list => $l, help => $help, format => $f } ]) && $def;
+ my ($ok, $cancel) = map { $_ && may_apply($f, $_) } @$l;
+ if (length "$ok$cancel" < 70) {
+ my $ret = eval {
+ ask_from_no_check($o,
+ { title => $title, messages => $message, ok => $ok,
+ if_($cancel, cancel => $cancel, focus_cancel => $def eq $l->[1]) }, []
+ ) ? $l->[0] : $l->[1];
+ };
+ die if $@ && $@ !~ /^wizcancel/;
+ return $@ ? undef : $ret;
+ }
}
+ ask_from($o, $title, $message, [ { val => \$def, type => 'list', list => $l, help => $help, format => $f } ]) && $def;
}
sub ask_from_treelist {