From 7c14bb0fed100ee3ff36714aa0e3bb1299257149 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Thu, 22 Jan 2004 10:22:24 +0000 Subject: fix problem of list image --- pxe_wizard/Pxe.pm | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'pxe_wizard') diff --git a/pxe_wizard/Pxe.pm b/pxe_wizard/Pxe.pm index f575e7d6..a5a64e2c 100644 --- a/pxe_wizard/Pxe.pm +++ b/pxe_wizard/Pxe.pm @@ -109,6 +109,7 @@ $o->{pages} = { }, post => sub { -f "$X86/drakwizard_pxe" or return 'error_needpxe'; + @list_menu or return 'addimg'; if ($o->{var}{wiz_level} == 2) { return 'addimg' } elsif ($o->{var}{wiz_level} == 3) { @@ -129,7 +130,7 @@ $o->{pages} = { { label => "PXE description:", val => \$o->{var}{DESCR} }, { label => "Full path to boot image:", val => \$o->{var}{IMG} }, ], - + post => \&test_data, next => 'summaryadd', }, removeimg => { @@ -141,6 +142,7 @@ $o->{pages} = { }, modifyimg => { name => N("Add option to boot image:") . "\n\n" . N("Please choose PXE boot image to modify"), + data => [ { label => N("Boot image to configure:"), val => \$o->{var}{IMGTOMODIFY}, fixed_list => \@list_menu }, ], @@ -234,11 +236,25 @@ $o->{pages} = { endadd => { name => N("Congratulations"), data => [ { label => N("The wizard successfully add a PXE boot image.") } ], + post => sub { + @list_menu =(); + foreach (cat_($PXEDEFAULT)) { + my ($ent) = /# TAG: (\w+)_BEGIN/; + ! $ent or push @list_menu,$ent; + } + }, next => 'welcome', }, endremove => { name => N("Congratulations"), data => [ { label => N("The wizard successfully remove a PXE boot image.") } ], + post => sub { + @list_menu =(); + foreach (cat_($PXEDEFAULT)) { + my ($ent) = /# TAG: (\w+)_BEGIN/; + ! $ent or push @list_menu,$ent; + } + }, next => 'welcome', }, endmodify => { @@ -334,16 +350,6 @@ sub remove_in_menu { output($PXEDEFAULT, $begin, $end); } -# get list of available PXE boot images -sub list_menu { - my @list_menu; - foreach (cat_($PXEDEFAULT)) { - my ($ent) = /# TAG: (\w+)_BEGIN/; - ! $ent or push @list_menu,$ent; #print "$ent\n"; - } - @list_menu; -} - # remove entry in help.txt sub remove_in_help { my ($NAME) = @_; -- cgit v1.2.1