summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-01-13 18:02:55 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-01-13 18:02:55 +0000
commitb997f40185c57df98f9eefc1b47597cfb973e213 (patch)
treeed5784d2d670993c8e2b841744a917eefde905a6
parent71bcdc593b6e1267ca99419afec913aea4f506e8 (diff)
downloaddrakx-backup-do-not-use-b997f40185c57df98f9eefc1b47597cfb973e213.tar
drakx-backup-do-not-use-b997f40185c57df98f9eefc1b47597cfb973e213.tar.gz
drakx-backup-do-not-use-b997f40185c57df98f9eefc1b47597cfb973e213.tar.bz2
drakx-backup-do-not-use-b997f40185c57df98f9eefc1b47597cfb973e213.tar.xz
drakx-backup-do-not-use-b997f40185c57df98f9eefc1b47597cfb973e213.zip
add support for yes/no questions
-rw-r--r--perl-install/wizards.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl-install/wizards.pm b/perl-install/wizards.pm
index dde2453db..04a74565d 100644
--- a/perl-install/wizards.pm
+++ b/perl-install/wizards.pm
@@ -152,11 +152,15 @@ sub process {
}
}
my $name = ref($page->{name}) ? $page->{name}->() : $page->{name};
+ my %yesno = (yes => N("Yes"), no => N("No"));
+ @data2 = [ { val => \$yes, type => 'list', list => [ values %yesno ] } ] if $page->{type} eq "yesorno";
my $a = $in->ask_from_({ title => $o->{name},
messages => $name,
callbacks => { map { $_ => $page->{$_} || $default_callback{$_} } qw(focus_out complete) },
if_($page->{interactive_help_id}, interactive_help_id => $page->{interactive_help_id}),
}, $data2);
+ # interactive->ask_yesorno does not support stepping forward or backward:
+ $a = $a eq $yesno{yes} if $page->{type} eq "yesorno";
if ($a) {
# step forward:
push @steps, $next if !$page->{ignore} && $steps[-1] ne $next;