diff options
author | Olivier Blin <oblin@mandriva.org> | 2006-01-03 17:56:35 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2006-01-03 17:56:35 +0000 |
commit | f3248a6f792b59537a5b9ae152fa372ffe80956f (patch) | |
tree | c2dac05167eadb93adba4d22c5f62b48cb500fb8 | |
parent | 039043dce270c730cd0880b30f18fd0665a8d5f9 (diff) | |
download | drakwizard-f3248a6f792b59537a5b9ae152fa372ffe80956f.tar drakwizard-f3248a6f792b59537a5b9ae152fa372ffe80956f.tar.gz drakwizard-f3248a6f792b59537a5b9ae152fa372ffe80956f.tar.bz2 drakwizard-f3248a6f792b59537a5b9ae152fa372ffe80956f.tar.xz drakwizard-f3248a6f792b59537a5b9ae152fa372ffe80956f.zip |
drop old wizard stuff, use the wizards module
-rwxr-xr-x | drakwizard.pl | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/drakwizard.pl b/drakwizard.pl index 4b52d0a4..27d61fa4 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -86,69 +86,6 @@ if ($err) { $in->exit; } -$::in = $in; -if ($wiz->{use_new_data_structure}) { - my $wizard = wizards->new($wiz); - $wizard->safe_process($in); -} else { - wizard($wiz); -} +my $wizard = wizards->new($wiz); +$wizard->safe_process($in); $in->exit; - -sub wizard { - my ($o) = @_; - my $page = $o->{pages}{welcome}; - $::Wizard_title = $o->{name}; - #$::Wizard_pix_up = $o->{defaultimage}; - if ($> && !$o->{allow_user} && !$::testing) { - require_root_capability(); - } - wizards::check_rpm($o->{needed_rpm}) if $o->{needed_rpm} && !$::testing; - if (defined $o->{init}) { - my ($res, $msg) = &{$o->{init}}; - if (!$res) { - $in->ask_okcancel(N("Error"), $msg); - exit() if ! $::testing - } - } - $::in = $in; # so that steps "complete" callbacks can call interactive->ask_warn() :-( - - my $next = 'welcome'; - my @steps; - while (1) { - undef $::Wizard_no_previous; - undef $::Wizard_no_cancel; - $::Wizard_no_previous = $page->{no_back}; - $::Wizard_finished = $page->{end}; - $::Wizard_no_cancel = $page->{no_cancel} || $page->{end}; - defined $page->{pre} and $page->{pre}(); - # FIXME or the displaying fails - my $data = defined $page->{data} ? ref $page->{data} ? $page->{data} : [ { label => '' } ] : [ { label => '' } ]; - my $data2; - foreach my $d (@$data) { - $d->{fixed_val} and $d->{val} = ${$d->{fixed_val}}; - if ($d->{fixed_list}) { - $d->{list} = $d->{fixed_list}; - } - if (ref $d->{boolean_list} && ref ${$d->{boolean_list}}) { - my $i; - foreach (@{${$d->{boolean_list}}}) { - push @$data2, { text => $_, type => 'bool', val => \${$d->{val}}->[$i], disabled => $d->{disabled} }; - $i++ - } - } else { - push @$data2, $d - } - } - my $a = $in->ask_from($o->{name}, $page->{name}, $data2, if_($page->{complete}, complete => $page->{complete})); - if ($a) { - push @steps, $next if !$page->{ignore} && $steps[-1] ne $next; - $next = defined $page->{post} ? $page->{post}() : 0; - defined $o->{pages}{$next} or $next = $page->{next}; - } else { - $next = pop @steps - } - $next or return; - $page = $o->{pages}{$next} - } -} |