| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
=head1 NAME |
| 4 |
|
| 5 |
Debconf::Element::Gnome::Error - an error message to show to the user |
| 6 |
|
| 7 |
=cut |
| 8 |
|
| 9 |
package Debconf::Element::Gnome::Error; |
| 10 |
use warnings; |
| 11 |
use strict; |
| 12 |
use Debconf::Gettext; |
| 13 |
use Gtk3; |
| 14 |
use utf8; |
| 15 |
use Debconf::Encoding qw(to_Unicode); |
| 16 |
use base qw(Debconf::Element::Gnome); |
| 17 |
|
| 18 |
=head1 DESCRIPTION |
| 19 |
|
| 20 |
This is an error message to show to the user. |
| 21 |
|
| 22 |
=cut |
| 23 |
|
| 24 |
sub init { |
| 25 |
my $this=shift; |
| 26 |
my $extended_description = to_Unicode($this->question->extended_description); |
| 27 |
|
| 28 |
$this->SUPER::init(@_); |
| 29 |
$this->multiline(1); |
| 30 |
$this->fill(1); |
| 31 |
$this->expand(1); |
| 32 |
$this->widget(Gtk3::HBox->new(0, 0)); |
| 33 |
|
| 34 |
my $image = Gtk3::Image->new_from_stock("gtk-dialog-error", "dialog"); |
| 35 |
$image->show; |
| 36 |
|
| 37 |
my $text = Gtk3::TextView->new(); |
| 38 |
my $textbuffer = $text->get_buffer; |
| 39 |
$text->show; |
| 40 |
$text->set_wrap_mode ("word"); |
| 41 |
$text->set_editable (0); |
| 42 |
|
| 43 |
my $scrolled_window = Gtk3::ScrolledWindow->new(); |
| 44 |
$scrolled_window->show; |
| 45 |
$scrolled_window->set_policy('automatic', 'automatic'); |
| 46 |
$scrolled_window->set_shadow_type('in'); |
| 47 |
$scrolled_window->add ($text); |
| 48 |
|
| 49 |
$this->widget->show; |
| 50 |
$this->widget->pack_start($image, 0, 0, 6); |
| 51 |
$this->widget->pack_start($scrolled_window, 1, 1, 0); |
| 52 |
|
| 53 |
$textbuffer->set_text($extended_description); |
| 54 |
|
| 55 |
$this->widget->show; |
| 56 |
$this->adddescription; |
| 57 |
$this->addwidget($this->widget); |
| 58 |
# No help button is added since the widget is the description. |
| 59 |
} |
| 60 |
|
| 61 |
=head1 AUTHOR |
| 62 |
|
| 63 |
Eric Gillespie <[email protected]> |
| 64 |
Gustavo Noronha Silva <[email protected]> |
| 65 |
Colin Watson <[email protected]> |
| 66 |
|
| 67 |
=cut |
| 68 |
|
| 69 |
1 |