From c2dda5abbae0ef821d2d8c93e2cf90972279f1f8 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 3 Jan 2006 15:41:30 +0000 Subject: don't have a useless empty hash in wizards objects, use the wizards hash --- perl-install/wizards.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'perl-install/wizards.pm') diff --git a/perl-install/wizards.pm b/perl-install/wizards.pm index c7f4f9e15..22af03d53 100644 --- a/perl-install/wizards.pm +++ b/perl-install/wizards.pm @@ -11,12 +11,10 @@ wizards - a layer on top of interactive that ensure proper stepping =head1 SYNOPSIS - use wizards - # global wizard options: - use wizards; use interactive; - my $wiz = { + + my $wiz = wizards->new({ allow_user => "", # do we need root defaultimage => "", # wizard icon @@ -52,10 +50,9 @@ wizards - a layer on top of interactive that ensure proper stepping ], }, }, - }; - - my $w = wizards->new; - $w->process($wiz, $in); + }); + my $in = 'interactive'->vnew; + $wiz->process($in); =head1 DESCRIPTION @@ -85,7 +82,10 @@ extra exception managment such as destroying the wizard window and the like. =cut -sub new { bless {}, $_[0] } +sub new { + my ($class, $o) = @_; + bless $o, $class; +} sub check_rpm { @@ -109,7 +109,7 @@ my %default_callback = (changed => sub {}, focus_out => sub {}, complete => sub sub process { - my ($_w, $o, $in) = @_; + my ($o, $in) = @_; local $::isWizard = 1; local $::Wizard_title = $o->{name} || $::Wizard_title; local $::Wizard_pix_up = $o->{defaultimage} || $::Wizard_pix_up; @@ -193,8 +193,8 @@ sub process { sub safe_process { - my ($w, $wiz, $in) = @_; - eval { $w->process($wiz, $in) }; + my ($o, $in) = @_; + eval { $o->process($in) }; my $err = $@; if ($err =~ /wizcancel/) { $in->exit(0); -- cgit v1.2.1