| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
=head1 NAME |
| 4 |
|
| 5 |
Debconf::Element::Gnome::Password - password input widget |
| 6 |
|
| 7 |
=cut |
| 8 |
|
| 9 |
package Debconf::Element::Gnome::Password; |
| 10 |
use warnings; |
| 11 |
use strict; |
| 12 |
use Gtk3; |
| 13 |
use utf8; |
| 14 |
use base qw(Debconf::Element::Gnome); |
| 15 |
|
| 16 |
=head1 DESCRIPTION |
| 17 |
|
| 18 |
This is a password input widget. |
| 19 |
|
| 20 |
=cut |
| 21 |
|
| 22 |
=head1 METHODS |
| 23 |
|
| 24 |
=over 4 |
| 25 |
|
| 26 |
=cut |
| 27 |
|
| 28 |
sub init { |
| 29 |
my $this=shift; |
| 30 |
|
| 31 |
$this->SUPER::init(@_); |
| 32 |
$this->adddescription; |
| 33 |
|
| 34 |
$this->widget(Gtk3::Entry->new); |
| 35 |
$this->widget->show; |
| 36 |
$this->widget->set_visibility(0); |
| 37 |
$this->addwidget($this->widget); |
| 38 |
$this->tip( $this->widget ); |
| 39 |
$this->addhelp; |
| 40 |
} |
| 41 |
|
| 42 |
=item value |
| 43 |
|
| 44 |
If the widget's value field is empty, return the default. |
| 45 |
|
| 46 |
=cut |
| 47 |
|
| 48 |
sub value { |
| 49 |
my $this=shift; |
| 50 |
|
| 51 |
# FIXME in which encoding? |
| 52 |
my $text = $this->widget->get_chars(0, -1); |
| 53 |
$text = $this->question->value if $text eq ''; |
| 54 |
return $text; |
| 55 |
} |
| 56 |
|
| 57 |
=back |
| 58 |
|
| 59 |
=head1 AUTHOR |
| 60 |
|
| 61 |
Eric Gillespie <[email protected]> |
| 62 |
Gustavo Noronha Silva <[email protected]> |
| 63 |
|
| 64 |
=cut |
| 65 |
|
| 66 |
1 |