summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2002-02-21 23:42:48 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2002-02-21 23:42:48 +0000
commit1fbc1b4f9cab4b03cbbfb9840a10f48737e7ef63 (patch)
tree2a81bc4f6c116c2c5e33f74c899c33cef6df158c /perl-install
parent7499184ff51c22bf0fd1666d036b56336f603a4e (diff)
downloaddrakx-1fbc1b4f9cab4b03cbbfb9840a10f48737e7ef63.tar
drakx-1fbc1b4f9cab4b03cbbfb9840a10f48737e7ef63.tar.gz
drakx-1fbc1b4f9cab4b03cbbfb9840a10f48737e7ef63.tar.bz2
drakx-1fbc1b4f9cab4b03cbbfb9840a10f48737e7ef63.tar.xz
drakx-1fbc1b4f9cab4b03cbbfb9840a10f48737e7ef63.zip
Removed "Manual configuration" button when "Local Printer" dialog is started from the queue modification menu (Recommended mode).
Improved matching of printer names resulting from auto-detection with names in the database.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/printerdrake.pm24
1 files changed, 19 insertions, 5 deletions
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 00c9aae86..5cd012081 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -485,7 +485,7 @@ _(" (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1
{ val => \$menuchoice, list => \@menuentrieslist,
not_edit => !$::expert, format => \&translate,
allow_empty_list => 1, type => 'list' },
- (((!$::expert) && ($do_auto_detect)) ?
+ (((!$::expert) && ($do_auto_detect) && ($printer->{NEW})) ?
{ text => _("Manual configuration"), type => 'bool',
val => \$manualconf } : ()),
]
@@ -592,7 +592,11 @@ _(" (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1
my $descr = "";
foreach (@parport) {
$device eq $_->{port} or next;
- $descr = $_->{val}{DESCRIPTION};
+ if (($_->{val}{MANUFACTURER}) && ($_->{val}{MODEL})) {
+ $descr = "$_->{val}{MANUFACTURER} $_->{val}{MODEL}";
+ } else {
+ $descr = $_->{val}{DESCRIPTION};
+ }
# Clean up the description from noise which makes the best match
# difficult
$descr =~ s/\s+Inc\.//;
@@ -602,10 +606,19 @@ _(" (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1
$descr =~ s/\s+Ltd\.//;
$descr =~ s/\s+International//;
$descr =~ s/\s+Int\.//;
+ $descr =~ s/\s+[Ss]eries//;
$descr =~ s/\s+\(?[Pp]rinter\)?$//;
-
- $printer->{DBENTRY} =
- bestMatchSentence ($descr, keys %printer::thedb);
+ $printer->{DBENTRY} = "";
+ for my $entry (keys(%printer::thedb)) {
+ if ($entry =~ m!$descr!) {
+ $printer->{DBENTRY} = $entry;
+ last;
+ }
+ }
+ if (!$printer->{DBENTRY}) {
+ $printer->{DBENTRY} =
+ bestMatchSentence ($descr, keys %printer::thedb);
+ }
# If the manufacturer was not guessed correctly, discard the
# guess.
$printer->{DBENTRY} =~ /^([^\|]+)\|/;
@@ -617,6 +630,7 @@ _(" (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1
}
if ((!$printer->{currentqueue}{'desc'}) && ($descr)) {
$printer->{currentqueue}{'desc'} = $descr;
+ $printer->{currentqueue}{'desc'} =~ s/\|/ /g;
}
1;
}