summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-02-13 23:16:46 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-02-13 23:16:46 +0000
commit68121a2c20fbf2ac39f64ab459c7e190978aafd7 (patch)
tree36a32f3af531ce91f7d14792b46b4f74360f0e66
parent11d68caab112f44448177ffda23a8a9a88b63505 (diff)
downloaddrakx-68121a2c20fbf2ac39f64ab459c7e190978aafd7.tar
drakx-68121a2c20fbf2ac39f64ab459c7e190978aafd7.tar.gz
drakx-68121a2c20fbf2ac39f64ab459c7e190978aafd7.tar.bz2
drakx-68121a2c20fbf2ac39f64ab459c7e190978aafd7.tar.xz
drakx-68121a2c20fbf2ac39f64ab459c7e190978aafd7.zip
enable to pass untranslated defaut to yes/no or ok/cancel like
questions by translating value at runtime
-rw-r--r--perl-install/wizards.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perl-install/wizards.pm b/perl-install/wizards.pm
index 86ebd95a5..18083c4d7 100644
--- a/perl-install/wizards.pm
+++ b/perl-install/wizards.pm
@@ -155,7 +155,8 @@ sub process {
my $name = ref($page->{name}) ? $page->{name}->() : $page->{name};
my %yesno = (yes => N("Yes"), no => N("No"));
my $yes = $page->{default};
- $data2 = [ { val => \$yes, type => 'list', list => [ values %yesno ], gtk => { use_boxradio => 1 } } ] if $page->{type} eq "yesorno";
+ $data2 = [ { val => \$yes, type => 'list', list => [ keys %yesno ], format => sub { $yesno{$_[0]} },
+ gtk => { use_boxradio => 1 } } ] if $page->{type} eq "yesorno";
my $a;
if (ref $data2 eq 'ARRAY' && @$data2) {
$a = $in->ask_from_({ title => $o->{name},
@@ -172,7 +173,7 @@ sub process {
# step forward:
push @steps, $next if !$page->{ignore} && $steps[-1] ne $next;
my $current = $next;
- $next = defined $page->{post} ? $page->{post}($page->{type} eq "yesorno" ? $yes eq $yesno{yes} : $a) : 0;
+ $next = defined $page->{post} ? $page->{post}($page->{type} eq "yesorno" ? $yes eq 'yes' : $a) : 0;
return if $page->{end};
if (!$next) {
if (!defined $o->{pages}{$next}) {