summaryrefslogtreecommitdiffstats
path: root/perl-install/printerdrake.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-05-05 18:45:23 +0000
committerFrancois Pons <fpons@mandriva.com>2000-05-05 18:45:23 +0000
commit969bc065596476bce5cfed0bb7ffd263f48eb1d5 (patch)
tree8f890d39f7b1ccfa6dbeb8f7cc3281748ee30f46 /perl-install/printerdrake.pm
parent8255a2010a0698471fb35f42b1ebcad3462f153a (diff)
downloaddrakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.gz
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.bz2
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.xz
drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.zip
*** empty log message ***
Diffstat (limited to 'perl-install/printerdrake.pm')
-rw-r--r--perl-install/printerdrake.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 3ae4bba8f..bff8e4e23 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -17,6 +17,7 @@ sub auto_detect {
my ($in) = @_;
{
my $w = $in->wait_message(_("Test ports"), _("Detecting devices..."));
+ detect_devices::probeUSB() and eval { modules::load("printer"); sleep(1); };
eval { modules::load("parport_pc"); modules::load("parport_probe"); modules::load("lp"); };
}
my $b = before_leaving { eval { modules::unload("parport_probe") } };
@@ -112,8 +113,8 @@ _("Password") => {val => \$printer->{NCPPASSWD}, hidden => 1} ],
1;
}
-sub setup_gsdriver($$$) {
- my ($printer, $in, $install) = @_;
+sub setup_gsdriver($$$;$) {
+ my ($printer, $in, $install, $upNetwork) = @_;
my $action;
my @action = qw(ascii ps both done);
my %action = (
@@ -148,6 +149,7 @@ sub setup_gsdriver($$$) {
my %depth_to_col = reverse %col_to_depth;
my $is_uniprint = $db_entry{GSDRIVER} eq "uniprint";
+ $printer->{PAPERSIZE} ||= "letter";
$printer->{RESOLUTION} = @res ? $res[0] || "Default" : "Default" unless member($printer->{RESOLUTION}, @res);
$printer->{ASCII_TO_PS} = $db_entry{GSDRIVER} eq 'POSTSCRIPT' unless defined($printer->{ASCII_TO_PS});
$printer->{CRLF} = $db_entry{DESCR} =~ /HP/ unless defined($printer->{CRLF});
@@ -207,6 +209,7 @@ _("Extra Text options") => \$printer->{TEXTONLYOPTIONS},
{
my $w = $in->wait_message('', _("Printing test page(s)..."));
+ $upNetwork and do { &$upNetwork(); undef $upNetwork; sleep(1) };
printer::restart_queue(printer::default_queue($printer->{QUEUE}));
@lpq_output = printer::print_pages(printer::default_queue($printer->{QUEUE}), @testpages);
}
@@ -226,8 +229,8 @@ Does it work properly?"), 1) ? 'done' : 'change';
}
#- Program entry point.
-sub main($$$) {
- my ($printer, $in, $install) = @_;
+sub main($$$;$) {
+ my ($printer, $in, $install, $upNetwork) = @_;
my ($queue, $continue) = ('', 1);
while ($continue) {
@@ -293,7 +296,7 @@ _("Printer Connection") => { val => \$printer->{str_type}, not_edit => 1, list =
}
#- configure ghostscript driver to be used.
- if (!$continue && setup_gsdriver($printer, $in, $install)) {
+ if (!$continue && setup_gsdriver($printer, $in, $install, $printer->{TYPE} ne 'LOCAL' && $upNetwork)) {
delete $printer->{OLD_QUEUE}
if $printer->{QUEUE} ne $printer->{OLD_QUEUE} && $printer->{configured}{$printer->{QUEUE}};
$continue = !$::beginner;