3 Tails::Persistence::Role::SetupStep - role for persistence setup steps
7 package Tails
::Persistence
::Role
::SetupStep
;
13 use Function
::Parameters
;
14 use Glib
qw{TRUE FALSE
};
19 setlocale
(LC_MESSAGES
, "");
20 textdomain
("tails-persistence-setup");
26 with
'Tails::Role::HasEncoding';
27 with
'Tails::Persistence::Role::HasStatusArea';
29 requires
'_build_main_widget';
30 requires
'go_button_pressed';
43 has
'main_widget' => (
49 foreach (qw{title subtitle description
}) {
60 isa
=> 'Gtk3::Button',
62 foreach (qw{go_callback success_callback
}) {
70 foreach (qw{drive_vendor drive_model
}) {
83 method _build_title
() {
84 my $label = Gtk3
::Label
->new('');
85 $label->set_alignment(0.0, 0.5);
86 my $attrlist = Pango
::AttrList
->new;
88 foreach ( Pango
::AttrScale
->new(1.3),Pango
::AttrWeight
->new('bold') );
89 $label->set_attributes($attrlist);
90 $label->set_padding(10, 10);
95 method _build_subtitle
() {
96 my $label = Gtk3
::Label
->new('');
97 $label->set_alignment(0.0, 0.5);
98 my $attrlist = Pango
::AttrList
->new;
100 foreach ( Pango
::AttrScale
->new(1.1),Pango
::AttrWeight
->new('bold') );
101 $label->set_attributes($attrlist);
102 $label->set_padding(10, 10);
103 $label->set_line_wrap(TRUE
);
104 $label->set_line_wrap_mode('word');
105 $label->set_single_line_mode(FALSE
);
110 method _build_description
() {
111 my $label = Gtk3
::Label
->new('');
112 $label->set_alignment(0.0, 0.5);
113 $label->set_padding(10, 10);
114 $label->set_line_wrap(TRUE
);
115 $label->set_line_wrap_mode('word');
116 $label->set_single_line_mode(FALSE
);
121 method _build_go_button
() {
122 my $button = Gtk3
::Button
->new;
123 $button->set_sensitive(FALSE
);
124 $button->set_can_default(TRUE
);
125 $button->signal_connect('clicked', sub { $self->go_button_pressed });