summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/printerdrake.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-02-23 22:08:04 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-02-23 22:08:04 +0000
commit96664bd499e9696f79110d02885d9393611f5514 (patch)
tree9ecdd28fb75fb2f1637432a53d20a5c4c8a62940 /perl-install/printer/printerdrake.pm
parent373d8b2e3012afabb301b4ac8df49da2279bd401 (diff)
downloaddrakx-backup-do-not-use-96664bd499e9696f79110d02885d9393611f5514.tar
drakx-backup-do-not-use-96664bd499e9696f79110d02885d9393611f5514.tar.gz
drakx-backup-do-not-use-96664bd499e9696f79110d02885d9393611f5514.tar.bz2
drakx-backup-do-not-use-96664bd499e9696f79110d02885d9393611f5514.tar.xz
drakx-backup-do-not-use-96664bd499e9696f79110d02885d9393611f5514.zip
Several bug fixes on printerdrake
- "BrowsePoll <IP>:<Port>" needs "Browsing On" in /etc/cups/cupsd.conf. - If the same printer model is once on the parallel port and second on USB, there was a new USB queue created on every start of Printerdrake. - Now CUPS is restarted whenever a new USB print queue is set up so that CUPS can provide the model-related USB URI. - Made sure that the default printer is defined and that it is an existing queue so that during installation printerdrake does not show a line only containing " (Default)" in the list of installed printers. - Cleaned up data structure after automatic queue generation.
Diffstat (limited to 'perl-install/printer/printerdrake.pm')
-rw-r--r--perl-install/printer/printerdrake.pm22
1 files changed, 19 insertions, 3 deletions
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 3a28c4716..b0fb6b58b 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -483,8 +483,12 @@ N("Examples for correct IPs:\n") .
}
# Write cupsd.conf
printer::main::write_cups_config($printer);
+ my $w =
+ $in->wait_message(N("Printerdrake"),
+ N("Restarting CUPS..."));
printer::main::write_cupsd_conf
(@{$printer->{cupsconfig}{cupsd_conf}});
+ undef $w;
}
} else {
# Cancel clicked
@@ -742,6 +746,12 @@ Printerdrake could not determine which model your printer %s is. Please choose t
printer::default::set_printer($printer);
}
}
+ # Delete some variables
+ foreach (qw(OLD_QUEUE QUEUE TYPE str_type DBENTRY ARGS OLD_CHOICE)){
+ $printer->{$_} = "";
+ }
+ $printer->{currentqueue} = {};
+ $printer->{complete} = 0;
}
# Configure the current printer queues in applications
$_w =
@@ -3497,15 +3507,21 @@ sub main {
printer::default::set_spooler($printer);
}
- # Get the default printer (Done after non-interactive queue setup,
- # so that these queues are taken into account)
+ # Get the default printer (Done before non-interactive queue setup,
+ # so that former default is not lost)
assure_default_printer_is_set($printer, $in);
+ my $nodefault = (!$printer->{DEFAULT});
# Non-interactive setup of newly detected printers (This is done
# only when not in expert mode, so we always have a spooler defined
# here)
configure_new_printers($printer, $in, $upNetwork);
+ # Make sure that default printer is registered
+ if ($nodefault) {
+ printer::default::set_printer($printer);
+ }
+
# Mark this part as done, it should not be done a second time.
if ($::isInstall) {
$::printerdrake_initialized = 1;
@@ -3565,7 +3581,7 @@ sub main {
if ($cursorpos eq "::" &&
$printer->{DEFAULT} &&
$printer->{DEFAULT} ne "") {
- if ($printer->{configured}{$printer->{DEFAULT}}) {
+ if (defined($printer->{configured}{$printer->{DEFAULT}})) {
$cursorpos =
$printer->{configured}{$printer->{DEFAULT}}{queuedata}{menuentry} . N(" (Default)");
} elsif ($printer->{SPOOLER} eq "cups") {