summaryrefslogtreecommitdiffstats
path: root/drakwizard.pl
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-07-31 15:40:07 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-07-31 15:40:07 +0000
commit70581c079d6fc5db4a9de832d581034272a53aea (patch)
tree8990068df936a7e7c80d804a7edb4a7614d69885 /drakwizard.pl
parentca2638fca3e15e11a6840a16e062bba1d4b9c82f (diff)
downloaddrakwizard-70581c079d6fc5db4a9de832d581034272a53aea.tar
drakwizard-70581c079d6fc5db4a9de832d581034272a53aea.tar.gz
drakwizard-70581c079d6fc5db4a9de832d581034272a53aea.tar.bz2
drakwizard-70581c079d6fc5db4a9de832d581034272a53aea.tar.xz
drakwizard-70581c079d6fc5db4a9de832d581034272a53aea.zip
$::isWizard missed
Diffstat (limited to 'drakwizard.pl')
-rwxr-xr-xdrakwizard.pl75
1 files changed, 32 insertions, 43 deletions
diff --git a/drakwizard.pl b/drakwizard.pl
index 81871a4d..089f37ec 100755
--- a/drakwizard.pl
+++ b/drakwizard.pl
@@ -25,6 +25,8 @@ use vars qw($wizard_title $lib_script $perl_module %variable $in);
use XML::Parser;
use standalone;
use interactive;
+use MDK::Common::Func;
+use common;
defined($ARGV[0]) or die "Usage: drakwizard *.wiz\n";
my $in = 'interactive'->vnew('su', 'default');
@@ -41,9 +43,10 @@ sub get_parameter {
$page = get_parameter($o, $leaf, $tag, $page);
} elsif (ref($leaf) eq 'HASH') {
my $common_freetext_chooser;
- my %actions = (Wizard => sub {
- ($wizard_title, $lib_script, $perl_module) = @{$leaf}{qw(wizardTitle libScript perlModule)};
- },
+ my %actions = (
+ Wizard => sub {
+ ($wizard_title, $lib_script, $perl_module) = @{$leaf}{qw(wizardTitle libScript perlModule)};
+ },
Variable => sub {
$variable{$leaf->{name}} = $leaf->{shellVariable};
$ENV{$leaf->{shellVariable}} = $leaf->{defaultValue};
@@ -88,43 +91,43 @@ sub display {
my ($o, $page) = @_;
if ( $page->{nextFinish} eq 'true') {
- $::Wizard_no_previous = 1;
- $in->ask_okcancel(translate($page->{name}),
- translate($page->{info}), 1) or quit_global($in, 0);
- $in->exit;
+ $::Wizard_no_previous = 1;
+ $in->ask_okcancel(translate($page->{name}),
+ translate($page->{info}), 1) or quit_global($in, 0);
+ $in->exit;
} elsif (!$page->{freetext}) {
- $in->ask_okcancel(translate($page->{name}),
- translate($page->{info}), 1) or navigation($o, $page->{old_page});
- } else {
+ $in->ask_okcancel(translate($page->{name}),
+ translate($page->{info}), 1) or navigation($o, $page->{old_page});
+ }
+ else {
my $valeur;
my @liste;
my @data = map {
- for ($_->{fillScript}) {
- system("source $lib_script ; $_->{fillScript}");
- }
+ #for ($_->{fillScript}) {
+ # system("source $lib_script ; $_->{fillScript}");
+ # }
if($_->{main_order} eq 'combo'){
if($_->{fillScript}){
$valeur = `$_->{fillScript}`;
- while( $valeur =~ /(.+)\n/g ){
+ while( $valeur =~ /(.+)\n/g){
push @liste, $1;
}
}else{
@liste = @{$_->{Option}};
+ push @list, $1;
}
}
($_->{main_order} eq 'entry') ? { label => translate($_->{helpText}),
val => \$ENV{$variable{$_->{variableName}}}, type => $_->{main_order} }
: ($_->{main_order} eq 'bool') ? { val => \$ENV{$variable{$_->{variableName}}}, type => $_->{main_order},
text => translate($_->{helpText}, advanced => 1) }
- : { label => translate($_->{helpText}), val => \$ENV{$variable{$_->{variableName}}},
- list => [@liste, ""], type => $_->{main_order} };
+ : { label => translate($_->{helpText}), val => \$ENV{$variable{$_->{variableName}}}},
+ list => [@liste, ""], type => $_->{main_order} };
} @{$page->{freetext}};
if($page->{executionLevel} eq 'NORMAL'){
-
$in->ask_from(translate($page->{name}), translate($page->{info}),
\@data) or navigation($o, $page->{old_page});
-
- foreach(@{$page->{freetext}}){
+ foreach(@{$page->{freetext}}) {
if($_->{main_order} eq 'bool'){
$ENV{$variable{$_->{variableName}}} = $ENV{$variable{$_->{variableName}}} ? 1 : 0;
}
@@ -138,47 +141,33 @@ sub navigation {
my ($o, $page, $previous_page) = @_;
$page->{old_page} ||= $previous_page;
- if (defined $perl_module_name && $page->{func}) {
- @func_arg = split(/\s/, $page->{func});
- $::{$perl_module_name."::"}{"$func_arg[0]"}->($func_arg[1]);
- }
display($o, $page);
- if ($page->{jumpPage}) {
- navigation($o, find_page($o, $page->{jumpPage}), $page->{old_page});
- } else {
- my ($next, $prev) = do {
+ my ($next, $prev) = do {
if (defined $perl_module_name && $page->{func}) {
@func_arg = split(/\s/, $page->{func});
$modStatus = $::{$perl_module_name."::"}{"$func_arg[0]"}->($func_arg[1]);
if ($page->{Target}->{jumpIndex}) {
- if (!$page->{Target}->{jumpIndex}->{0}){
- find_page($o, $page->{Target}->{jumpIndex}->{int($modStatus)}), $page;
- }
- else {
- $page->{next_page}, $page->{old_page};
- }
+ find_page($o, $page->{Target}->{jumpIndex}->{int($modStatus)}), $page;
}
- else {
- $page->{next_page}, $page;
+ elsif ($page->{jumpPage}) {
+ find_page($o, $page->{jumpPage}), $page->{old_page};
}
}
elsif ($page->{jumpScript}) {
system("source $lib_script ; $page->{jumpScript}");
if ($page->{Target}->{jumpIndex}) {
- # if (!$page->{Target}->{jumpIndex}->{0}){
- $? = $? >> 8;
+ $? = $? >> 8;
find_page($o, $page->{Target}->{jumpIndex}->{$?}), $page;
}
- else {
- $page->{next_page}, $page->{old_page};
+ elsif ($page->{jumpPage}) {
+ find_page($o, $page->{jumpPage}), $page->{old_page};
}
}
else {
- $page->{next_page}, $page;
+ $page->{next_page}, $page->{old_page};
}
};
navigation($o, $next, $prev);
- }
}
my $o = [];
@@ -193,11 +182,11 @@ if ($perl_module) {
if ($perl_module =~ /.*\/(.*)\.pm/) {
$::perl_module_name = $1;
}
-
+
!$::isEmbedded && $in->isa('interactive_gtk') and $::isWizard=1;
$::Wizard_title = translate($wizard_title);
$::Wizard_pix_up = "wiz_drakconnect.png";
$::direct = /-direct/;
$::Wizard_no_previous = 1;
-
+$::isWizard = 1;
navigation($o, $o->[0]);