From e5f3404981994a9d4b1862291ffc99f019477f55 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 4 Apr 2001 15:38:55 +0000 Subject: added complete callback to check queue name under cups does contains only letters, numerics or underscore. --- perl-install/printerdrake.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'perl-install') diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index 849ef1d13..aace3d319 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -441,6 +441,14 @@ and optionally the port number."), [ $in->ask_from_entries_refH_powered( { title => _("Select Printer Connection"), cancel => !$::expert || !$printer->{configured}{$printer->{QUEUE}} ? '' : _("Remove queue"), + callbacks => { complete => sub { + unless ($printer->{QUEUE} =~ /^\w*$/) { + $in->ask_warn('', _("Name of printer should contains only letters, numbers and the underscore")); + return (1,0); + } + return 0; + }, + }, messages => _("Every printer need a name (for example lp). Other parameters such as the description of the printer or its location @@ -449,7 +457,7 @@ how is the printer connected?") }, [ { label => _("Name of printer"), val => \$printer->{QUEUE} }, { label => _("Description"), val => \$printer->{Info} }, { label => _("Location"), val => \$printer->{Location} }, - ]) or printer::remove_queue($printer), $continue = 1, last; + ]) or printer::remove_queue($printer), $continue = 1, last; } else { if (!$::expert) { $printer->{str_type} = $in->ask_from_list_(_("Select Printer Connection"), -- cgit v1.2.1