summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-23 20:52:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-23 20:52:20 +0000
commit51fbcc856508c46654861820dfe59ce5767d0330 (patch)
tree1cc7e1cb550c1f177647128c6a6fc9190e991448 /perl-install/interactive
parentbaab89f6bc846a46ad7836cb7c21263699bcf5db (diff)
downloaddrakx-51fbcc856508c46654861820dfe59ce5767d0330.tar
drakx-51fbcc856508c46654861820dfe59ce5767d0330.tar.gz
drakx-51fbcc856508c46654861820dfe59ce5767d0330.tar.bz2
drakx-51fbcc856508c46654861820dfe59ce5767d0330.tar.xz
drakx-51fbcc856508c46654861820dfe59ce5767d0330.zip
fix special case "for license agreement": only use it for long messages, and fix {format} use
Diffstat (limited to 'perl-install/interactive')
-rw-r--r--perl-install/interactive/newt.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/interactive/newt.pm b/perl-install/interactive/newt.pm
index 1088c6efb..873c27d10 100644
--- a/perl-install/interactive/newt.pm
+++ b/perl-install/interactive/newt.pm
@@ -62,13 +62,13 @@ sub checkval { $_[0] && $_[0] ne ' ' ? '*' : ' ' }
sub ask_fromW {
my ($o, $common, $l, $l2) = @_;
- if (@$l == 1 && $l->[0]{list} && @{$l->[0]{list}} == 2) {
+ if (@$l == 1 && $l->[0]{list} && @{$l->[0]{list}} == 2 && listlength(map { split "\n" } @{$common->{messages}}) > 20) {
#- special ugly case, esp. for license agreement
my $e = $l->[0];
my $ok_disabled = $common->{callbacks} && delete $common->{callbacks}{ok_disabled};
($common->{ok}, $common->{cancel}) = map { may_apply($e->{format}, $_) } @{$e->{list}};
do {
- ${$e->{val}} = ask_fromW_real($o, $common, [], $l2) ? $common->{ok} : $common->{cancel};
+ ${$e->{val}} = ask_fromW_real($o, $common, [], $l2) ? $e->{list}[0] : $e->{list}[1];
} while $ok_disabled && $ok_disabled->();
1;
} elsif ((any { $_->{type} ne 'button' } @$l) || @$l < 5) {