summaryrefslogtreecommitdiffstats
path: root/drakwizard.pl
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-08-07 14:17:33 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-08-07 14:17:33 +0000
commit87be22025b6a389768602ea44567cf54fd47ca22 (patch)
treec81fc39241646e6eb1a20139110e94562f44f151 /drakwizard.pl
parentdbd50c9c4890f3e1c489ffd1bcc4ece19f89bdc5 (diff)
downloaddrakwizard-87be22025b6a389768602ea44567cf54fd47ca22.tar
drakwizard-87be22025b6a389768602ea44567cf54fd47ca22.tar.gz
drakwizard-87be22025b6a389768602ea44567cf54fd47ca22.tar.bz2
drakwizard-87be22025b6a389768602ea44567cf54fd47ca22.tar.xz
drakwizard-87be22025b6a389768602ea44567cf54fd47ca22.zip
no prev when it is impossible
Diffstat (limited to 'drakwizard.pl')
-rwxr-xr-xdrakwizard.pl30
1 files changed, 18 insertions, 12 deletions
diff --git a/drakwizard.pl b/drakwizard.pl
index 49324e4f..3ce68898 100755
--- a/drakwizard.pl
+++ b/drakwizard.pl
@@ -67,6 +67,8 @@ sub get_parameter {
my $old_page = $page;
push @$o, $page = { %$leaf };
$old_page->{next_page} = $page;
+ if ($leaf->{canBack} =~ /.*false.*/) { $page->{no_prev} = 1}
+ if ($leaf->{canCancel} =~ /.*false.*/) { $page->{no_cancel} = 1}
},
Target => sub {
$page->{Target}->{jumpIndex}->{$leaf->{jumpIndex}} = $leaf->{targetName};
@@ -108,7 +110,7 @@ sub find_page {
sub display {
my ($o, $page) = @_;
- if ($page->{name} eq $welcome->{name}) {
+ if ($page->{no_prev} || $page->{no_cancel}) {
$::Wizard_no_previous = 1;
}
if ($page->{nextFinish} eq 'true') {
@@ -155,12 +157,12 @@ sub display {
$in->ask_from(translate($page->{name}), translate($page->{info}),
\@data) or navigation($o, $page->{old_page});
foreach(@{$page->{freetext}}) {
- if($_->{main_order} eq 'bool'){
- $ENV{$variable{$_->{variableName}}} = $ENV{$variable{$_->{variableName}}} ? 1 : 0;
- $bitfield{$variable{$_->{variableName}}} = $ENV{$variable{$_->{variableName}}} ? "enabled" : "disabled";
- }
- $ENV{$chooser_var} = $chooser_hash{$ENV{$chooser_var}};
- }
+ if($_->{main_order} eq 'bool'){
+ $ENV{$variable{$_->{variableName}}} = $ENV{$variable{$_->{variableName}}} ? 1 : 0;
+ $bitfield{$variable{$_->{variableName}}} = $ENV{$variable{$_->{variableName}}} ? "enabled" : "disabled";
+ }
+ $ENV{$chooser_var} = $chooser_hash{$ENV{$chooser_var}};
+ }
}
}
undef $::Wizard_no_previous;
@@ -178,8 +180,8 @@ sub navigation {
if ($page->{Target}->{jumpIndex}) {
find_page($o, $page->{Target}->{jumpIndex}->{int($modStatus)}), $page;
}
- elsif ($page->{jumpPage}) {
- find_page($o, $page->{jumpPage}), $page->{old_page};
+ else {
+ $page->{next_page}, $page->{old_page};
}
}
elsif ($page->{jumpScript}) {
@@ -189,16 +191,20 @@ sub navigation {
find_page($o, $page->{Target}->{jumpIndex}->{$?}), $page;
}
else {
- $page->{next_page}, $page->{old_page};
+ $page->{next_page}, $page;
}
}
elsif ($page->{subWizard}) {
my $sub_o = [];
my $sub_xmltree = XML::Parser->new(Style => 'Tree')->parsefile($page->{subWizard});
get_parameter($sub_o, $sub_xmltree);
- eval { navigation($sub_o, $sub_o->[0]); };
+ eval {navigation($sub_o, $sub_o->[0]); };
$in->exit if $@ =~ /^wizcancel/;
- $o->[0], undef;
+ $page->{old_page}->{no_prev} = 1;
+ $o->[0], $page, undef;
+ }
+ elsif ($page->{jumpPage}) {
+ find_page($o, $page->{jumpPage}), $page->{old_page};
}
else {
$page->{next_page}, $page;