summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-04-04 15:38:55 +0000
committerFrancois Pons <fpons@mandriva.com>2001-04-04 15:38:55 +0000
commite5f3404981994a9d4b1862291ffc99f019477f55 (patch)
treec0baa883e40fa118823a63119ba218741dd0a6bc /perl-install
parentb276a002a94f672da5697133dbaff6bd28f17ab6 (diff)
downloaddrakx-backup-do-not-use-e5f3404981994a9d4b1862291ffc99f019477f55.tar
drakx-backup-do-not-use-e5f3404981994a9d4b1862291ffc99f019477f55.tar.gz
drakx-backup-do-not-use-e5f3404981994a9d4b1862291ffc99f019477f55.tar.bz2
drakx-backup-do-not-use-e5f3404981994a9d4b1862291ffc99f019477f55.tar.xz
drakx-backup-do-not-use-e5f3404981994a9d4b1862291ffc99f019477f55.zip
added complete callback to check queue name under cups does contains
only letters, numerics or underscore.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/printerdrake.pm10
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"),