Debian Codegraph @

Debconf/Element/Dialog/Password.pm

raw
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 Debconf::Element::Dialog::Password - A password input field in a dialog box
6
7 =cut
8
9 package Debconf::Element::Dialog::Password;
10 use warnings;
11 use strict;
12 use base qw(Debconf::Element);
13
14 =head1 DESCRIPTION
15
16 This is an input element that can display a dialog box with a password input
17 field on it.
18
19 =cut
20
21 sub show {
22 my $this=shift;
23
24 my ($text, $lines, $columns)=
25 $this->frontend->makeprompt($this->question);
26
27 my @params=('--passwordbox');
28 push @params, $this->frontend->dashsep if $this->frontend->dashsep;
29 push @params, ($text, $lines + $this->frontend->spacer, $columns);
30 my $ret=$this->frontend->showdialog($this->question, @params);
31
32 # The password isn't passed in, so if nothing is entered,
33 # use the default.
34 if (! defined $ret || $ret eq '') {
35 my $default='';
36 $default=$this->question->value
37 if defined $this->question->value;
38 $this->value($default);
39 }
40 else {
41 $this->value($ret);
42 }
43 }
44
45 1