diff options
Diffstat (limited to 'perl-install/printerdrake.pm')
-rw-r--r-- | perl-install/printerdrake.pm | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index f436ab14a..8255eed75 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -268,6 +268,10 @@ complete => sub { $device eq $_->{port} or next; $printer->{DBENTRY} = bestMatchSentence ($_->{val}{DESCRIPTION}, keys %printer::thedb); + # If the manufacturer was not guessed correctly, discard the + # guess. + #$printer->{DBENTRY} =~ /^([\|])|/; + #if ($_->{val}{DESCRIPTION} !~ /lc($1)/i) {$printer->{DBENTRY} = ""}; } 1; } @@ -711,9 +715,13 @@ sub get_db_entry { } } } - if ($printer->{DBENTRY} eq "") { + if (($printer->{DBENTRY} eq "") && 0) { # Exact match with cleaned-up model did not work, try a best match $printer->{DBENTRY} = bestMatchSentence("$make|$model", keys %printer::thedb); + # If the manufacturer was not guessed correctly, discard the + # guess. + $printer->{DBENTRY} =~ /^([\|])|/; + if (lc($1) ne lc($make)) {$printer->{DBENTRY} = ""}; } # Set the OLD_CHOICE to a non-existing value $printer->{OLD_CHOICE} = "XXX"; @@ -738,6 +746,9 @@ sub choose_model { my $w = $in->wait_message('', _("Reading printer database ...")); printer::read_printer_db($printer->{SPOOLER}); } + if (!$printer::thedb{$printer->{DBENTRY}}) { + $printer->{DBENTRY} = _("Raw printer (No driver)"); + } $in->set_help('configurePrinterType') if $::isInstall; # Choose the printer/driver from the list return ($printer->{DBENTRY} = $in->ask_from_treelist(_("Printer model selection"), @@ -1724,8 +1735,10 @@ What do you want to modify on this printer?", _("Printer manufacturer, model")), (($printer->{configured}{$queue}{'queuedata'}{'make'} ne "") && - ($printer->{configured}{$queue}{'queuedata'}{'model'} ne - _("Unknown model")) ? + (($printer->{configured}{$queue}{'queuedata'}{'model'} ne + _("Unknown model")) || + ($printer->{configured}{$queue}{'queuedata'}{'model'} ne + _("Raw printer"))) ? _("Printer options") : ()), (($queue ne $printer->{DEFAULT}) ? _("Set this printer as the default") : ()), |