summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive/newt.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-09-05 22:03:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-09-05 22:03:14 +0000
commit4cabeab4360291f5db4c6a3ef5a0a20922f6d862 (patch)
tree6fd4f7e11f2ef5358c324ae812e4bde1602d646b /perl-install/interactive/newt.pm
parenta56b6bf9d29aab40564f3a1c0ac0d9fe7d910e2e (diff)
downloaddrakx-4cabeab4360291f5db4c6a3ef5a0a20922f6d862.tar
drakx-4cabeab4360291f5db4c6a3ef5a0a20922f6d862.tar.gz
drakx-4cabeab4360291f5db4c6a3ef5a0a20922f6d862.tar.bz2
drakx-4cabeab4360291f5db4c6a3ef5a0a20922f6d862.tar.xz
drakx-4cabeab4360291f5db4c6a3ef5a0a20922f6d862.zip
special case to handle many buttons in newt: replacing with something alike ask_from_list (useful for XFdrake)
Diffstat (limited to 'perl-install/interactive/newt.pm')
-rw-r--r--perl-install/interactive/newt.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/perl-install/interactive/newt.pm b/perl-install/interactive/newt.pm
index 37c5a62ef..91372df37 100644
--- a/perl-install/interactive/newt.pm
+++ b/perl-install/interactive/newt.pm
@@ -61,6 +61,27 @@ sub checkval { $_[0] && $_[0] ne ' ' ? '*' : ' ' }
sub ask_fromW {
my ($o, $common, $l, $l2) = @_;
+
+ if (grep { $_->{type} ne 'button' } @$l or @$l < 5) {
+ &ask_fromW_real;
+ } else {
+ my $r;
+ do {
+ my @choices = map {
+ my $s = simplify_string(may_apply($_->{format}, ${$_->{val}}));
+ $s = "$_->{label}: $s" if $_->{label};
+ { label => $s, clicked_may_quit => $_->{clicked_may_quit} }
+ } @$l;
+ #- replace many buttons with a list
+ my $new_l = [ { val => \$r, type => 'list', list => \@choices, format => sub { $_[0]{label} }, sort => 0 } ];
+ ask_fromW_real($o, $common, $new_l, $l2) or return;
+ } until $r->{clicked_may_quit}->();
+ 1;
+ }
+}
+
+sub ask_fromW_real {
+ my ($o, $common, $l, $l2) = @_;
my $ignore; #-to handle recursivity
my $old_focus = -2;