diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2001-07-30 18:41:02 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2001-07-30 18:41:02 +0000 |
commit | 8b288e6df423282c3a51f6775d5feadf12b796be (patch) | |
tree | e486895c2cb5f23cb39e172be9a5b99d93d17cf9 /perl-install/printer.pm | |
parent | 110e3deda634adc5876da17c0fbfa451ad2c652e (diff) | |
download | drakx-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/printer.pm')
-rw-r--r-- | perl-install/printer.pm | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm index 52fde82fb..59c5b0c2e 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -195,20 +195,35 @@ sub read_printer_db(;$) { if (m!^\s*</printer>\s*$!) { # entry completed $inentry = 0; + # Expert mode: # Make one database entry per driver with the entry name # manufacturer|model|driver - my $driver; - for $driver (@{$entry->{drivers}}) { - my $driverstr; - if ($driver eq "Postscript") { - $driverstr = "PostScript"; - } else { - $driverstr = "GhostScript + $driver"; + if ($::expert) { + my $driver; + for $driver (@{$entry->{drivers}}) { + my $driverstr; + if ($driver eq "Postscript") { + $driverstr = "PostScript"; + } else { + $driverstr = "GhostScript + $driver"; + } + if ($driver eq $entry->{defaultdriver}) { + $driverstr .= " (recommended)"; + } + $entry->{ENTRY} = "$entry->{make}|$entry->{model}|$driverstr"; + $entry->{driver} = $driver; + # Duplicate contents of $entry because it is multiply entered to the database + map { $thedb{$entry->{ENTRY}}->{$_} = $entry->{$_} } keys %$entry; + } + } else { + # Recommended mode + # Make one entry per printer, with the recommended + # driver (manufacturerer|model) + $entry->{ENTRY} = "$entry->{make}|$entry->{model}"; + if ($entry->{defaultdriver}) { + $entry->{driver} = $entry->{defaultdriver}; + map { $thedb{$entry->{ENTRY}}->{$_} = $entry->{$_} } keys %$entry; } - $entry->{ENTRY} = "$entry->{make}|$entry->{model}|$driverstr"; - $entry->{driver} = $driver; - # Duplicate contents of $entry because it is multiply entered to the database - map { $thedb{$entry->{ENTRY}}->{$_} = $entry->{$_} } keys %$entry; } $entry = {}; } elsif (m!^\s*<id>\s*([0-9]+)\s*</id>\s*$!) { @@ -220,6 +235,9 @@ sub read_printer_db(;$) { } elsif (m!^\s*<model>(.+)</model>\s*$!) { # Printer model $entry->{model} = $1; + } elsif (m!<driver>(.+)</driver>!) { + # Printer default driver + $entry->{defaultdriver} = $1; } elsif (m!^\s*<drivers>\s*$!) { # Drivers block $indrivers = 1; @@ -238,7 +256,7 @@ sub read_printer_db(;$) { } #- Load CUPS driver database if CUPS is used as spooler - if (($spooler) && ($spooler eq "cups")) { + if (($spooler) && ($spooler eq "cups") && ($::expert)) { #&$install('cups-drivers') unless $::testing; #my $w; #if ($in) { |