summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-11-15 15:48:44 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-11-15 15:48:44 +0000
commit94363303a493e8df4240b1921dbfc93ed85b9223 (patch)
tree6ae95484346da01f759dcab316180bc57aaeaef6
parent43b09b2e679101b8ff601aebb57b7d798bad9954 (diff)
downloaddrakx-backup-do-not-use-94363303a493e8df4240b1921dbfc93ed85b9223.tar
drakx-backup-do-not-use-94363303a493e8df4240b1921dbfc93ed85b9223.tar.gz
drakx-backup-do-not-use-94363303a493e8df4240b1921dbfc93ed85b9223.tar.bz2
drakx-backup-do-not-use-94363303a493e8df4240b1921dbfc93ed85b9223.tar.xz
drakx-backup-do-not-use-94363303a493e8df4240b1921dbfc93ed85b9223.zip
- more cleanups
- don't display messages if we're not going to remove/install some packages
-rw-r--r--perl-install/printer/printerdrake.pm35
1 files changed, 13 insertions, 22 deletions
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 12a9735ad..49e6c5aa2 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -2655,15 +2655,15 @@ sub install_spooler {
# "lpr" conflicts with "LPRng", remove either "LPRng" or remove "lpr"
my $packages = $spoolers{$spooler}{packages2rm};
- if ($packages) {
+ if ($packages && files_exist($packages->[1])) {
$w = $in->wait_message(N("Printerdrake"), N("Removing %s ..."), $spoolers{$packages->[0]}{short_name});
- $in->do_pkgs->remove_nodeps($packages->[0]) if !files_exist($packages->[1]);
+ $in->do_pkgs->remove_nodeps($packages->[0]);
}
$packages = $spoolers{$spooler}{packages2add};
- if ($packages) {
+ if ($packages && !files_exist(@{$packages->[1]})) {
$w = $in->wait_message(N("Printerdrake"), N("Installing %s ..."), $spoolers{$spooler}{short_name});
- $in->do_pkgs->install(@{$packages->[0]}) if !files_exist(@{$packages->[1]});
+ $in->do_pkgs->install(@{$packages->[0]});
}
undef $w;
@@ -3350,23 +3350,15 @@ What do you want to modify on this printer?",
$in->ask_warn(N("Default printer"),
N("The printer \"%s\" is set as the default printer now.", $queue));
} elsif ($modify eq N("Add this printer to Star Office/OpenOffice.org/GIMP")) {
- if (printer::main::addcupsremotetoapplications
- ($printer, $queue)) {
- $in->ask_warn(N("Adding printer to Star Office/OpenOffice.org/GIMP"),
- N("The printer \"%s\" was successfully added to Star Office/OpenOffice.org/GIMP.", $queue));
- } else {
- $in->ask_warn(N("Adding printer to Star Office/OpenOffice.org/GIMP"),
- N("Failed to add the printer \"%s\" to Star Office/OpenOffice.org/GIMP.", $queue));
- }
+ $in->ask_warn(N("Adding printer to Star Office/OpenOffice.org/GIMP"),
+ printer::main::addcupsremotetoapplications($printer, $queue) ?
+ N("The printer \"%s\" was successfully added to Star Office/OpenOffice.org/GIMP.", $queue) :
+ N("Failed to add the printer \"%s\" to Star Office/OpenOffice.org/GIMP.", $queue));
} elsif ($modify eq N("Remove this printer from Star Office/OpenOffice.org/GIMP")) {
- if (printer::main::removeprinterfromapplications
- ($printer, $queue)) {
- $in->ask_warn(N("Removing printer from Star Office/OpenOffice.org/GIMP"),
- N("The printer \"%s\" was successfully removed from Star Office/OpenOffice.org/GIMP.", $queue));
- } else {
- $in->ask_warn(N("Removing printer from Star Office/OpenOffice.org/GIMP"),
- N("Failed to remove the printer \"%s\" from Star Office/OpenOffice.org/GIMP.", $queue));
- }
+ $in->ask_warn(N("Removing printer from Star Office/OpenOffice.org/GIMP"),
+ printer::main::removeprinterfromapplications($printer, $queue) ?
+ N("The printer \"%s\" was successfully removed from Star Office/OpenOffice.org/GIMP.", $queue) :
+ N("Failed to remove the printer \"%s\" from Star Office/OpenOffice.org/GIMP.", $queue));
} elsif ($modify eq N("Print test pages")) {
print_testpages($printer, $in, $upNetwork);
} elsif ($modify eq N("Know how to use this printer")) {
@@ -3417,8 +3409,7 @@ What do you want to modify on this printer?",
# Configure the current printer queue in applications when main menu
# will not be shown (During installation in "Recommended" mode)
if ($::isInstall && !$::expert && !$menushown && !$continue) {
- my $w = $in->wait_message(N("Printerdrake"),
- N("Configuring applications..."));
+ my $w = $in->wait_message(N("Printerdrake"), N("Configuring applications..."));
printer::main::configureapplications($printer);
}