From 64f9dabca60dc279a29cfa31dd1f5a4ca45edb7c Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Fri, 2 Aug 2002 15:13:47 +0000 Subject: improved subWizard by catching cancel and fixed cancel warnings --- drakwizard.pl | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'drakwizard.pl') diff --git a/drakwizard.pl b/drakwizard.pl index 039e69ba..7ddcdeb1 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -107,11 +107,12 @@ sub display { $::Wizard_no_previous = 1; $in->ask_okcancel(translate($page->{name}), translate($page->{info})) or quit_global($in, 0); - $in->exit; - } elsif (!$page->{freetext}) { + die; + } + elsif (!$page->{freetext}) { $in->ask_okcancel(translate($page->{name}), - translate($page->{info})) or navigation($o, $page->{old_page}); - } + translate($page->{info})) or navigation($o, $page->{old_page}); + } else { my $valeur; my @liste; @@ -169,7 +170,7 @@ sub navigation { find_page($o, $page->{jumpPage}), $page->{old_page}; } } - elsif($page->{jumpScript}) { + elsif ($page->{jumpScript}) { system("source $lib_script ; $page->{jumpScript}"); if ($page->{Target}->{jumpIndex}) { $? = $? >> 8; @@ -179,11 +180,13 @@ sub navigation { $page->{next_page}, $page->{old_page}; } } - elsif($page->{subWizard}) { - my $o = []; - my $xmltree = XML::Parser->new(Style => 'Tree')->parsefile($page->{subWizard}); - get_parameter($o, $xmltree); - eval { navigation($o, $o->[0]); }; + 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]); }; + $in->exit if $@ =~ /wizcancel/; + $o->[0], undef; } else { $page->{next_page}, $page; @@ -204,4 +207,4 @@ $::direct = /-direct/; $::Wizard_no_previous = 1; $::isWizard = 1; eval { navigation($o, $o->[0]); }; -$in->exit if $@ =~ /wizcancel/; +$in->exit; -- cgit v1.2.1