From 8300cf7ba3e4c3f1fb3202b548b9990c077fe2ba Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Thu, 12 Apr 2001 13:03:12 +0000 Subject: automatically add a queue if nothing exists. --- perl-install/printerdrake.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index d133fca5d..72361a9e2 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -344,14 +344,18 @@ sub main($$$$;$) { $queue = $printer->{want} || $in->ask_yesorno(_("Printer"), _("Would you like to configure a printer?"), 0) ? 'lp' : 'Done'; } else { - $in->ask_from_entries_refH_powered( - { - messages => + unless (%{$printer->{configured} || {}} == ()) { + $in->ask_from_entries_refH_powered( + { + messages => _("Here are the following print queues. You can add some more or change the existing ones."), - ok => '', - }, [ { val => \$queue, format => \&translate, list => [ (sort keys %{$printer->{configured} || {}}), __("Add"), __("Done") ] } ] - ); + ok => '', + }, [ { val => \$queue, format => \&translate, + list => [ (sort keys %{$printer->{configured} || {}}), + __("Add"), __("Done") ] } ] + ); + } else { $queue = 'Add' } #- as there are no printer already configured, Add one automatically. if ($queue eq 'Add') { my %queues; @queues{map { split '\|', $_ } keys %{$printer->{configured}}} = (); my $i = ''; while ($i < 100) { last unless exists $queues{"lp$i"}; ++$i; } -- cgit v1.2.1