diff options
author | Francois Pons <fpons@mandriva.com> | 2001-04-04 15:38:55 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-04-04 15:38:55 +0000 |
commit | e5f3404981994a9d4b1862291ffc99f019477f55 (patch) | |
tree | c0baa883e40fa118823a63119ba218741dd0a6bc /perl-install/printerdrake.pm | |
parent | b276a002a94f672da5697133dbaff6bd28f17ab6 (diff) | |
download | drakx-e5f3404981994a9d4b1862291ffc99f019477f55.tar drakx-e5f3404981994a9d4b1862291ffc99f019477f55.tar.gz drakx-e5f3404981994a9d4b1862291ffc99f019477f55.tar.bz2 drakx-e5f3404981994a9d4b1862291ffc99f019477f55.tar.xz drakx-e5f3404981994a9d4b1862291ffc99f019477f55.zip |
added complete callback to check queue name under cups does contains
only letters, numerics or underscore.
Diffstat (limited to 'perl-install/printerdrake.pm')
-rw-r--r-- | perl-install/printerdrake.pm | 10 |
1 files changed, 9 insertions, 1 deletions
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"), |