summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-02-13 23:12:05 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-02-13 23:12:05 +0000
commitb11bd6c8151fd5052206d03d42dc2cf6c2a1d5fa (patch)
tree6d253f4f42bf0d112ac5771b3054e54adfd64046
parentcb8ac1d0b61ab40e134248e8e1371930a869fecb (diff)
downloaddrakx-b11bd6c8151fd5052206d03d42dc2cf6c2a1d5fa.tar
drakx-b11bd6c8151fd5052206d03d42dc2cf6c2a1d5fa.tar.gz
drakx-b11bd6c8151fd5052206d03d42dc2cf6c2a1d5fa.tar.bz2
drakx-b11bd6c8151fd5052206d03d42dc2cf6c2a1d5fa.tar.xz
drakx-b11bd6c8151fd5052206d03d42dc2cf6c2a1d5fa.zip
add 'default' field in order to be able to enforce default answer for
yes/no like questions or when data does not conatains any fields (needed for last #7705 bit)
-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 e9f493eac..e875de052 100644
--- a/perl-install/wizards.pm
+++ b/perl-install/wizards.pm
@@ -31,6 +31,7 @@ wizards - a layer on top of interactive that ensure proper stepping
post => sub { }, # code executing when stepping forward;
# returned value is next step name (it overrides "next" field)
end => , # is it the last step ?
+ default => , # default answer for yes/no or when data does not conatains any fields
no_cancel => , # do not display the cancel button (eg for first step)
no_back => , # do not display the back button (eg for first step)
ignore => , # do not stack this step for back stepping (eg for warnings and the like steps)
@@ -153,7 +154,7 @@ sub process {
}
my $name = ref($page->{name}) ? $page->{name}->() : $page->{name};
my %yesno = (yes => N("Yes"), no => N("No"));
- my $yes;
+ my $yes = $page->{default};
$data2 = [ { val => \$yes, type => 'list', list => [ values %yesno ], gtk => { use_boxradio => 1 } } ] if $page->{type} eq "yesorno";
my $a;
if (ref $data2 eq 'ARRAY' && @$data2) {
@@ -163,7 +164,7 @@ sub process {
if_($page->{interactive_help_id}, interactive_help_id => $page->{interactive_help_id}),
}, $data2);
} else {
- $a = $in->ask_okcancel($o->{name}, $name);
+ $a = $in->ask_okcancel($o->{name}, $name, $yes);
}
# interactive->ask_yesorno does not support stepping forward or backward:
$a = $yes if $a && $page->{type} eq "yesorno";