summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdrakwizard.pl67
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}
- }
-}