EVERYTHING FROM THE OTHER REPO
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Boolean;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my @params=('--yesno');
|
||||
push @params, $this->frontend->dashsep if $this->frontend->dashsep;
|
||||
push @params, $this->frontend->makeprompt($this->question, 1);
|
||||
if (defined $this->question->value && $this->question->value eq 'false') {
|
||||
unshift @params, '--defaultno';
|
||||
}
|
||||
|
||||
my ($ret, $value)=$this->frontend->showdialog($this->question, @params);
|
||||
if (defined $ret) {
|
||||
$this->value($ret eq 0 ? 'true' : 'false');
|
||||
}
|
||||
else {
|
||||
my $default='';
|
||||
$default=$this->question->value
|
||||
if defined $this->question->value;
|
||||
$this->value($default);
|
||||
}
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Error;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->showtext($this->question,
|
||||
$this->question->description."\n\n".
|
||||
$this->question->extended_description
|
||||
);
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Multiselect;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Multiselect);
|
||||
use Debconf::Encoding qw(width);
|
||||
use Debconf::Log qw(debug);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my ($text, $lines, $columns)=
|
||||
$this->frontend->makeprompt($this->question, -2);
|
||||
|
||||
my $screen_lines=$this->frontend->screenheight - $this->frontend->spacer;
|
||||
my @params=();
|
||||
my @choices=$this->question->choices_split;
|
||||
my %value = map { $_ => 1 } $this->translate_default;
|
||||
|
||||
my $menu_height=$#choices + 1;
|
||||
if ($lines + $#choices + 2 >= $screen_lines) {
|
||||
$menu_height = $screen_lines - $lines - 4;
|
||||
if ($menu_height < 3 && $#choices + 1 > 2) {
|
||||
$this->frontend->showtext($this->question, $this->question->extended_description);
|
||||
($text, $lines, $columns)=$this->frontend->sizetext($this->question->description);
|
||||
$menu_height=$#choices + 1;
|
||||
if ($lines + $#choices + 2 >= $screen_lines) {
|
||||
$menu_height = $screen_lines - $lines - 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$lines=$lines + $menu_height + $this->frontend->spacer;
|
||||
my $selectspacer = $this->frontend->selectspacer;
|
||||
my $c=1;
|
||||
my %unellipsized;
|
||||
foreach (@choices) {
|
||||
my $choice = $this->frontend->ellipsize($_);
|
||||
|
||||
if (exists $unellipsized{$choice}) {
|
||||
debug 'developer' => sprintf
|
||||
'Ambiguous ellipsized choice "%s": "%s" or "%s". Overflow.',
|
||||
$choice, $unellipsized{$choice}, $_;
|
||||
$choice = $_;
|
||||
}
|
||||
$unellipsized{$choice} = $_;
|
||||
|
||||
push @params, ($choice, "");
|
||||
push @params, ($value{$_} ? 'on' : 'off');
|
||||
|
||||
if ($columns < width($choice) + $selectspacer) {
|
||||
$columns = width($choice) + $selectspacer;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->frontend->dashsep) {
|
||||
unshift @params, $this->frontend->dashsep;
|
||||
}
|
||||
|
||||
@params=('--separate-output', '--checklist',
|
||||
$text, $lines, $columns, $menu_height, @params);
|
||||
|
||||
my $value=$this->frontend->showdialog($this->question, @params);
|
||||
|
||||
if (defined $value) {
|
||||
$this->value(join(", ", $this->order_values(
|
||||
map { $this->translate_to_C($unellipsized{$_}) }
|
||||
split(/\n/, $value))));
|
||||
}
|
||||
else {
|
||||
my $default='';
|
||||
$default=$this->question->value
|
||||
if defined $this->question->value;
|
||||
$this->value($default);
|
||||
}
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Note;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->showtext($this->question,
|
||||
$this->question->description."\n\n".
|
||||
$this->question->extended_description
|
||||
);
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Password;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my ($text, $lines, $columns)=
|
||||
$this->frontend->makeprompt($this->question);
|
||||
|
||||
my @params=('--passwordbox');
|
||||
push @params, $this->frontend->dashsep if $this->frontend->dashsep;
|
||||
push @params, ($text, $lines + $this->frontend->spacer, $columns);
|
||||
my $ret=$this->frontend->showdialog($this->question, @params);
|
||||
|
||||
if (! defined $ret || $ret eq '') {
|
||||
my $default='';
|
||||
$default=$this->question->value
|
||||
if defined $this->question->value;
|
||||
$this->value($default);
|
||||
}
|
||||
else {
|
||||
$this->value($ret);
|
||||
}
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Progress;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub _communicate {
|
||||
my $this=shift;
|
||||
my $data=shift;
|
||||
my $dialoginput = $this->frontend->dialog_input_wtr;
|
||||
|
||||
print $dialoginput $data;
|
||||
}
|
||||
|
||||
sub _percent {
|
||||
my $this=shift;
|
||||
|
||||
use integer;
|
||||
return (($this->progress_cur() - $this->progress_min()) * 100 / ($this->progress_max() - $this->progress_min()));
|
||||
}
|
||||
|
||||
sub start {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->title($this->question->description);
|
||||
|
||||
my ($text, $lines, $columns);
|
||||
if (defined $this->_info) {
|
||||
($text, $lines, $columns)=$this->frontend->sizetext($this->_info->description);
|
||||
} else {
|
||||
($text, $lines, $columns)=$this->frontend->sizetext(' ');
|
||||
}
|
||||
if ($this->frontend->screenwidth - $this->frontend->columnspacer > $columns) {
|
||||
$columns = $this->frontend->screenwidth - $this->frontend->columnspacer;
|
||||
}
|
||||
|
||||
my @params=('--gauge');
|
||||
push @params, $this->frontend->dashsep if $this->frontend->dashsep;
|
||||
push @params, ($text, $lines + $this->frontend->spacer, $columns, $this->_percent);
|
||||
|
||||
$this->frontend->startdialog($this->question, 1, @params);
|
||||
|
||||
$this->_lines($lines);
|
||||
$this->_columns($columns);
|
||||
}
|
||||
|
||||
sub set {
|
||||
my $this=shift;
|
||||
my $value=shift;
|
||||
|
||||
$this->progress_cur($value);
|
||||
$this->_communicate($this->_percent . "\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub info {
|
||||
my $this=shift;
|
||||
my $question=shift;
|
||||
|
||||
$this->_info($question);
|
||||
|
||||
my ($text, $lines, $columns)=$this->frontend->sizetext($question->description);
|
||||
if ($lines > $this->_lines or $columns > $this->_columns) {
|
||||
$this->stop;
|
||||
$this->start;
|
||||
}
|
||||
|
||||
|
||||
$this->_communicate(
|
||||
sprintf("XXX\n%d\n%s\nXXX\n%d\n",
|
||||
$this->_percent, $text, $this->_percent));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub stop {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->waitdialog;
|
||||
$this->frontend->title($this->frontend->requested_title);
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Select;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Select);
|
||||
use Debconf::Encoding qw(width);
|
||||
use Debconf::Log qw(debug);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my ($text, $lines, $columns)=
|
||||
$this->frontend->makeprompt($this->question, -2);
|
||||
|
||||
my $screen_lines=$this->frontend->screenheight - $this->frontend->spacer;
|
||||
my $default=$this->translate_default;
|
||||
my @params=();
|
||||
my @choices=$this->question->choices_split;
|
||||
|
||||
my $menu_height=$#choices + 1;
|
||||
if ($lines + $#choices + 2 >= $screen_lines) {
|
||||
$menu_height = $screen_lines - $lines - 4;
|
||||
}
|
||||
|
||||
$lines=$lines + $menu_height + $this->frontend->spacer;
|
||||
my $c=1;
|
||||
my $selectspacer = $this->frontend->selectspacer;
|
||||
my %unellipsized;
|
||||
foreach (@choices) {
|
||||
my $choice = $this->frontend->ellipsize($_);
|
||||
|
||||
if (exists $unellipsized{$choice}) {
|
||||
debug 'developer' => sprintf
|
||||
'Ambiguous ellipsized choice "%s": "%s" or "%s". Overflow.',
|
||||
$choice, $unellipsized{$choice}, $_;
|
||||
$choice = $_;
|
||||
}
|
||||
$unellipsized{$choice} = $_;
|
||||
|
||||
push @params, $choice, '';
|
||||
|
||||
if ($columns < width($choice) + $selectspacer) {
|
||||
$columns = width($choice) + $selectspacer;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->frontend->dashsep) {
|
||||
unshift @params, $this->frontend->dashsep;
|
||||
}
|
||||
|
||||
@params=('--default-item', $default, '--menu',
|
||||
$text, $lines, $columns, $menu_height, @params);
|
||||
|
||||
my $value=$this->frontend->showdialog($this->question, @params);
|
||||
if (defined $value) {
|
||||
$this->value($this->translate_to_C($unellipsized{$value}));
|
||||
}
|
||||
else {
|
||||
my $default='';
|
||||
$default=$this->question->value
|
||||
if defined $this->question->value;
|
||||
$this->value($default);
|
||||
}
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::String;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my ($text, $lines, $columns)=
|
||||
$this->frontend->makeprompt($this->question);
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
|
||||
my @params=('--inputbox');
|
||||
push @params, $this->frontend->dashsep if $this->frontend->dashsep;
|
||||
push @params, ($text, $lines + $this->frontend->spacer,
|
||||
$columns, $default);
|
||||
|
||||
my $value=$this->frontend->showdialog($this->question, @params);
|
||||
if (defined $value) {
|
||||
$this->value($value);
|
||||
}
|
||||
else {
|
||||
my $default='';
|
||||
$default=$this->question->value
|
||||
if defined $this->question->value;
|
||||
$this->value($default);
|
||||
}
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Dialog::Text;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->showtext($this->question,
|
||||
$this->question->description."\n\n".
|
||||
$this->question->extended_description
|
||||
);
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Boolean;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->comment($this->question->extended_description."\n\n".
|
||||
"(".gettext("Choices").": ".join(", ", gettext("yes"), gettext("no")).")\n".
|
||||
$this->question->description."\n");
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
if ($default eq 'true') {
|
||||
$default=gettext("yes");
|
||||
}
|
||||
elsif ($default eq 'false') {
|
||||
$default=gettext("no");
|
||||
}
|
||||
|
||||
$this->frontend->item($this->question->name, $default);
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->SUPER::value() unless @_;
|
||||
my $value=shift;
|
||||
|
||||
if ($value eq 'yes' || $value eq gettext("yes")) {
|
||||
return $this->SUPER::value('true');
|
||||
}
|
||||
elsif ($value eq 'no' || $value eq gettext("no")) {
|
||||
return $this->SUPER::value('false');
|
||||
}
|
||||
else {
|
||||
return $this->SUPER::value($this->question->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Error;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Editor::Text);
|
||||
|
||||
1
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Multiselect;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use base qw(Debconf::Element::Multiselect);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my @choices=$this->question->choices_split;
|
||||
|
||||
$this->frontend->comment($this->question->extended_description."\n\n".
|
||||
"(".gettext("Choices").": ".join(", ", @choices).")\n".
|
||||
gettext("(Enter zero or more items separated by a comma followed by a space (', ').)")."\n".
|
||||
$this->question->description."\n");
|
||||
|
||||
$this->frontend->item($this->question->name, join ", ", $this->translate_default);
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->SUPER::value() unless @_;
|
||||
my @values=split(',\s+', shift);
|
||||
|
||||
my %valid=map { $_ => 1 } $this->question->choices_split;
|
||||
|
||||
$this->SUPER::value(join(', ', $this->order_values(
|
||||
map { $this->translate_to_C($_) }
|
||||
grep { $valid{$_} } @values)));
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Note;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Editor::Text);
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Password;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Editor::String);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Progress;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
|
||||
sub start {
|
||||
}
|
||||
|
||||
sub set {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub info {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub stop {
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Select;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use base qw(Debconf::Element::Select);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my $default=$this->translate_default;
|
||||
my @choices=$this->question->choices_split;
|
||||
|
||||
$this->frontend->comment($this->question->extended_description."\n\n".
|
||||
"(".gettext("Choices").": ".join(", ", @choices).")\n".
|
||||
$this->question->description."\n");
|
||||
$this->frontend->item($this->question->name, $default);
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->SUPER::value() unless @_;
|
||||
my $value=shift;
|
||||
|
||||
my %valid=map { $_ => 1 } $this->question->choices_split;
|
||||
|
||||
if ($valid{$value}) {
|
||||
return $this->SUPER::value($this->translate_to_C($value));
|
||||
}
|
||||
else {
|
||||
return $this->SUPER::value($this->question->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::String;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->comment($this->question->extended_description."\n\n".
|
||||
$this->question->description."\n");
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
|
||||
$this->frontend->item($this->question->name, $default);
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Editor::Text;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->comment($this->question->extended_description."\n\n".
|
||||
$this->question->description."\n\n");
|
||||
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,143 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome;
|
||||
use warnings;
|
||||
use strict;
|
||||
use utf8;
|
||||
use Gtk3;
|
||||
use Debconf::Gettext;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
|
||||
$this->hbox(Gtk3::VBox->new(0, 10));
|
||||
|
||||
$this->hline1(Gtk3::HBox->new(0, 10));
|
||||
$this->hline1->show;
|
||||
$this->line1(Gtk3::VBox->new(0, 10));
|
||||
$this->line1->show;
|
||||
$this->line1->pack_end ($this->hline1, 1, 1, 0);
|
||||
|
||||
$this->hline2(Gtk3::HBox->new(0, 10));
|
||||
$this->hline2->show;
|
||||
$this->line2(Gtk3::VBox->new(0, 10));
|
||||
$this->line2->show;
|
||||
$this->line2->pack_end ($this->hline2, 1, 1, 0);
|
||||
|
||||
$this->vbox(Gtk3::VBox->new(0, 5));
|
||||
$this->vbox->pack_start($this->line1, 0, 0, 0);
|
||||
$this->vbox->pack_start($this->line2, 1, 1, 0);
|
||||
$this->vbox->show;
|
||||
|
||||
$this->hbox->pack_start($this->vbox, 1, 1, 0);
|
||||
$this->hbox->show;
|
||||
|
||||
$this->fill(0);
|
||||
$this->expand(0);
|
||||
$this->multiline(0);
|
||||
}
|
||||
|
||||
|
||||
sub addwidget {
|
||||
my $this=shift;
|
||||
my $widget=shift;
|
||||
|
||||
if ($this->multiline == 0) {
|
||||
$this->hline1->pack_start($widget, 1, 1, 0);
|
||||
}
|
||||
else {
|
||||
$this->hline2->pack_start($widget, 1, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub adddescription {
|
||||
my $this=shift;
|
||||
my $description=to_Unicode($this->question->description);
|
||||
|
||||
my $label=Gtk3::Label->new($description);
|
||||
$label->show;
|
||||
$this->line1->pack_start($label, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
sub addbutton {
|
||||
my $this=shift;
|
||||
my $text = shift;
|
||||
my $callback = shift;
|
||||
|
||||
my $button = Gtk3::Button->new_with_mnemonic(to_Unicode($text));
|
||||
$button->show;
|
||||
$button->signal_connect("clicked", $callback);
|
||||
|
||||
my $vbox = Gtk3::VBox->new(0, 0);
|
||||
$vbox->show;
|
||||
$vbox->pack_start($button, 1, 0, 0);
|
||||
$this->hline1->pack_end($vbox, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
sub create_message_dialog {
|
||||
my $this = shift;
|
||||
my $type = shift;
|
||||
my $title = shift;
|
||||
my $text = shift;
|
||||
|
||||
my $dialog =
|
||||
Gtk3::Dialog->new_with_buttons(to_Unicode($title), undef,
|
||||
"modal", "gtk-close", "close");
|
||||
$dialog->set_border_width(3);
|
||||
|
||||
my $hbox = Gtk3::HBox->new(0);
|
||||
$dialog->get_content_area->pack_start($hbox, 1, 1, 5);
|
||||
$hbox->show;
|
||||
|
||||
my $alignment = Gtk3::Alignment->new(0.5, 0.0, 1.0, 0.0);
|
||||
$hbox->pack_start($alignment, 1, 1, 3);
|
||||
$alignment->show;
|
||||
|
||||
my $image = Gtk3::Image->new_from_stock($type, "dialog");
|
||||
$alignment->add($image);
|
||||
$image->show;
|
||||
|
||||
my $label = Gtk3::Label->new(to_Unicode($text));
|
||||
$label->set_line_wrap(1);
|
||||
$hbox->pack_start($label, 1, 1, 2);
|
||||
$label->show;
|
||||
|
||||
$dialog->run;
|
||||
$dialog->destroy;
|
||||
}
|
||||
|
||||
|
||||
sub addhelp {
|
||||
my $this=shift;
|
||||
|
||||
my $help=$this->question->extended_description;
|
||||
return unless length $help;
|
||||
|
||||
$this->addbutton(gettext("_Help"), sub {
|
||||
$this->create_message_dialog("gtk-dialog-info",
|
||||
gettext("Help"),
|
||||
to_Unicode($help));
|
||||
});
|
||||
|
||||
if (defined $this->tip ){
|
||||
$this->tip->set_tooltip_text(to_Unicode($help));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Boolean;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use base qw(Debconf::Element::Gnome);
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
my $description=to_Unicode($this->question->description);
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
|
||||
$this->widget(Gtk3::CheckButton->new($description));
|
||||
$this->widget->show;
|
||||
$this->widget->set_active(($this->question->value eq 'true') ? 1 : 0);
|
||||
$this->addwidget($this->widget);
|
||||
$this->tip( $this->widget );
|
||||
$this->addhelp;
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
if ($this->widget->get_active) {
|
||||
return "true";
|
||||
}
|
||||
else {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Error;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use base qw(Debconf::Element::Gnome);
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
my $extended_description = to_Unicode($this->question->extended_description);
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
$this->multiline(1);
|
||||
$this->fill(1);
|
||||
$this->expand(1);
|
||||
$this->widget(Gtk3::HBox->new(0, 0));
|
||||
|
||||
my $image = Gtk3::Image->new_from_stock("gtk-dialog-error", "dialog");
|
||||
$image->show;
|
||||
|
||||
my $text = Gtk3::TextView->new();
|
||||
my $textbuffer = $text->get_buffer;
|
||||
$text->show;
|
||||
$text->set_wrap_mode ("word");
|
||||
$text->set_editable (0);
|
||||
|
||||
my $scrolled_window = Gtk3::ScrolledWindow->new();
|
||||
$scrolled_window->show;
|
||||
$scrolled_window->set_policy('automatic', 'automatic');
|
||||
$scrolled_window->set_shadow_type('in');
|
||||
$scrolled_window->add ($text);
|
||||
|
||||
$this->widget->show;
|
||||
$this->widget->pack_start($image, 0, 0, 6);
|
||||
$this->widget->pack_start($scrolled_window, 1, 1, 0);
|
||||
|
||||
$textbuffer->set_text($extended_description);
|
||||
|
||||
$this->widget->show;
|
||||
$this->adddescription;
|
||||
$this->addwidget($this->widget);
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Multiselect;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use base qw(Debconf::Element::Gnome Debconf::Element::Multiselect);
|
||||
|
||||
use constant SELECTED_COLUMN => 0;
|
||||
use constant CHOICES_COLUMN => 1;
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
my @choices = map { to_Unicode($_) } $this->question->choices_split;
|
||||
my %default=map { to_Unicode($_) => 1 } $this->translate_default;
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
$this->multiline(1);
|
||||
|
||||
$this->adddescription;
|
||||
|
||||
$this->widget(Gtk3::ScrolledWindow->new);
|
||||
$this->widget->show;
|
||||
$this->widget->set_policy('automatic', 'automatic');
|
||||
|
||||
my $list_store = Gtk3::ListStore->new('Glib::Boolean', 'Glib::String');
|
||||
$this->list_view(Gtk3::TreeView->new($list_store));
|
||||
$this->list_view->set_headers_visible(0);
|
||||
|
||||
my $renderer_toggle = Gtk3::CellRendererToggle->new;
|
||||
$renderer_toggle->signal_connect(toggled => sub {
|
||||
my $path_string = $_[1];
|
||||
my $model = $_[2];
|
||||
my $iter = $model->get_iter_from_string($path_string);
|
||||
$model->set($iter, SELECTED_COLUMN,
|
||||
not $model->get($iter, SELECTED_COLUMN));
|
||||
}, $list_store);
|
||||
|
||||
$this->list_view->append_column(
|
||||
Gtk3::TreeViewColumn->new_with_attributes('Selected',
|
||||
$renderer_toggle, 'active', SELECTED_COLUMN));
|
||||
$this->list_view->append_column(
|
||||
Gtk3::TreeViewColumn->new_with_attributes('Choices',
|
||||
Gtk3::CellRendererText->new, 'text', CHOICES_COLUMN));
|
||||
$this->list_view->show;
|
||||
|
||||
$this->widget->add($this->list_view);
|
||||
|
||||
for (my $i=0; $i <= $#choices; $i++) {
|
||||
my $iter = $list_store->append();
|
||||
$list_store->set($iter, CHOICES_COLUMN, $choices[$i]);
|
||||
if ($default{$choices[$i]}) {
|
||||
$list_store->set($iter, SELECTED_COLUMN, 1);
|
||||
}
|
||||
}
|
||||
$this->addwidget($this->widget);
|
||||
$this->tip($this->list_view);
|
||||
$this->addhelp;
|
||||
|
||||
$this->fill(1);
|
||||
$this->expand(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
my $list_view = $this->list_view;
|
||||
my $list_store = $list_view->get_model();
|
||||
my ($ret, $val);
|
||||
|
||||
my @vals;
|
||||
$this->question->template->i18n('');
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
|
||||
my $iter = $list_store->get_iter_first();
|
||||
for (my $i=0; $i <= $#choices; $i++) {
|
||||
if ($list_store->get($iter, SELECTED_COLUMN)) {
|
||||
push @vals, $choices[$i];
|
||||
}
|
||||
$list_store->iter_next($iter) or last;
|
||||
}
|
||||
|
||||
return join(', ', $this->order_values(@vals));
|
||||
}
|
||||
|
||||
*visible = \&Debconf::Element::Multiselect::visible;
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Note;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use Debconf::Element::Noninteractive::Note;
|
||||
use base qw(Debconf::Element::Gnome);
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
my $extended_description = to_Unicode($this->question->extended_description);
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
$this->multiline(1);
|
||||
$this->fill(1);
|
||||
$this->expand(1);
|
||||
$this->widget(Gtk3::HBox->new(0, 0));
|
||||
|
||||
my $text = Gtk3::TextView->new();
|
||||
my $textbuffer = $text->get_buffer;
|
||||
$text->show;
|
||||
$text->set_wrap_mode ("word");
|
||||
$text->set_editable (0);
|
||||
|
||||
my $scrolled_window = Gtk3::ScrolledWindow->new();
|
||||
$scrolled_window->show;
|
||||
$scrolled_window->set_policy('automatic', 'automatic');
|
||||
$scrolled_window->set_shadow_type('in');
|
||||
$scrolled_window->add ($text);
|
||||
|
||||
$this->widget->show;
|
||||
$this->widget->pack_start($scrolled_window, 1, 1, 0);
|
||||
|
||||
$textbuffer->set_text($extended_description);
|
||||
|
||||
$this->widget->show;
|
||||
$this->adddescription;
|
||||
$this->addwidget($this->widget);
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Password;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use base qw(Debconf::Element::Gnome);
|
||||
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
$this->adddescription;
|
||||
|
||||
$this->widget(Gtk3::Entry->new);
|
||||
$this->widget->show;
|
||||
$this->widget->set_visibility(0);
|
||||
$this->addwidget($this->widget);
|
||||
$this->tip( $this->widget );
|
||||
$this->addhelp;
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
my $text = $this->widget->get_chars(0, -1);
|
||||
$text = $this->question->value if $text eq '';
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Progress;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use base qw(Debconf::Element::Gnome);
|
||||
|
||||
|
||||
sub _fraction {
|
||||
my $this=shift;
|
||||
|
||||
return (($this->progress_cur() - $this->progress_min()) / ($this->progress_max() - $this->progress_min()));
|
||||
}
|
||||
|
||||
sub start {
|
||||
my $this=shift;
|
||||
my $description=to_Unicode($this->question->description);
|
||||
my $frontend=$this->frontend;
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
$this->multiline(1);
|
||||
$this->expand(1);
|
||||
|
||||
$frontend->title($description);
|
||||
|
||||
$this->widget(Gtk3::ProgressBar->new());
|
||||
$this->widget->show;
|
||||
$this->widget->set_text(' ');
|
||||
$this->addwidget($this->widget);
|
||||
$this->addhelp;
|
||||
}
|
||||
|
||||
sub set {
|
||||
my $this=shift;
|
||||
my $value=shift;
|
||||
|
||||
$this->progress_cur($value);
|
||||
$this->widget->set_fraction($this->_fraction);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub info {
|
||||
my $this=shift;
|
||||
my $question=shift;
|
||||
|
||||
$this->widget->set_text(to_Unicode($question->description));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub stop {
|
||||
my $this=shift;
|
||||
my $frontend=$this->frontend;
|
||||
|
||||
$frontend->title($frontend->requested_title);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Select;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use base qw(Debconf::Element::Gnome Debconf::Element::Select);
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
|
||||
my $default=$this->translate_default;
|
||||
my @choices=$this->question->choices_split;
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
|
||||
$this->widget(Gtk3::ComboBoxText->new);
|
||||
$this->widget->show;
|
||||
|
||||
foreach my $choice (@choices) {
|
||||
$this->widget->append_text(to_Unicode($choice));
|
||||
}
|
||||
|
||||
$this->widget->set_active(0);
|
||||
for (my $choice=0; $choice <= $#choices; $choice++) {
|
||||
if ($choices[$choice] eq $default) {
|
||||
$this->widget->set_active($choice);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$this->adddescription;
|
||||
$this->addwidget($this->widget);
|
||||
$this->tip( $this->widget );
|
||||
$this->addhelp;
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->translate_to_C_uni($this->widget->get_active_text);
|
||||
}
|
||||
|
||||
*visible = \&Debconf::Element::Select::visible;
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::String;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Gtk3;
|
||||
use utf8;
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
use base qw(Debconf::Element::Gnome);
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
|
||||
$this->widget(Gtk3::Entry->new);
|
||||
$this->widget->show;
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
|
||||
$this->widget->set_text(to_Unicode($default));
|
||||
|
||||
$this->adddescription;
|
||||
$this->addwidget($this->widget);
|
||||
$this->tip( $this->widget );
|
||||
$this->addhelp;
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->widget->get_chars(0, -1);
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Gnome::Text;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use utf8;
|
||||
use base qw(Debconf::Element::Gnome);
|
||||
|
||||
|
||||
sub init {
|
||||
my $this=shift;
|
||||
|
||||
$this->SUPER::init(@_);
|
||||
$this->adddescription; # yeah, that's all
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Multiselect;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Select);
|
||||
|
||||
|
||||
sub order_values {
|
||||
my $this=shift;
|
||||
my %vals=map { $_ => 1 } @_;
|
||||
$this->question->template->i18n('');
|
||||
my @ret=grep { $vals{$_} } $this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
return @ret;
|
||||
}
|
||||
|
||||
|
||||
sub visible {
|
||||
my $this=shift;
|
||||
|
||||
my @choices=$this->question->choices_split;
|
||||
return ($#choices >= 0);
|
||||
}
|
||||
|
||||
|
||||
sub translate_default {
|
||||
my $this=shift;
|
||||
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n('');
|
||||
my @choices_c=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
|
||||
my @ret;
|
||||
foreach my $c_default ($this->question->value_split) {
|
||||
foreach (my $x=0; $x <= $#choices; $x++) {
|
||||
push @ret, $choices[$x]
|
||||
if $choices_c[$x] eq $c_default;
|
||||
}
|
||||
}
|
||||
return @ret;
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub visible {
|
||||
my $this=shift;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
$this->value($default);
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Boolean;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Error;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Text::Wrap;
|
||||
use Debconf::Gettext;
|
||||
use Debconf::Config;
|
||||
use Debconf::Log ':all';
|
||||
use Debconf::Path;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
if ($this->question->flag('seen') ne 'true') {
|
||||
$this->sendmail(gettext("Debconf is not confident this error message was displayed, so it mailed it to you."));
|
||||
|
||||
$this->frontend->display($this->question->description."\n\n".
|
||||
$this->question->extended_description."\n");
|
||||
}
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
|
||||
sub sendmail {
|
||||
my $this=shift;
|
||||
my $footer=shift;
|
||||
return unless length Debconf::Config->admin_email;
|
||||
if (Debconf::Path::find("mail")) {
|
||||
debug user => "mailing a note";
|
||||
my $title=gettext("Debconf").": ".
|
||||
$this->frontend->title." -- ".
|
||||
$this->question->description;
|
||||
unless (open(my $mail, "|-")) { # child
|
||||
exec("mail", "-s", $title, Debconf::Config->admin_email) or return '';
|
||||
}
|
||||
my $old_columns=$Text::Wrap::columns;
|
||||
$Text::Wrap::columns=75;
|
||||
if ($this->question->extended_description ne '') {
|
||||
print $mail wrap('', '', $this->question->extended_description);
|
||||
}
|
||||
else {
|
||||
print $mail wrap('', '', $this->question->description);
|
||||
}
|
||||
print $mail "\n\n";
|
||||
my $hostname=`hostname -f 2>/dev/null`;
|
||||
if (! defined $hostname) {
|
||||
$hostname="unknown system";
|
||||
}
|
||||
print $mail "-- \n", sprintf(gettext("Debconf, running at %s"), $hostname, "\n");
|
||||
print $mail "[ ", wrap('', '', $footer), " ]\n" if $footer;
|
||||
close $mail or return '';
|
||||
|
||||
$Text::Wrap::columns=$old_columns;
|
||||
|
||||
$this->question->flag('seen', 'true');
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Multiselect;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Note;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Password;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Progress;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
sub start {
|
||||
}
|
||||
|
||||
sub set {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub info {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub stop {
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Select;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->question->template->i18n('');
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
my $value=$this->question->value;
|
||||
$value='' unless defined $value;
|
||||
my $inlist=0;
|
||||
map { $inlist=1 if $_ eq $value } @choices;
|
||||
|
||||
if (! $inlist) {
|
||||
if (@choices) {
|
||||
$this->value($choices[0]);
|
||||
}
|
||||
else {
|
||||
$this->value('');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->value($value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::String;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Noninteractive::Text;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Noninteractive);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Select;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Log ':all';
|
||||
use Debconf::Gettext;
|
||||
use base qw(Debconf::Element);
|
||||
use Debconf::Encoding qw(to_Unicode);
|
||||
|
||||
|
||||
sub visible {
|
||||
my $this=shift;
|
||||
|
||||
my @choices=$this->question->choices_split;
|
||||
|
||||
if (@choices > 1) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
debug 'developer' => 'Not displaying select list '.
|
||||
$this->question->name.' with '.
|
||||
(@choices+0).' choice'.((@choices == 0) ? 's' : '');
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub translate_default {
|
||||
my $this=shift;
|
||||
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n('');
|
||||
my @choices_c=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
|
||||
my $c_default='';
|
||||
$c_default=$this->question->value if defined $this->question->value;
|
||||
foreach (my $x=0; $x <= $#choices; $x++) {
|
||||
return $choices[$x] if $choices_c[$x] eq $c_default;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
sub translate_to_C {
|
||||
my $this=shift;
|
||||
my $value=shift;
|
||||
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n('');
|
||||
my @choices_c=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
|
||||
for (my $x=0; $x <= $#choices; $x++) {
|
||||
return $choices_c[$x] if $choices[$x] eq $value;
|
||||
}
|
||||
debug developer => sprintf(gettext("Input value, \"%s\" not found in C choices! This should never happen. Perhaps the templates were incorrectly localized."), $value);
|
||||
return '';
|
||||
}
|
||||
|
||||
sub translate_to_C_uni {
|
||||
my $this=shift;
|
||||
my $value=shift;
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n('');
|
||||
my @choices_c=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
|
||||
for (my $x=0; $x <= $#choices; $x++) {
|
||||
return $choices_c[$x] if to_Unicode($choices[$x]) eq $value;
|
||||
}
|
||||
debug developer => sprintf(gettext("Input value, \"%s\" not found in C choices! This should never happen. Perhaps the templates were incorrectly localized."), $value);
|
||||
return '';
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Boolean;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my $y=gettext("yes");
|
||||
my $n=gettext("no");
|
||||
|
||||
$this->frontend->display($this->question->extended_description."\n");
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
if ($default eq 'true') {
|
||||
$default=$y;
|
||||
}
|
||||
elsif ($default eq 'false') {
|
||||
$default=$n;
|
||||
}
|
||||
|
||||
my $description=$this->question->description;
|
||||
if (Debconf::Config->terse eq 'false') {
|
||||
$description.=" [$y/$n]";
|
||||
}
|
||||
|
||||
my $value='';
|
||||
|
||||
while (1) {
|
||||
$_=$this->frontend->prompt(
|
||||
default => $default,
|
||||
completions => [$y, $n],
|
||||
prompt => $description,
|
||||
question => $this->question,
|
||||
);
|
||||
return unless defined $_;
|
||||
|
||||
if (substr($y, 0, 1) ne substr($n, 0, 1)) {
|
||||
$y=substr($y, 0, 1);
|
||||
$n=substr($n, 0, 1);
|
||||
}
|
||||
if (/^\Q$y\E/i) {
|
||||
$value='true';
|
||||
last;
|
||||
}
|
||||
elsif (/^\Q$n\E/i) {
|
||||
$value='false';
|
||||
last;
|
||||
}
|
||||
|
||||
if (/^y/i) {
|
||||
$value='true';
|
||||
last;
|
||||
}
|
||||
elsif (/^n/i) {
|
||||
$value='false';
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$this->frontend->display("\n");
|
||||
$this->value($value);
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Error;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Teletype::Text);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,99 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Multiselect;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Gettext;
|
||||
use Debconf::Config;
|
||||
use base qw(Debconf::Element::Multiselect Debconf::Element::Teletype::Select);
|
||||
|
||||
|
||||
|
||||
sub expand_ranges {
|
||||
my @ranges = @_;
|
||||
my @accumulator;
|
||||
for my $item (@ranges) {
|
||||
if ($item =~ /\A(\d+)-(\d+)\Z/) {
|
||||
my ($begin, $end) = ($1, $2);
|
||||
for (my $i = $begin; $i <= $end; $i++) {
|
||||
push @accumulator, $i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
push @accumulator, $item;
|
||||
}
|
||||
}
|
||||
return @accumulator;
|
||||
}
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my @selected;
|
||||
my $none_of_the_above=gettext("none of the above");
|
||||
|
||||
my @choices=$this->question->choices_split;
|
||||
my %value = map { $_ => 1 } $this->translate_default;
|
||||
if ($this->frontend->promptdefault && $this->question->value ne '') {
|
||||
push @choices, $none_of_the_above;
|
||||
}
|
||||
my @completions=@choices;
|
||||
my $i=1;
|
||||
my %choicenum=map { $_ => $i++ } @choices;
|
||||
|
||||
$this->frontend->display($this->question->extended_description."\n");
|
||||
|
||||
my $default;
|
||||
if (Debconf::Config->terse eq 'false') {
|
||||
$this->printlist(@choices);
|
||||
$this->frontend->display("\n(".gettext("Enter the items or ranges you want to select, separated by spaces.").")\n");
|
||||
push @completions, 1..@choices;
|
||||
$default=join(" ", map { $choicenum{$_} }
|
||||
grep { $value{$_} } @choices);
|
||||
}
|
||||
else {
|
||||
$default=join(" ", grep { $value{$_} } @choices);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
$_=$this->frontend->prompt(
|
||||
prompt => $this->question->description,
|
||||
default => $default,
|
||||
completions => [@completions],
|
||||
completion_append_character => " ",
|
||||
question => $this->question,
|
||||
);
|
||||
return unless defined $_;
|
||||
|
||||
@selected=split(/[ ,]+/, $_);
|
||||
|
||||
@selected=expand_ranges(@selected);
|
||||
|
||||
@selected=map { $this->expandabbrev($_, @choices) } @selected;
|
||||
|
||||
next if grep { $_ eq '' } @selected;
|
||||
|
||||
if ($#selected > 0) {
|
||||
map { next if $_ eq $none_of_the_above } @selected;
|
||||
}
|
||||
|
||||
last;
|
||||
}
|
||||
|
||||
$this->frontend->display("\n");
|
||||
|
||||
if (defined $selected[0] && $selected[0] eq $none_of_the_above) {
|
||||
$this->value('');
|
||||
}
|
||||
else {
|
||||
my %selected=map { $_ => 1 } @selected;
|
||||
|
||||
$this->value(join(', ', $this->order_values(
|
||||
map { $this->translate_to_C($_) }
|
||||
keys %selected)));
|
||||
}
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Note;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
|
||||
sub visible {
|
||||
my $this=shift;
|
||||
|
||||
return (Debconf::Config->terse eq 'false');
|
||||
}
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->display($this->question->description."\n\n".
|
||||
$this->question->extended_description."\n");
|
||||
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Password;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->display(
|
||||
$this->question->extended_description."\n");
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
|
||||
my $value=$this->frontend->prompt_password(
|
||||
prompt => $this->question->description,
|
||||
default => $default,
|
||||
question => $this->question,
|
||||
);
|
||||
return unless defined $value;
|
||||
|
||||
if ($value eq '') {
|
||||
$value=$default;
|
||||
}
|
||||
|
||||
$this->frontend->display("\n");
|
||||
$this->value($value);
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Progress;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub start {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->title($this->question->description);
|
||||
$this->frontend->display('');
|
||||
$this->last(0);
|
||||
}
|
||||
|
||||
sub set {
|
||||
my $this=shift;
|
||||
my $value=shift;
|
||||
|
||||
$this->progress_cur($value);
|
||||
|
||||
use integer;
|
||||
my $new = ($this->progress_cur() - $this->progress_min()) * 100 / ($this->progress_max() - $this->progress_min());
|
||||
$this->last(0) if $new < $this->last;
|
||||
return if $new / 10 == $this->last / 10;
|
||||
|
||||
$this->last($new);
|
||||
$this->frontend->display("..$new%");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub info {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub stop {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->display("\n");
|
||||
$this->frontend->title($this->frontend->requested_title);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,145 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Select;
|
||||
use warnings;
|
||||
use strict;
|
||||
use Debconf::Config;
|
||||
use POSIX qw(ceil);
|
||||
use base qw(Debconf::Element::Select);
|
||||
|
||||
|
||||
sub expandabbrev {
|
||||
my $this=shift;
|
||||
my $input=shift;
|
||||
my @choices=@_;
|
||||
|
||||
if (Debconf::Config->terse eq 'false' and
|
||||
$input=~m/^[0-9]+$/ and $input ne '0' and $input <= @choices) {
|
||||
return $choices[$input - 1];
|
||||
}
|
||||
|
||||
my @matches=();
|
||||
foreach (@choices) {
|
||||
return $_ if /^\Q$input\E$/;
|
||||
push @matches, $_ if /^\Q$input\E/;
|
||||
}
|
||||
return $matches[0] if @matches == 1;
|
||||
|
||||
if (! @matches) {
|
||||
foreach (@choices) {
|
||||
return $_ if /^\Q$input\E$/i;
|
||||
push @matches, $_ if /^\Q$input\E/i;
|
||||
}
|
||||
return $matches[0] if @matches == 1;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
sub printlist {
|
||||
my $this=shift;
|
||||
my @choices=@_;
|
||||
my $width=$this->frontend->screenwidth;
|
||||
|
||||
my $choice_min=length $choices[0];
|
||||
map { $choice_min = length $_ if length $_ < $choice_min } @choices;
|
||||
my $max_cols=int($width / (2 + length(scalar(@choices)) + 2 + $choice_min)) - 1;
|
||||
$max_cols = $#choices if $max_cols > $#choices;
|
||||
|
||||
my $max_lines;
|
||||
my $num_cols;
|
||||
COLUMN: for ($num_cols = $max_cols; $num_cols >= 0; $num_cols--) {
|
||||
my @col_width;
|
||||
my $total_width;
|
||||
|
||||
$max_lines=ceil(($#choices + 1) / ($num_cols + 1));
|
||||
|
||||
next if ceil(($#choices + 1) / $max_lines) - 1 < $num_cols;
|
||||
|
||||
foreach (my $choice=1; $choice <= $#choices + 1; $choice++) {
|
||||
my $choice_length=2
|
||||
+ length(scalar(@choices)) + 2
|
||||
+ length($choices[$choice - 1]);
|
||||
my $current_col=ceil($choice / $max_lines) - 1;
|
||||
if (! defined $col_width[$current_col] ||
|
||||
$choice_length > $col_width[$current_col]) {
|
||||
$col_width[$current_col]=$choice_length;
|
||||
$total_width=0;
|
||||
map { $total_width += $_ } @col_width;
|
||||
next COLUMN if $total_width > $width;
|
||||
}
|
||||
}
|
||||
|
||||
last;
|
||||
}
|
||||
|
||||
my $line=0;
|
||||
my $max_len=0;
|
||||
my $col=0;
|
||||
my @output=();
|
||||
for (my $choice=0; $choice <= $#choices; $choice++) {
|
||||
$output[$line] .= " ".($choice+1).". " . $choices[$choice];
|
||||
if (length $output[$line] > $max_len) {
|
||||
$max_len = length $output[$line];
|
||||
}
|
||||
if (++$line >= $max_lines) {
|
||||
if ($col++ != $num_cols) {
|
||||
for (my $l=0; $l <= $#output; $l++) {
|
||||
$output[$l] .= ' ' x ($max_len - length $output[$l]);
|
||||
}
|
||||
}
|
||||
|
||||
$line=0;
|
||||
$max_len=0;
|
||||
}
|
||||
}
|
||||
|
||||
for (@output) { s/\s+$//; }
|
||||
|
||||
map { $this->frontend->display_nowrap($_) } @output;
|
||||
}
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
my $default=$this->translate_default;
|
||||
my @choices=$this->question->choices_split;
|
||||
my @completions=@choices;
|
||||
|
||||
$this->frontend->display($this->question->extended_description."\n");
|
||||
|
||||
if (Debconf::Config->terse eq 'false') {
|
||||
for (my $choice=0; $choice <= $#choices; $choice++) {
|
||||
if ($choices[$choice] eq $default) {
|
||||
$default=$choice + 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$this->printlist(@choices);
|
||||
$this->frontend->display("\n");
|
||||
|
||||
push @completions, 1..@choices;
|
||||
}
|
||||
|
||||
my $value;
|
||||
while (1) {
|
||||
$value=$this->frontend->prompt(
|
||||
prompt => $this->question->description,
|
||||
default => $default ? $default : '',
|
||||
completions => [@completions],
|
||||
question => $this->question,
|
||||
);
|
||||
return unless defined $value;
|
||||
$value=$this->expandabbrev($value, @choices);
|
||||
last if $value ne '';
|
||||
}
|
||||
$this->frontend->display("\n");
|
||||
$this->value($this->translate_to_C($value));
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::String;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->display(
|
||||
$this->question->extended_description."\n");
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
|
||||
my $value=$this->frontend->prompt(
|
||||
prompt => $this->question->description,
|
||||
default => $default,
|
||||
question => $this->question,
|
||||
);
|
||||
return unless defined $value;
|
||||
|
||||
$this->frontend->display("\n");
|
||||
$this->value($value);
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Teletype::Text;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$this->frontend->display($this->question->description."\n\n".
|
||||
$this->question->extended_description."\n");
|
||||
|
||||
$this->value('');
|
||||
}
|
||||
|
||||
1
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Boolean;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$_=$this->question->extended_description;
|
||||
s/\n/\n<br>\n/g;
|
||||
$_.="\n<p>\n";
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
my $id=$this->id;
|
||||
$_.="<input type=checkbox name=\"$id\"". ($default eq 'true' ? ' checked' : ''). ">\n<b>".
|
||||
$this->question->description."</b>";
|
||||
|
||||
return $_;
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->SUPER::value() unless @_;
|
||||
my $value=shift;
|
||||
$this->SUPER::value($value eq 'on' ? 'true' : 'false');
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Error;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Web::Text);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Multiselect;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Multiselect);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$_=$this->question->extended_description;
|
||||
s/\n/\n<br>\n/g;
|
||||
$_.="\n<p>\n";
|
||||
|
||||
my %value = map { $_ => 1 } $this->translate_default;
|
||||
|
||||
my $id=$this->id;
|
||||
$_.="<b>".$this->question->description."</b>\n<select multiple name=\"$id\">\n";
|
||||
my $c=0;
|
||||
foreach my $x ($this->question->choices_split) {
|
||||
if (! $value{$x}) {
|
||||
$_.="<option value=".$c++.">$x\n";
|
||||
}
|
||||
else {
|
||||
$_.="<option value=".$c++." selected>$x\n";
|
||||
}
|
||||
}
|
||||
$_.="</select>\n";
|
||||
|
||||
return $_;
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->SUPER::value() unless @_;
|
||||
|
||||
my @values=@_;
|
||||
|
||||
$this->question->template->i18n('');
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
|
||||
$this->SUPER::value(join(', ', $this->order_values(map { $choices[$_] } @values)));
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Note;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Web::Text);
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Password;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$_=$this->question->extended_description;
|
||||
s/\n/\n<br>\n/g;
|
||||
$_.="\n<p>\n";
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
my $id=$this->id;
|
||||
$_.="<b>".$this->question->description."</b><input type=password name=\"$id\" value=\"$default\">\n";
|
||||
|
||||
return $_;
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Progress;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub start {
|
||||
}
|
||||
|
||||
sub set {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub info {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub stop {
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Select;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element::Select);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$_=$this->question->extended_description;
|
||||
s/\n/\n<br>\n/g;
|
||||
$_.="\n<p>\n";
|
||||
|
||||
my $default=$this->translate_default;
|
||||
my $id=$this->id;
|
||||
$_.="<b>".$this->question->description."</b>\n<select name=\"$id\">\n";
|
||||
my $c=0;
|
||||
foreach my $x ($this->question->choices_split) {
|
||||
if ($x ne $default) {
|
||||
$_.="<option value=".$c++.">$x\n";
|
||||
}
|
||||
else {
|
||||
$_.="<option value=".$c++." selected>$x\n";
|
||||
}
|
||||
}
|
||||
$_.="</select>\n";
|
||||
|
||||
return $_;
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my $this=shift;
|
||||
|
||||
return $this->SUPER::value() unless @_;
|
||||
my $value=shift;
|
||||
|
||||
$this->question->template->i18n('');
|
||||
my @choices=$this->question->choices_split;
|
||||
$this->question->template->i18n(1);
|
||||
$this->SUPER::value($choices[$value]);
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::String;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$_=$this->question->extended_description;
|
||||
s/\n/\n<br>\n/g;
|
||||
$_.="\n<p>\n";
|
||||
|
||||
my $default='';
|
||||
$default=$this->question->value if defined $this->question->value;
|
||||
my $id=$this->id;
|
||||
$_.="<b>".$this->question->description."</b><input name=\"$id\" value=\"$default\">\n";
|
||||
|
||||
return $_;
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/perl
|
||||
# This file was preprocessed, do not edit!
|
||||
|
||||
|
||||
package Debconf::Element::Web::Text;
|
||||
use warnings;
|
||||
use strict;
|
||||
use base qw(Debconf::Element);
|
||||
|
||||
|
||||
sub show {
|
||||
my $this=shift;
|
||||
|
||||
$_=$this->question->extended_description;
|
||||
s/\n/\n<br>\n/g;
|
||||
$_.="\n<p>\n";
|
||||
|
||||
return "<b>".$this->question->description."</b>$_<p>";
|
||||
}
|
||||
|
||||
|
||||
1
|
||||
Reference in New Issue
Block a user