diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-11-13 12:46:24 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-11-13 12:46:24 +0000 |
commit | 7b0b609e9c50189f8bbfc5f66d2e7f19b95c6c2f (patch) | |
tree | 3bdb41fa97e17ce759fbb10c3b4a28f693bc1cf2 | |
parent | d3c3952019db8d7d0d31c711295a61af080f38f7 (diff) | |
download | drakwizard-7b0b609e9c50189f8bbfc5f66d2e7f19b95c6c2f.tar drakwizard-7b0b609e9c50189f8bbfc5f66d2e7f19b95c6c2f.tar.gz drakwizard-7b0b609e9c50189f8bbfc5f66d2e7f19b95c6c2f.tar.bz2 drakwizard-7b0b609e9c50189f8bbfc5f66d2e7f19b95c6c2f.tar.xz drakwizard-7b0b609e9c50189f8bbfc5f66d2e7f19b95c6c2f.zip |
replaced _() N()
-rwxr-xr-x | drakwizard.pl | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drakwizard.pl b/drakwizard.pl index fb27e5fa..e7ed7c88 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -25,7 +25,7 @@ use vars qw($Wizard_title $Wizard_pix_up $lib_script $perl_module %variable $in use XML::Parser; use standalone; use interactive; -use MDK::Common::Func; +#use MDK::Common::Func; use common; use Data::Dumper; @@ -60,8 +60,8 @@ if (!defined($ARGV[0])) { 11 => [$prefix."time_wizard/time.wiz", "Time"] ); $in->ask_from( - _("Drakwizard wizard selection"), - _("Please select a wizard"), + N("Drakwizard wizard selection"), + N("Please select a wizard"), [{ val => \$ARGV[0], list => [sort keys %wiz], format => sub { $wiz{$_}[1] }}] ); $ARGV[0] = $wiz{$ARGV[0]}[0]; @@ -116,10 +116,10 @@ sub load_wizard { ($Wizard_title, $lib_script, $perl_module, $rpm, $Wizard_pix_up, $summary_func) = @_; if ($rpm) { if (!$in->do_pkgs->is_installed($rpm)) { - if ($in->ask_okcancel("error", _("%s is not installed\nClick \"Next\" to install or \"Cancel\" to quit", c::from_utf8($rpm)))) { + if ($in->ask_okcancel("error", N("%s is not installed\nClick \"Next\" to install or \"Cancel\" to quit", c::from_utf8($rpm)))) { if (!$in->do_pkgs->install($rpm eq 'bind' ? 'bind-9' : $rpm)) { $::Wizard_finished = 1; - $in->ask_okcancel("error", _("installation failed")); + $in->ask_okcancel("error", N("installation failed")); $in->exit; } } @@ -147,22 +147,24 @@ sub map_freetext { if (!$ENV{$variable{$_->{variableName}}} && $_->{fillfunc}) { $ENV{$variable{$_->{variableName}}} = $::{$perl_module_name."::"}{"$_->{fillfunc}"}->(); } - { label => _($_->{helpText}), + { label => N($_->{helpText}), val => \$ENV{$variable{$_->{variableName}}}, type => $_->{main_order}, disabled => $disabled{$_->{variableName}}, help => $_->{help}} } - elsif ($_->{main_order} eq 'field' && $_->{fillfunc}) { - { label => _($_->{helpText}), + elsif ($_->{main_order} eq 'field' && $_->{fillfunc}) { + { label => N($_->{helpText}), val => $::{$perl_module_name."::"}{"$_->{fillfunc}"}->(), type => $_->{main_order}, disabled => $disabled{$_->{variableName}}, help => $_->{help}} } elsif ($_->{main_order} eq 'bool') { + if (!$ENV{$variable{$_->{variableName}}} && $_->{fillfunc}) { + $ENV{$variable{$_->{variableName}}} = $::{$perl_module_name."::"}{"$_->{fillfunc}"}->(); + } if ($_->{listfunc}) { my @checklist = $::{$perl_module_name."::"}{"$_->{listfunc}"}->(); my $i = 21 - scalar @checklist; - # workaround to get get the scrollbar if (!$::isSummary) { while ($i--) { @@ -212,7 +214,7 @@ sub map_freetext { else { @liste = @{$_->{Option}}; } - { label => _($_->{helpText}), + { label => N($_->{helpText}), val => \$ENV{$variable{$_->{variableName}}}, list => [@liste], type => $_->{main_order}, disabled => $disabled{$_->{variableName}} }} @@ -268,7 +270,7 @@ sub get_parameter { $page->{info} .= translate(`source $lib_script; $leaf->{fillScript}`) if ($leaf->{fillScript}) }, - Freetext => $common_freetext_chooser = sub { + Freetext => $common_freetext_chooser = sub { my $main_order = ($tag eq 'Chooser') ? 'combo' : ($tag eq 'Boolean') ? 'bool' : ($leaf->{editable} eq 'true') ? 'entry' @@ -303,7 +305,6 @@ sub display { my ($o, $page) = @_; my $data; - $current_page = $page; if ($page->{no_prev} || $page->{name} eq $welcome->{name}) { $::Wizard_no_previous = 1; } @@ -331,7 +332,7 @@ sub display { foreach (@{$page->{freetext}}) { if ($_->{main_order} eq 'bool') { $ENV{$variable{$_->{variableName}}} = $ENV{$variable{$_->{variableName}}} ? 1 : 0; - $description{$ENV{$variable{$_->{variableName}}}} = $ENV{$variable{$_->{variableName}}} ? _("enabled") : _("disabled"); + $description{$ENV{$variable{$_->{variableName}}}} = $ENV{$variable{$_->{variableName}}} ? N("enabled") : N("disabled"); } elsif ($_->{main_order} eq 'combo') { $ENV{$variable{$_->{variableName}}} = $chooser_hash{$ENV{$variable{$_->{variableName}}}}; @@ -346,6 +347,7 @@ sub navigation { my ($o, $page, $previous_page) = @_; $page->{old_page} ||= $previous_page; + $current_page = $page; display($o, $page); my ($next, $prev) = do { if (defined $perl_module_name && $page->{func}) { @@ -437,7 +439,7 @@ sub callback_summary { is_disabled_summary($_[0], $o2->[0]); } -sub callback { +sub callback { return 1 if callback_common($_[0]); is_disabled($_[0], $current_page); } @@ -460,7 +462,6 @@ sub get_summary { $disabled{$leaf->{name}} = sub { callback_summary($leaf->{name})}; }, Freetext => $common_freetext_chooser = sub { - my $main_order = ($tag eq 'Chooser') ? 'combo' : ($tag eq 'Boolean') ? 'bool' : ($leaf->{editable} eq 'true') ? 'entry' |