summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-10-08 15:09:08 +0000
committerThierry Vignaud <tv@mandriva.org>2008-10-08 15:09:08 +0000
commit818d822ea4825e85a58be128bbd2de8db5e44266 (patch)
tree5735e0a358eece8c2279e91375183b28af5430e7
parent8cbcb1f65e4f802a5dab2b7a0d791fe7a53307ff (diff)
downloaddrakx-backup-do-not-use-818d822ea4825e85a58be128bbd2de8db5e44266.tar
drakx-backup-do-not-use-818d822ea4825e85a58be128bbd2de8db5e44266.tar.gz
drakx-backup-do-not-use-818d822ea4825e85a58be128bbd2de8db5e44266.tar.bz2
drakx-backup-do-not-use-818d822ea4825e85a58be128bbd2de8db5e44266.tar.xz
drakx-backup-do-not-use-818d822ea4825e85a58be128bbd2de8db5e44266.zip
(compute_sizes,filter_widget) properly handle big text in list such as
security level descriptions (#43561)
-rw-r--r--perl-install/install/NEWS3
-rw-r--r--perl-install/interactive/curses.pm6
2 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index a1a9fe58c..43e53426c 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,5 +1,8 @@
- drakx-in-chroot:
o do not start an X server if using --text
+- text mode installer:
+ o properly handle big text in list such as security level
+ descriptions (#43561)
- continue installing if an advertising image is corrupted (#37674)
Version 11.68 - 3 October 2008
diff --git a/perl-install/interactive/curses.pm b/perl-install/interactive/curses.pm
index b8da3c29a..b33caaad9 100644
--- a/perl-install/interactive/curses.pm
+++ b/perl-install/interactive/curses.pm
@@ -80,7 +80,7 @@ sub filter_widget {
#- combo does not allow modifications
$e->{type} = 'entry' if $e->{type} eq 'combo' && !$e->{not_edit};
- $e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ];
+ $e->{formatted_list} = [ map { my $t = warp_text(may_apply($e->{format}, $_), 80); $t } @{$e->{list}} ];
$e->{default_curses} ||= delete $e->{curses};
}
@@ -163,8 +163,8 @@ sub compute_size {
$e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(@{$e->{formatted_list}}), 10, 4);
$e->{curses}{'-width'} ||= max(map { length } @{$e->{formatted_list}}) + 7;
} elsif ($e->{type} =~ /list/) {
- $e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(@{$e->{formatted_list}}), 5, 4);
- $e->{curses}{'-width'} ||= max(map { length } @{$e->{formatted_list}}) + 3;
+ $e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(map { split("\n", $_) } @{$e->{formatted_list}}), 5, 4);
+ $e->{curses}{'-width'} ||= max(map { length } map { split("\n", $_) } @{$e->{formatted_list}}) + 3;
} elsif ($e->{type} eq 'button') {
my $s = sprintf('< %s >', may_apply($e->{format}, ${$e->{val}}));
$e->{curses}{'-width'} ||= length($s);