﻿Select.pm                                                                                           0000644                 00000001716 00000000000 0006267 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Select;
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
                                                  Note.pm                                                                                             0000644                 00000002064 00000000000 0005752 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Note;
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
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Multiselect.pm                                                                                      0000644                 00000004655 00000000000 0007347 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Multiselect;
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
                                                                                   String.pm                                                                                           0000644                 00000001211 00000000000 0006304 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::String;
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
                                                                                                                                                                                                                                                                                                                                                                                       Boolean.pm                                                                                          0000644                 00000001254 00000000000 0006424 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Boolean;
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
                                                                                                                                                                                                                                                                                                                                                    Error.pm                                                                                            0000644                 00000002216 00000000000 0006135 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Error;
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
                                                                                                                                                                                                                                                                                                                                                                                  Progress.pm                                                                                         0000644                 00000002131 00000000000 0006644 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Progress;
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;
                                                                                                                                                                                                                                                                                                                                                                                                                                       Password.pm                                                                                         0000644                 00000001104 00000000000 0006641 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Password;
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
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Text.pm                                                                                             0000644                 00000000442 00000000000 0005767 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       #!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome::Text;
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
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           