summaryrefslogtreecommitdiffstats
path: root/perl-install/printerdrake.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2001-07-30 18:41:02 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2001-07-30 18:41:02 +0000
commit8b288e6df423282c3a51f6775d5feadf12b796be (patch)
treee486895c2cb5f23cb39e172be9a5b99d93d17cf9 /perl-install/printerdrake.pm
parent110e3deda634adc5876da17c0fbfa451ad2c652e (diff)
downloaddrakx-8b288e6df423282c3a51f6775d5feadf12b796be.tar
drakx-8b288e6df423282c3a51f6775d5feadf12b796be.tar.gz
drakx-8b288e6df423282c3a51f6775d5feadf12b796be.tar.bz2
drakx-8b288e6df423282c3a51f6775d5feadf12b796be.tar.xz
drakx-8b288e6df423282c3a51f6775d5feadf12b796be.zip
In beginners mode one chooses only the printer, not the driver (default driver)
Diffstat (limited to 'perl-install/printerdrake.pm')
-rw-r--r--perl-install/printerdrake.pm32
1 files changed, 28 insertions, 4 deletions
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 18d368e78..9c9106e64 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -84,8 +84,7 @@ complete => sub {
foreach (@parport) {
$device eq $_->{port} or next;
$printer->{DBENTRY} =
- bestMatchSentence($_->{val}{DESCRIPTION},
- keys %printer::thedb);
+ bestMatchSentence ($_->{val}{DESCRIPTION}, keys %printer::thedb);
}
1;
}
@@ -426,15 +425,40 @@ sub setup_gsdriver($$$;$) {
my $make = $printer->{configured}{$queue}{'make'};
my $model =
$printer->{configured}{$queue}{'model'};
- $printer->{DBENTRY} = "$make|$model|$driverstr";
- } elsif ($printer->{SPOOLER} eq "cups") {
+ if ($::expert) {
+ $printer->{DBENTRY} = "$make|$model|$driverstr";
+ # database key contains te "(recommended)" for the
+ # recommended driver, so add it if necessary
+ if (!($printer::thedb{$printer->{DBENTRY}}{id})) {
+ $printer->{DBENTRY} .= " (recommended)";
+ }
+ } else {
+ $printer->{DBENTRY} = "$make|$model";
+ # Make sure that we use the recommended driver
+ $printer->{currentqueue}{'driver'} =
+ $printer::thedb{$printer->{DBENTRY}}{driver};
+ }
+ } elsif (($::expert) && ($printer->{SPOOLER} eq "cups")) {
# Do we have a native CUPS driver or a PostScript PPD file?
$printer->{DBENTRY} = printer::get_descr_from_ppd($printer) ||
$printer->{DBENTRY};
}
+ } else {
+ if (($::expert) && ($printer->{DBENTRY} !~ (recommended))) {
+ $printer->{DBENTRY} =~ /^([^\|]+)\|([^\|]+)\|/;
+ my $make = $1;
+ my $model = $2;
+ my $key;
+ for $key (keys %printer::thedb) {
+ if ($key =~ /^$make\|$model\|.*\(recommended\)$/) {
+ $printer->{DBENTRY} = $key;
+ }
+ }
+ }
}
# Choose the printer/driver from the list
my $oldchoice = $printer->{DBENTRY};
+
$printer->{DBENTRY} = $in->ask_from_treelist
(__("Printer model selection"),
__("Which printer model do you have?"), '|',