diff -Nur -x '*.orig' -x '*.rej' e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/console.pm mezzanine_patched_e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/console.pm --- e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/console.pm 2007-02-28 15:49:38.000000000 -0500 +++ mezzanine_patched_e-smith-lib-1.18.0/root/usr/lib/perl5/site_perl/esmith/console.pm 2007-02-28 15:16:31.000000000 -0500 @@ -224,7 +224,6 @@ my %params = @_; my $title = $params{title}; - my $choice = $params{choice}; my $message_box = $params{text}; my $left = defined $params{left} ? $params{left} : gettext("Back"); @@ -298,7 +297,7 @@ =head2 yesno_page -This methods displays a simple yes/no screen, so the user can make a +This method displays a simple yes/no screen, so the user can make a simple binary selection. =cut @@ -434,6 +433,50 @@ return ( gettext("keep"), "${keep_phrase}: $value" ); } +=head2 gauge + +This method displays a progress bar. It takes a coderef as parameter, and uses +the coderef to drive the --gauge widget of the dialog program, as well as to +perform whatever actions are being reported by the progress bar. The coderef +should take one parameter, which is the file handle to write the controlling +text to. The coderef should return a string, which is displayed by a +message_page after the progress bar terminates. + +All text used to update the progress bar should either be numbers between 0 +and 100, or arbitrary text sandwiched between leading and training lines +of 'XXX' followed by newline. The numbers will update the percentage complete +of the display, and the text will update the displayed text. + +=cut + +sub gauge +{ + my $self = shift; + my $sub = shift; + my %params = @_; + my $title = $params{title} || 'Progress'; + my $feedback_title = $params{feedback_title} || 'Status'; + my $init_text = $params{text} || 'Progress'; + + use FileHandle; + + unless (open(WR, '|-')) + { + exec('/usr/bin/dialog', + '--backtitle', $self->backtitle, + '--title', gettext($title), + '--gauge', + gettext($init_text), + SCREEN_ROWS, + SCREEN_COLUMNS, + ); + } + WR->autoflush(1); + my $text = &$sub(*WR); + close(WR); + $self->message_page('title' => $feedback_title, 'text' => $text); +} + =head2 run_screens This method takes a directory of screens to run, and runs them in order.