summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2001-09-16 03:39:46 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2001-09-16 03:39:46 +0000
commit90f28b34f5fa86c5a1607b3b9cca7a808918116c (patch)
treed98ffcce8596d8f7b620d1762a50d9cd4ea66330 /perl-install/printer.pm
parent3d0c651af15d50eca4579a3f135e39ad0249107e (diff)
downloaddrakx-90f28b34f5fa86c5a1607b3b9cca7a808918116c.tar
drakx-90f28b34f5fa86c5a1607b3b9cca7a808918116c.tar.gz
drakx-90f28b34f5fa86c5a1607b3b9cca7a808918116c.tar.bz2
drakx-90f28b34f5fa86c5a1607b3b9cca7a808918116c.tar.xz
drakx-90f28b34f5fa86c5a1607b3b9cca7a808918116c.zip
Added possibility to list command line options for the printers and to give the users help for printing
Fixed bug of sometimes appearing the wron dialog after printing test pages
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm44
1 files changed, 43 insertions, 1 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 4bc8962f3..5754e0be1 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -224,7 +224,7 @@ sub set_alternative {
}
sub pdq_panic_button {
- my $setting = @_[0];
+ my $setting = $_[0];
run_program::rooted($prefix, "/usr/sbin/pdqpanicbutton", "--$setting")
|| die "Could not $setting PDQ panic buttons!";
}
@@ -1044,6 +1044,48 @@ sub print_pages($@) {
@lpq_output;
}
+sub lphelp_output {
+ my ($printer) = @_;
+ my $queue = $printer->{QUEUE};
+ my $lphelp = "/usr/bin/lphelp";
+
+ local *F;
+ open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "$lphelp $queue |";
+ $helptext = join("", <F>);
+ close F;
+ return $helptext;
+}
+
+sub pdqhelp_output {
+ my ($printer) = @_;
+ my $queue = $printer->{QUEUE};
+ my $pdq = "/usr/bin/pdq";
+
+ local *F;
+ open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "$pdq -h -P $queue 2>&1 |";
+ $helptext = join("", <F>);
+ close F;
+ return $helptext;
+}
+
+sub print_optionlist {
+ my ($printer) = @_;
+ my $queue = $printer->{QUEUE};
+ my $lpr = "/usr/bin/foomatic-printjob";
+
+ # Print the option list pages
+ if ($printer->{configured}{$queue}{queuedata}{foomatic}) {
+ run_program::rooted($prefix, $lpr, "-s", $printer->{SPOOLER},
+ "-P", $queue, "-o", "docs",
+ $FOOMATIC_DEFAULT_SPOOLER);
+ } elsif ($printer->{configured}{$queue}{queuedata}{ppd}) {
+ system(($::testing ? "$prefix" : "chroot $prefix/ ") .
+ "/usr/bin/lphelp $queue | " .
+ ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ "$lpr -s $printer->{SPOOLER} -P $queue");
+ }
+}
+
# ---------------------------------------------------------------
#
# Spooler config stuff