summaryrefslogtreecommitdiffstats
path: root/perl-install/printerdrake.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2002-02-19 15:44:45 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2002-02-19 15:44:45 +0000
commit98e2833b08e13cc9a6d0169caf0a3910b3dba126 (patch)
tree88c181579182f512cecee4e54dc323bb67e1a3cd /perl-install/printerdrake.pm
parentdd6914e04f8a195fc69e615f69a9076d235e2efc (diff)
downloaddrakx-98e2833b08e13cc9a6d0169caf0a3910b3dba126.tar
drakx-98e2833b08e13cc9a6d0169caf0a3910b3dba126.tar.gz
drakx-98e2833b08e13cc9a6d0169caf0a3910b3dba126.tar.bz2
drakx-98e2833b08e13cc9a6d0169caf0a3910b3dba126.tar.xz
drakx-98e2833b08e13cc9a6d0169caf0a3910b3dba126.zip
Assured that the default page size is "Letter" for US/Canada and "A4" for the rest of the world.
The "Description" field of a printer queue is filled in with printer manufacturer and model by default. Removed unused varaiables in /usr/sbin/printerdrake.
Diffstat (limited to 'perl-install/printerdrake.pm')
-rw-r--r--perl-install/printerdrake.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index e7483cffe..e735e3a78 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -584,9 +584,10 @@ _(" (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1
}
#- Search the database entry which matches the detected printer best
+ my $descr = "";
foreach (@parport) {
$device eq $_->{port} or next;
- my $descr = $_->{val}{DESCRIPTION};
+ $descr = $_->{val}{DESCRIPTION};
# Clean up the description from noise which makes the best match
# difficult
$descr =~ s/\s+Inc\.//;
@@ -609,6 +610,9 @@ _(" (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1
($descr !~ /Hewlett[\s-]+Packard/i)))
{$printer->{DBENTRY} = ""};
}
+ if ((!$printer->{currentqueue}{'desc'}) && ($descr)) {
+ $printer->{currentqueue}{'desc'} = $descr;
+ }
1;
}
@@ -1165,12 +1169,14 @@ sub get_printer_info {
if ($printer->{PAPERSIZE}) {
$printer->{SPECIAL_OPTIONS} .=
" -o PageSize=$printer->{PAPERSIZE}";
- } elsif (($in->{lang}) ||
+ } elsif (($pagesize = $in->{lang}) ||
($pagesize = $ENV{'LC_PAPER'}) ||
($pagesize = $ENV{'LANG'}) ||
($pagesize = $ENV{'LANGUAGE'}) ||
($pagesize = $ENV{'LC_ALL'})) {
- if (($pagesize eq 'en') || ($pagesize eq 'en_US')) {
+ if (($pagesize =~ /^en_CA/) ||
+ ($pagesize =~ /^fr_CA/) ||
+ ($pagesize =~ /^en_US/)) {
$pagesize = "Letter";
} else {
$pagesize = "A4";
@@ -2329,7 +2335,7 @@ sub main {
my @printerlist =
( (sort((map {$printer->{configured}{$_}{'queuedata'}{'menuentry'}
. ($_ eq $printer->{DEFAULT} ?
- _(" (Default)") : ())}
+ _(" (Default)") : (""))}
keys(%{$printer->{configured}
|| {}})),
($printer->{SPOOLER} eq "cups" ?