diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2001-08-08 23:33:03 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2001-08-08 23:33:03 +0000 |
commit | 60a03f6dd42238553aa7947c22a8d3b9384130d6 (patch) | |
tree | 4ca2d07c7a8a6e02cac8403e952edb4c5edf675b | |
parent | 500dd3b1a4981336166a6309bac878d476a3c52f (diff) | |
download | drakx-60a03f6dd42238553aa7947c22a8d3b9384130d6.tar drakx-60a03f6dd42238553aa7947c22a8d3b9384130d6.tar.gz drakx-60a03f6dd42238553aa7947c22a8d3b9384130d6.tar.bz2 drakx-60a03f6dd42238553aa7947c22a8d3b9384130d6.tar.xz drakx-60a03f6dd42238553aa7947c22a8d3b9384130d6.zip |
Different choosable test pages available now
-rw-r--r-- | perl-install/printer.pm | 13 | ||||
-rw-r--r-- | perl-install/printerdrake.pm | 42 |
2 files changed, 49 insertions, 6 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm index 12e11f260..e916ce6df 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -673,8 +673,17 @@ sub print_pages($@) { # Print the pages foreach (@pages) { - run_program::rooted($prefix, $lpr, "-s", $printer->{SPOOLER}, - "-P", $queue, $_); + my $page = $_; + # Only text and PostScript can be printed directly with all spoolers, + # images must be treated seperately + if ($page =~ /\.jpg$/) { + system(($::testing ? "$prefix" : "chroot $prefix/ ") . + "convert $page -page 427x654+100+65 PS:- | " . + "$lpr -s $printer->{SPOOLER} -P $queue"); + } else { + run_program::rooted($prefix, $lpr, "-s", $printer->{SPOOLER}, + "-P", $queue, $page); + } } sleep 5; #- allow lpr to send pages. # Check whether the job is queued diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index 903766afb..e511fc1f6 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -417,7 +417,6 @@ sub setup_gsdriver { if ((keys %printer::thedb) == 0) { printer::read_printer_db($printer->{SPOOLER}); } - my $testpage = "/usr/share/printer-testpages/testprint.ps"; my $queue = $printer->{OLD_QUEUE}; $in->set_help('configurePrinterType') if $::isInstall; while (1) { @@ -655,14 +654,49 @@ sub setup_gsdriver { $printer->{complete} = 1; printer::configure_queue($printer); $printer->{complete} = 0; - - if ($in->ask_yesorno('', __("Do you want to print a test page?"), 1)) { + # print test pages + my $standard = 1; + my $altletter = 0; + my $alta4 = 0; + my $photo = 0; + my $ascii = 0; + if ($in->ask_from_entries_refH_powered + ({ title => __("Test pages"), + messages => __("Please select the test pages you want to print. +Note: the photo test page can take a rather long time to get printed. +In most cases it is enough to print the standard test page."), + cancel => __("No test pages"), + ok => __("Print")}, +[ +{ text => __("Standard test page"), type => 'bool', val => \$standard }, +{ text => __("Alternative test page (Letter)"), type => 'bool', + val => \$altletter }, +{ text => __("Alternative test page (A4)"), type => 'bool', val => \$alta4 }, +{ text => __("Photo test page"), type => 'bool', val => \$photo }, +{ text => __("Plain text test page"), type => 'bool', val => \$ascii } +])) { +# if ($in->ask_yesorno('', __("Do you want to print a test page?"), 1)) { my @lpq_output; { my $w = $in->wait_message('', _("Printing test page(s)...")); $upNetwork and do { &$upNetwork(); undef $upNetwork; sleep(1) }; - @lpq_output = printer::print_pages($printer, $testpage); + my $stdtestpage = "/usr/share/printer-testpages/testprint.ps"; + my $altlttestpage = "/usr/share/printer-testpages/testpage.ps"; + my $alta4testpage = "/usr/share/printer-testpages/testpage-a4.ps"; + my $phototestpage = "/usr/share/printer-testpages/photo-testpage.jpg"; + my $asciitestpage = "/usr/share/printer-testpages/testpage.asc"; + my @testpages; + # Install the filter to convert the photo test page to PS + $photo && $in->do_pkgs->install('ImageMagick'); + # set up list of pages to print + $standard && push (@testpages, $stdtestpage); + $altletter && push (@testpages, $altlttestpage); + $alta4 && push (@testpages, $alta4testpage); + $photo && push (@testpages, $phototestpage); + $ascii && push (@testpages, $asciitestpage); + # print the stuff + @lpq_output = printer::print_pages($printer, @testpages); } if (@lpq_output) { |