diff options
Diffstat (limited to 'perl-install/interactive')
| -rw-r--r-- | perl-install/interactive/curses.pm | 62 | ||||
| -rw-r--r-- | perl-install/interactive/gtk.pm | 431 | ||||
| -rw-r--r-- | perl-install/interactive/http.pm | 4 | ||||
| -rw-r--r-- | perl-install/interactive/stdio.pm | 6 | 
4 files changed, 320 insertions, 183 deletions
| diff --git a/perl-install/interactive/curses.pm b/perl-install/interactive/curses.pm index b8da3c29a..64bdee5c7 100644 --- a/perl-install/interactive/curses.pm +++ b/perl-install/interactive/curses.pm @@ -3,7 +3,7 @@  # to debug, use something like  # PERLDB_OPTS=TTY=`tty` LC_ALL=fr_FR.UTF-8 xterm -geometry 80x25 -e sh -c 'DISPLAY= perl -d t.pl' -package interactive::curses; # $Id$ +package interactive::curses;  use diagnostics;  use strict; @@ -32,13 +32,20 @@ sub new {      open STDERR, ">", common::secured_file($stderr_file);      $cui ||= Curses::UI->new('-color_support' => 1); + +    # Set some default terminal size, for serial install +    unless ($cui->{'-width'}) { +	$cui->{'-width'}  = $cui->{'-w'} = $cui->{'-bw'} = 80; +    	$cui->{'-height'} = $cui->{'-h'} = $cui->{'-bh'} = 25; +    } +      bless { cui => $cui }, $class;  }  sub enter_console { &suspend }  sub leave_console { &end } -sub suspend { Curses::UI->leave_curses } -sub resume { Curses::UI->reset_curses } +sub suspend { $cui && $cui->leave_curses } +sub resume { $cui->reset_curses }  sub end { &suspend; print $SAVEERR $_ foreach cat_($stderr_file); unlink $stderr_file }  sub exit { end(); CORE::exit($_[1] || 0) }  END { end() } @@ -80,7 +87,7 @@ sub filter_widget {      #- combo does not allow modifications      $e->{type} = 'entry' if $e->{type} eq 'combo' && !$e->{not_edit}; -    $e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]; +    $e->{formatted_list} = [ map { my $t = warp_text(may_apply($e->{format}, $_), 80); $t } @{$e->{list}} ];      $e->{default_curses} ||= delete $e->{curses};  } @@ -163,14 +170,14 @@ sub compute_size {  	$e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(@{$e->{formatted_list}}), 10, 4);  	$e->{curses}{'-width'} ||= max(map { length } @{$e->{formatted_list}}) + 7;      } elsif ($e->{type} =~ /list/) { -	$e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(@{$e->{formatted_list}}), 5, 4); -	$e->{curses}{'-width'} ||= max(map { length } @{$e->{formatted_list}}) + 3;	 +	$e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(map { split("\n", $_) } @{$e->{formatted_list}}), 5, 4); +	$e->{curses}{'-width'} ||= max(map { length } map { split("\n", $_) } @{$e->{formatted_list}}) + 3;	      } elsif ($e->{type} eq 'button') {  	my $s = sprintf('< %s >', may_apply($e->{format}, ${$e->{val}}));  	$e->{curses}{'-width'} ||= length($s);      } elsif ($e->{type} eq 'expander') {  	$e->{curses}{'-width'} ||= length("<+> $e->{text}"); -    } elsif ($e->{type} eq 'text' || $e->{type} eq 'label' || $e->{type} eq 'only_label') { +    } elsif (member($e->{type}, qw(text label only_label))) {  	my @text = _messages(min(80, $width_avail - 1), ${$e->{val}}); #- -1 because of the scrollbar  	$e->{curses}{'-focusable'} = 0;  	$e->{curses}{'-height'} ||= heights(int(@text), 10, 4); @@ -345,7 +352,7 @@ sub create_widget {  	$w->set_binding('focus-up', Curses::KEY_LEFT());  	$w->set_binding('focus-down', Curses::KEY_RIGHT());  	$set = sub { $w->set_label(0, sprintf('< %s >', may_apply($e->{format}, $_[0]))) }; -    } elsif ($e->{type} eq 'list' || $e->{type} eq 'combo') { +    } elsif (member($e->{type}, qw(list combo))) {  	$w = $win->add(undef, $e->{type} eq 'combo' ? 'Popupmenu' : 'Listbox',   		       '-values' => $e->{formatted_list},  		       '-onchange' => $onchange->(sub { $e->{list}[$w->id] }), @@ -398,13 +405,26 @@ sub create_widget {      } elsif ($e->{type} eq 'label' && $e->{curses}{'-height'} == 1) {  	$w = $win->add(undef, 'Label', %options);  	$set = sub { $w->text($_[0] || '') }; -    } elsif ($e->{type} eq 'label' || $e->{type} eq 'only_label' || $e->{type} eq 'text') { +    } elsif (member($e->{type}, qw(label only_label text))) {  	$w = $win->add(undef, 'TextViewer', %options);  	$set = sub {   	    my ($text) = @_;  	    my $width = $w->{'-sw'} - ($w->{'-vscrollbar'} ? 1 : 0);  	    $w->text(join("\n", _messages($width, $text)));  	}; +    } elsif ($e->{type} eq 'range') { +	$w = $win->add(undef, 'TextEntry',  +		       '-sbborder' => 1, +		       '-text' => '',  +		       '-regexp' => '/^\d*$/', +		       '-onchange' => sub { +			   $w->text($e->{min}) if $w->text < $e->{min}; +			   $w->text($e->{max}) if $w->text > $e->{max}; +			   ${$e->{val}} = $w->text; +			   $changed->() if $changed; +		       }, +		       %options); +	$set = sub { $w->text($_[0] || '') };      } else {  	$w = $win->add(undef, $e->{hidden} ? 'PasswordEntry' : 'TextEntry',   		       '-sbborder' => 1, @@ -539,6 +559,30 @@ sub ask_fromW_ {      $v eq '0 but true' ? 0 : $v;  } +sub ask_fileW { +    my ($o, $opts) = @_; +    my ($file, $dir); + +    $dir = $opts->{directory} || $opts->{file} && dirname($opts->{file}); + +    if ($opts->{save}) { +        $file = $o->{cui}->savefilebrowser('-title' => $opts->{title}, '-path' => $dir, '-file' => basename($file)); +    } else { +        $file = $o->{cui}->loadfilebrowser('-title' => $opts->{title}, '-path' => $dir, '-file' => basename($file)); +    } + +    my $err; +    if (!$file) { +	$err = N("No file chosen"); +    } elsif (-f $file && $opts->{want_a_dir}) { +        $file = dirname($file); +    } elsif (-d $file && !$opts->{want_a_dir}) { +        $err = N("You have chosen a directory, not a file"); +    } elsif (!-e $file && !$opts->{save}) { +	$err = $opts->{want_a_dir} ? N("No such directory") : N("No such file"); +    } +    $err and $o->ask_warn('', $err) or $file; +}  sub wait_messageW {      my ($o, $title, $message, $message_modifiable) = @_; diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 2315556fd..c37143fc3 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -1,4 +1,4 @@ -package interactive::gtk; # $Id$ +package interactive::gtk;  use diagnostics;  use strict; @@ -8,35 +8,34 @@ use vars qw(@ISA);  use interactive;  use common; -use mygtk2; -use ugtk2 qw(:helpers :wrappers :create); -use Gtk2::Gdk::Keysyms; +use mygtk3; +use ugtk3 qw(:helpers :wrappers :create);  my $forgetTime = 1000; #- in milli-seconds  sub new {      my $w = &interactive::new; -    ($w->{windowwidth}, $w->{windowheight}) = gtkroot()->get_size if !$::isInstall; +    ($w->{windowwidth}, $w->{windowheight}) = mygtk3::root_window_size() if !$::isInstall;      $w;  }  sub enter_console { my ($o) = @_; $o->{suspended} = common::setVirtual(1) }  sub leave_console { my ($o) = @_; common::setVirtual(delete $o->{suspended}) }  sub adapt_markup {  -    #- nothing needed, the default markup is gtk2's +    #- nothing needed, the default markup is gtk3's      my ($_o, $s) = @_; return $s;  } -sub exit { ugtk2::exit(@_) } +sub exit { ugtk3::exit(@_) }  sub ask_fileW {      my ($in, $common) = @_; -    my $w = ugtk2::create_file_selector(%$common); +    my $w = ugtk3::create_file_selector(%$common);      my $file;      $w->main(sub {   	$file = $w->{chooser}->get_filename; -	my $err = ugtk2::file_selected_check($common->{save}, $common->{want_a_dir}, $file); +	my $err = ugtk3::file_selected_check($common->{save}, $common->{want_a_dir}, $file);  	$err and $in->ask_warn('', $err);  	!$err;      }) && $file; @@ -45,11 +44,12 @@ sub ask_fileW {  sub create_boxradio {      my ($e, $onchange_f, $double_click) = @_; -    my $boxradio = gtkpack2__(Gtk2::VBox->new(0, 0), +    my $boxradio = gtkpack2__(Gtk3::VBox->new,  			      my @radios = gtkradio('', @{$e->{formatted_list}})); -    my $tips = Gtk2::Tooltips->new;      mapn {  	my ($txt, $w) = @_; +	# workaround infamous 6 years old gnome bug #101968: +	$w->get_child->set_size_request(mygtk3::get_label_width(), -1) if $e->{alignment} ne 'right' && !$e->{label};  	$w->signal_connect(button_press_event => $double_click) if $double_click;  	$w->signal_connect(key_press_event => $e->{may_go_to_next}); @@ -58,7 +58,7 @@ sub create_boxradio {  	    $onchange_f->(sub { $txt });  	});  	if ($e->{help}) { -	    gtkset_tip($tips, $w, +	    $w->set_tooltip_text(  		       ref($e->{help}) eq 'HASH' ? $e->{help}{$txt} :  		       ref($e->{help}) eq 'CODE' ? $e->{help}($txt) : $e->{help});  	} @@ -77,16 +77,17 @@ sub create_treeview_list {      my ($e, $onchange_f, $double_click) = @_;      my $curr; -    my $list = Gtk2::ListStore->new("Glib::String"); -    my $list_tv = Gtk2::TreeView->new_with_model($list); +    my $list = Gtk3::ListStore->new("Glib::String"); +    my $list_tv = Gtk3::TreeView->new_with_model($list);      $list_tv->set_headers_visible(0);      $list_tv->get_selection->set_mode('browse'); -    my $textcolumn = Gtk2::TreeViewColumn->new_with_attributes(undef, my $renderer = Gtk2::CellRendererText->new, 'text' => 0); +    my $textcolumn = Gtk3::TreeViewColumn->new_with_attributes("", my $renderer = Gtk3::CellRendererText->new, 'text' => 0);      $list_tv->append_column($textcolumn);      $renderer->set_property('ellipsize', 'end');      my $select = sub {  	my ($path) = @_; +	return if !$list_tv->get_model;  	$list_tv->set_cursor($path, undef, 0);  	Glib::Timeout->add(100, sub { $list_tv->scroll_to_cell($path, undef, 1, 0.5, 0); 0 });      }; @@ -101,8 +102,8 @@ sub create_treeview_list {  	Glib::Source->remove($timeout) if $timeout; $timeout = '';  	if ($event->keyval >= 0x100) { -	    $e->{may_go_to_next}(), return 1 if member($event->keyval, ($Gtk2::Gdk::Keysyms{Return}, $Gtk2::Gdk::Keysyms{KP_Enter})); -	    $starting_word = '' if !member($event->keyval, ($Gtk2::Gdk::Keysyms{Control_L}, $Gtk2::Gdk::Keysyms{Control_R})); +	    $e->{may_go_to_next}(), return 1 if member($event->keyval, (Gtk3::Gdk::KEY_Return, Gtk3::Gdk::KEY_KP_Enter)); +	    $starting_word = '' if !member($event->keyval, (Gtk3::Gdk::KEY_Control_L, Gtk3::Gdk::KEY_Control_R));  	} else {  	    if (member('control-mask', @{$event->state})) {  		$c eq 's' or return 1; @@ -111,7 +112,7 @@ sub create_treeview_list {  	    } else {  		$e->{may_go_to_next}(), return 1 if $c eq ' '; -		$curr++ if $starting_word eq '' || $starting_word eq $c; +		$curr++ if member($starting_word, '', $c);  		$starting_word .= $c unless $starting_word eq $c;  	    }  	    my @l = @{$e->{formatted_list}}; @@ -122,7 +123,7 @@ sub create_treeview_list {  	    if ($j == @l) {  		$starting_word = '';  	    } else { -		$select->(Gtk2::TreePath->new_from_string(($j + $curr) % @l)); +		$select->(Gtk3::TreePath->new_from_string(($j + $curr) % @l));  	    }  	    $timeout = Glib::Timeout->add($forgetTime, sub { $timeout = $starting_word = ''; 0 }); @@ -149,7 +150,7 @@ sub create_treeview_list {  	    my $nb = find_index { $_ eq $v } @{$e->{list}};  	    my ($old_path) = $list_tv->get_cursor;  	    if (!$old_path || $nb != $old_path->to_string) { -		$select->(Gtk2::TreePath->new_from_string($nb)); +		$select->(Gtk3::TreePath->new_from_string($nb));  	    }  	    undef $old_path if $old_path;  	}; @@ -160,7 +161,7 @@ sub __create_tree_model {      my ($e) = @_;      my $sep = quotemeta $e->{separator}; -    my $tree_model = Gtk2::TreeStore->new("Glib::String", if_($e->{image2f}, "Gtk2::Gdk::Pixbuf")); +    my $tree_model = Gtk3::TreeStore->new("Glib::String", if_($e->{image2f}, "Gtk3::Gdk::Pixbuf"));      my $build_value = sub {  	my ($v) = @_; @@ -201,14 +202,14 @@ sub create_treeview_tree {      my ($e, $onchange_f, $double_click) = @_;      my $tree_model = __create_tree_model($e); -    my $tree = Gtk2::TreeView->new_with_model($tree_model); +    my $tree = Gtk3::TreeView->new_with_model($tree_model);      $tree->get_selection->set_mode('browse');      { -	my $col = Gtk2::TreeViewColumn->new; -	$col->pack_start(my $texrender = Gtk2::CellRendererText->new, 0); +	my $col = Gtk3::TreeViewColumn->new; +	$col->pack_start(my $texrender = Gtk3::CellRendererText->new, 0);  	$col->add_attribute($texrender, text => 0);  	if ($e->{image2f}) { -	    $col->pack_start(my $pixrender = Gtk2::CellRendererPixbuf->new, 0); +	    $col->pack_start(my $pixrender = Gtk3::CellRendererPixbuf->new, 0);  	    $col->add_attribute($pixrender, pixbuf => 1);  	}  	$tree->append_column($col); @@ -217,10 +218,10 @@ sub create_treeview_tree {      my $select = sub {  	my ($path_str) = @_; -	my $path = Gtk2::TreePath->new_from_string($path_str); +	my $path = Gtk3::TreePath->new_from_string($path_str);  	$tree->expand_to_path($path);  	$tree->set_cursor($path, undef, 0); -        gtkflush();  #- workaround gtk2 bug not honouring centering on the given row if node was closed +        gtkflush();  #- workaround gtk3 bug not honouring centering on the given row if node was closed  	$tree->scroll_to_cell($path, undef, 1, 0.5, 0);      }; @@ -265,8 +266,8 @@ sub create_treeview_tree {  	Glib::Source->remove($timeout) if $timeout; $timeout = '';  	if ($event->keyval >= 0x100) { -	    &$toggle and return 1 if member($event->keyval, ($Gtk2::Gdk::Keysyms{Return}, $Gtk2::Gdk::Keysyms{KP_Enter})); -	    $starting_word = '' if !member($event->keyval, ($Gtk2::Gdk::Keysyms{Control_L}, $Gtk2::Gdk::Keysyms{Control_R})); +	    &$toggle and return 1 if member($event->keyval, (Gtk3::Gdk::KEY_Return, Gtk3::Gdk::KEY_KP_Enter)); +	    $starting_word = '' if !member($event->keyval, (Gtk3::Gdk::KEY_Control_L, Gtk3::Gdk::KEY_Control_R));  	} else {  	    my $next;  	    if (member('control-mask', @{$event->state})) { @@ -275,7 +276,7 @@ sub create_treeview_tree {  		$next = 1;  	    } else {  		&$toggle and return 1 if $c eq ' '; -		$next = 1 if $starting_word eq '' || $starting_word eq $c; +		$next = 1 if member($starting_word, '', $c);  		$starting_word .= $c unless $starting_word eq $c;  	    }  	    my $word = quotemeta $starting_word; @@ -329,7 +330,7 @@ sub create_treeview_tree {  }  #- $actions is a ref list of $action -#- $action is a { kind => $kind, action => sub { ... }, button => Gtk2::Button->new(...) } +#- $action is a { kind => $kind, action => sub { ... }, button => Gtk3::Button->new(...) }  #-   where $kind is one of '', 'modify', 'remove', 'add'  sub add_modify_remove_action {      my ($button, $buttons, $e, $treelist) = @_; @@ -345,14 +346,22 @@ sub add_modify_remove_action {      } elsif ($button->{kind} eq 'remove') {  	${$e->{val}} = $e->{list}[0];      } -    ugtk2::gtk_set_treelist($treelist, [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]); +    ugtk3::gtk_set_treelist($treelist, [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]);      add_modify_remove_sensitive($buttons, $e);      1;  } +sub add_padding { +    my ($w) = @_; +    gtknew('HBox', children => [ +        0, gtknew('Alignment', width => $mygtk3::left_padding), +        1, $w +    ]); +}   +  sub create_widget { -    my ($o, $e, $onchange_f, $update, $ignore_ref) = @_; +    my ($o, $common, $e, $onchange_f, $update, $ignore_ref) = @_;      my $onchange = sub {  	my ($f) = @_; @@ -361,45 +370,65 @@ sub create_widget {      my ($w, $real_w, $focus_w, $set);      if ($e->{type} eq 'iconlist') { -	$w = Gtk2::Button->new; +	$w = Gtk3::Button->new;  	$set = sub {  	    gtkdestroy($e->{icon});  	    my $f = $e->{icon2f}->($_[0]);  	    $e->{icon} = -e $f ?  	      gtkcreate_img($f) : -		Gtk2::WrappedLabel->new(may_apply($e->{format}, $_[0])); +		Gtk3::WrappedLabel->new(may_apply($e->{format}, $_[0]));  	    $w->add(gtkshow($e->{icon}));  	};  	$w->signal_connect(clicked => sub {  			       $onchange_f->(sub { next_val_in_array(${$e->{val}}, $e->{list}) });  			       $set->(${$e->{val}});  			   }); -	$real_w = gtkpack_(Gtk2::HBox->new(0,10), 1, Gtk2::HBox->new(0,0), 0, $w, 1, Gtk2::HBox->new(0,0)); +        if ($e->{alignment} eq 'right') { +            $real_w = gtknew('HButtonBox', layout => 'start', children_tight => [ $w ]); +        } else { +            $real_w = gtkpack_(Gtk3::HBox->new(0,10), 1, Gtk3::HBox->new(0,0), 0, $w, 1, Gtk3::HBox->new(0,0)); +        }      } elsif ($e->{type} eq 'bool') {  	if ($e->{image}) { -	    $w = ugtk2::gtkadd(Gtk2::CheckButton->new, gtkshow(gtkcreate_img($e->{image}))); +	    $w = ugtk3::gtkadd(Gtk3::CheckButton->new, gtkshow(gtkcreate_img($e->{image})));  	} else {  	    #-		warn "\"text\" member should have been used instead of \"label\" one at:\n", common::backtrace(), "\n" if $e->{label} && !$e->{text}; -	    $w = Gtk2::CheckButton->new_with_label($e->{text}); +	    $w = Gtk3::CheckButton->new_with_label($e->{text} || '');  	}  	$w->signal_connect(clicked => $onchange->(sub { $w->get_active })); -	$set = sub { $w->set_active($_[0]) }; +	${$e->{val}} ||= 0; +	$set = sub { $w->set_active($_[0] || 0) }; +        $real_w = add_padding($w);      } elsif ($e->{type} eq 'only_label') { +        my @common = ( +            # workaround infamous 6 years old gnome bug #101968: +            if_($e->{alignment} ne 'right', width => mygtk3::get_label_width()) +        );  	$w = $e->{title} ?  -	         gtknew('Title2', label => escape_text_for_TextView_markup_format(${$e->{val}})) : -		 gtknew('Label_Left', line_wrap => 1, text_markup => ${$e->{val}}); +	         gtknew('Title2', label => escape_text_for_TextView_markup_format(${$e->{val}}), @common) : +		 gtknew($e->{alignment} eq 'right' ? 'Label_Right' : 'Label_Left', +                        line_wrap => 1, text_markup => ${$e->{val}}, @common);      } elsif ($e->{type} eq 'label') {  	$w = gtknew('WrappedLabel', text_markup => ${$e->{val}});  	$set = sub { $w->set($_[0]) };      } elsif ($e->{type} eq 'empty') {  	$w = gtknew('HBox', height => $e->{height});      } elsif ($e->{type} eq 'button') { -	$w = Gtk2::Button->new_with_label(''); -	$w->signal_connect(clicked => $e->{clicked_may_quit_cooked}); -	$set = sub { $w->child->set_label(may_apply($e->{format}, $_[0])) }; +	$w = gtknew(($e->{install_button} ? 'Install_Button' : 'Button'),  +                    text => '', clicked => $e->{clicked_may_quit_cooked}); +	$set = sub { +            my $w = $w->get_child; +            # handle Install_Buttons: +            if (ref($w) =~ /Gtk3::HBox/) { +                ($w) = find { ref($_) =~ /Gtk3::Label/ } $w->get_children; +            } +            # guard against 'advanced' widgets that are now in their own dialog +            # (instead of in another block child of an expander): +            return if !$w; +            $w->set_label(may_apply($e->{format}, $_[0])) };      } elsif ($e->{type} eq 'range') { -	my $adj = Gtk2::Adjustment->new(${$e->{val}}, $e->{min}, $e->{max} + ($e->{SpinButton} ? 0 : 1), 1, ($e->{max} - $e->{min}) / 10, 1); -	$w = $e->{SpinButton} ? Gtk2::SpinButton->new($adj, 10, 0) : Gtk2::HScale->new($adj); +	my $adj = Gtk3::Adjustment->new(${$e->{val}}, $e->{min}, $e->{max} + ($e->{SpinButton} ? 0 : 1), 1, ($e->{max} - $e->{min}) / 10, 1); +	$w = $e->{SpinButton} ? Gtk3::SpinButton->new($adj, 10, 0) : Gtk3::HScale->new($adj);  	$w->set_size_request($e->{SpinButton} ? 100 : 200, -1);  	$w->set_digits(0);  	$adj->signal_connect(value_changed => $onchange->(sub { $adj->get_value })); @@ -408,16 +437,32 @@ sub create_widget {      } elsif ($e->{type} eq 'expander') {  	$e->{grow} = 'fill';  	my $children = [ if_($e->{message}, { type => 'only_label', no_indent => 1, val => \$e->{message} }), @{$e->{children}} ]; -	my $box = create_widgets_block($o, $children, $update, $ignore_ref); -	$w = gtknew('Expander', text => $e->{text}, child => $box); +	create_widgets_block($o, $common, $children, $update, $ignore_ref); +	$w = gtknew('HBox', children_tight => [ +            gtknew('Install_Button', text => $e->{text}, +                   clicked => sub { +                       eval { ask_fromW($o, { title => $common->{advanced_title} || $common->{title} || N("Advanced") }, $children) }; +		       if (my $err = $@) { +			   die $err if $err !~ /^wizcancel/; +		       } +		   } +               ) +        ]);      } elsif ($e->{type} =~ /list/) {  	$e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ];  	if (my $actions = $e->{add_modify_remove}) { -	    my @buttons = map { -		{ kind => lc $_, action => $actions->{$_}, button => Gtk2::Button->new(translate($_)) }; -	    } N_("Add"), N_("Modify"), N_("Remove"); +	    my @buttons = (N_("Add"), N_("Modify"), N_("Remove")); +	    # Add Up/Down buttons if their actions are defined +            push @buttons, map { if_($actions->{$_}, 'gtk-go-' . $_) } qw(Up Down); +	    @buttons = map { +                my $button = /^gtk-/ ? gtknew('Button', image => gtknew('Image', stock => lc($_))) +                  : Gtk3::Button->new(translate($_)); +		my $kind = $_; +		$kind =~ s/^gtk-go-//; +		{ kind => lc $kind, action => $actions->{$kind}, button => $button, real_kind => $_ }; +	    } @buttons;  	    my $modify = find { $_->{kind} eq 'modify' } @buttons;  	    my $do_action = sub { @@ -433,9 +478,19 @@ sub create_widget {  	    }  	    add_modify_remove_sensitive(\@buttons, $e); -	    $real_w = gtkpack_(Gtk2::HBox->new(0,0), +	    my ($images, $real_buttons) = partition { $_->{real_kind} =~ /^gtk-/ } @buttons; +	    $real_w = gtkpack_(Gtk3::HBox->new(0,0),  			       1, create_scrolled_window($w),  -			       0, gtkpack__(Gtk2::VBox->new(0,0), map { $_->{button} } @buttons)); +			       0, gtkpack__(Gtk3::VBox->new(0,0), +                                            (map { $_->{button} } @$real_buttons), +                                            if_($images, +                                                gtknew('HButtonBox', +                                                       layout => 'spread', +                                                       children_loose => [ map { $_->{button} } @$images ] +                                                      ) +                                            ), +                                        ), +                           );  	    $e->{grow} = 'expand';  	} else {  	    my $use_boxradio = exists $e->{gtk}{use_boxradio} ? $e->{gtk}{use_boxradio} : @{$e->{list}} <= 8; @@ -443,6 +498,7 @@ sub create_widget {  	    if ($e->{help} || $use_boxradio && $e->{type} ne 'treelist') {  		#- used only when needed, as key bindings are dropped by List (ListStore does not seems to accepts Tooltips).  		($w, $set, $focus_w) = create_boxradio($e, $onchange_f, $e->{quit_if_double_click_cooked}); +                $real_w = add_padding($w);  	    } elsif ($e->{type} eq 'treelist') {  		($w, $set) = create_treeview_tree($e, $onchange_f, $e->{quit_if_double_click_cooked});  	    } else { @@ -460,37 +516,33 @@ sub create_widget {  	    my @formatted_list = map { may_apply($e->{format}, $_) } @{$e->{list}};  	    $e->{formatted_list} = \@formatted_list; -	    my @l = sort { $b <=> $a } map { length } @formatted_list; -	    my $width = $l[@l / 16]; # take the third octile (think quartile) -  	    if (!$e->{separator}) { -		if ($e->{not_edit} && $width < 160) { #- ComboBoxes do not have an horizontal scroll-bar. This can cause havoc for long strings (eg: diskdrake Create dialog box in expert mode) -		    $w = Gtk2::ComboBox->new_text; +		if ($e->{not_edit}) { +		    $real_w = $w = Gtk3::ComboBoxText->new; +		    # FIXME: the following causes Gtk-CRITICAL but not solvable at realize time: +		    first($w->get_child->get_cells)->set_property('ellipsize', 'end') if !$e->{do_not_ellipsize};  		    $w->set_wrap_width($e->{gtk}{wrap_width}) if exists $e->{gtk}{wrap_width};  		} else { -		    $w = Gtk2::Combo->new; -		    $w->set_use_arrows_always(1); -		    $w->entry->set_editable(!$e->{not_edit}); -		    $w->disable_activate; +		    $w = Gtk3::ComboBoxText->new_with_entry; +		    ($real_w, $w) = ($w, $w->get_child);  		} -		$w->set_popdown_strings(@formatted_list); -		$w->set_text(ref($e->{val}) ? may_apply($e->{format}, ${$e->{val}}) : $formatted_list[0]) if $w->isa('Gtk2::ComboBox'); +		$real_w->set_popdown_strings(@formatted_list);  	    } else {  		$model = __create_tree_model($e); -		$w = Gtk2::ComboBox->new_with_model($model); +		$real_w = $w = Gtk3::ComboBox->new_with_model($model); -		$w->pack_start(my $texrender = Gtk2::CellRendererText->new, 0); +		$w->pack_start(my $texrender = Gtk3::CellRendererText->new, 0);  		$w->add_attribute($texrender, text => 0);  		if ($e->{image2f}) { -		    $w->pack_start(my $pixrender = Gtk2::CellRendererPixbuf->new, 0); +		    $w->pack_start(my $pixrender = Gtk3::CellRendererPixbuf->new, 0);  		    $w->add_attribute($pixrender, pixbuf => 1);  		}  	    } -	    ($real_w, $w) = ($w, $w->entry);  	    my $get = sub {  		my $i = $model ? do { -		    my $s = $model->get_string_from_iter($w->get_active_iter); +		    my (undef, $iter) = $w->get_active_iter; +		    my $s = $model->get_string_from_iter($iter);  		    eval { find_index { $s eq $_ } @{$model->{path_str_list}} };  		} : do {  		    my $s = $w->get_text; @@ -498,16 +550,7 @@ sub create_widget {  		};  		defined $i ? $e->{list}[$i] : $w->get_text;  	    }; -	    if ($real_w->isa('Gtk2::Combo')) { -		#- FIXME workaround gtk suckiness (set_text generates two 'change' signals, one when removing the whole, one for inserting the replacement..) -		my $idle; -		$w->signal_connect(changed => sub { -				       return if $$ignore_ref; -				       $idle ||= Glib::Idle->add(sub { undef $idle; $onchange_f->($get); 0 }); -				   }); -	    } else { -		$w->signal_connect(changed => $onchange->($get)); -	    } +	    $w->signal_connect(changed => $onchange->($get));  	    $set = sub {  		my $s = may_apply($e->{format}, $_[0]); @@ -518,24 +561,29 @@ sub create_widget {  			$w->set_active_iter($model->get_iter_from_string($path_str));  		    };  		} else { -		    $w->set_text($s) if $s ne $w->get_text && $_[0] ne $w->get_text; +		    $w->set_text($s) if !member($w->get_text, $s, $_[0]);  		}  	    };  	} else { -	    $w = Gtk2::Entry->new; +	    if ($e->{weakness_check}) { +		$w = gtknew('WeaknessCheckEntry'); +	    } +	    else { +		$w = Gtk3::Entry->new; +	    }  	    $w->signal_connect(changed => $onchange->(sub { $w->get_text }));  	    $w->signal_connect(focus_in_event => sub { $w->select_region(0, -1) });  	    $w->signal_connect(focus_out_event => sub { $w->select_region(0, 0) });  	    $set = sub { $w->set_text($_[0]) if $_[0] ne $w->get_text };  	    if ($e->{type} eq 'file') { -		my $button = gtksignal_connect(Gtk2::Button->new_from_stock('gtk-open'), clicked => sub { +		my $button = gtksignal_connect(Gtk3::Button->new_from_stock('gtk-open'), clicked => sub {  						   my $file = $o->ask_fileW({                                                         title => $e->{label},                                                         want_a_dir => to_bool($e->{want_a_dir}),                                                     });  						   $set->($file) if $file;  					       }); -		$real_w = gtkpack_(Gtk2::HBox->new(0,0), 1, $w, 0, $button); +		$real_w = gtkpack_(Gtk3::HBox->new(0,0), 1, $w, 0, $button);  	    }  	}  	$w->signal_connect(key_press_event => $e->{may_go_to_next}); @@ -570,16 +618,20 @@ sub all_entries {  sub all_focusable_entries {      my ($l) = @_; -    map { $_->{type} eq 'expander'  -	    ? ($_->{w}->get_expanded ? all_focusable_entries($_->{children}) : ()) -	    : $_; -      } grep { $_->{focus_w} } @$l; +    grep { $_->{focus_w} } @$l; +} + +sub all_title_entries { +    my ($l) = @_; +    grep { $_->{title} } @$l;  }  sub create_widgets_block { -    my ($o, $l, $update, $ignore_ref) = @_; +    my ($o, $common, $l, $update, $ignore_ref) = @_; -    my $label_sizegrp = Gtk2::SizeGroup->new('horizontal'); +    my $label_sizegrp = Gtk3::SizeGroup->new('horizontal'); +    my $right_label_sizegrp = Gtk3::SizeGroup->new('horizontal'); +    my $realw_sizegrp = Gtk3::SizeGroup->new('horizontal');      @$l = map_index {  	if ($::i && ($_->{type} eq 'expander' || $_->{title})) { @@ -597,18 +649,30 @@ sub create_widgets_block {  	    $update->($e->{changed});  	}; -	create_widget($o, $e, $onchange_f, $update, $ignore_ref); +	create_widget($o, $common, $e, $onchange_f, $update, $ignore_ref);  	my $label_w;  	if ($e->{label} || !$e->{no_indent}) { -	    $label_w = gtknew('Label_Left', text_markup => $e->{label} || '', -			      size_group => $label_sizegrp, alignment => [ 0, 0.5 ]); +	    $label_w = gtknew($e->{alignment} eq 'right' ? 'Label_Right' : 'Label_Left', text_markup => $e->{label} || '', +			      size_group => ($e->{alignment} eq 'right' ? $right_label_sizegrp : $label_sizegrp), +                          ); +            $realw_sizegrp->add_widget($e->{real_w}); +	} + +	if ($e->{do_not_expand}) { +            $e->{real_w} = gtknew('HBox', children => [ +                0, $e->{real_w}, +                1, gtknew('Label'), +            ]);  	} -	$e->{real_w} = gtkpack_(Gtk2::HBox->new, +	my $eater = if_($e->{alignment} eq 'right' && !$label_w, gtknew('Label')); + +	$e->{real_w} = gtkpack_(Gtk3::HBox->new,  				if_($e->{icon}, 0, eval { gtkcreate_img($e->{icon}) }), -				if_($label_w, 0, $label_w), -				(1, $e->{real_w}), +				if_($eater, 1, $eater), +				if_($label_w, $e->{alignment} eq 'right', $label_w), +				(!$eater, $e->{real_w}),  			    );      }      gtknew('VBox', children => [ map { $_->{grow} || 0, $_->{real_w} } @$l ]); @@ -623,6 +687,7 @@ sub create_widgets {  	my @all = all_entries($l);  	$_->{set}->(${$_->{val}}, $_) foreach @all; #- nb: the parameter "$_" is needed for create_boxradio  	$_->{disabled} and $_->{real_w}->set_sensitive(!$_->{disabled}()) foreach @all; +	$_->{hidden} and $_->{w}->set_visibility(!(ref($_->{hidden}) eq 'CODE' ? $_->{hidden}() : $_->{hidden})) foreach @all;  	$mainw->{ok}->set_sensitive(!$common->{ok_disabled}()) if $common->{ok_disabled};  	$ignore = 0;      }; @@ -636,14 +701,15 @@ sub create_widgets {      my $ok_clicked = sub {   	!$mainw->{ok} || $mainw->{ok}->get_property('sensitive') or return;  	$mainw->{retval} = 1; -	Gtk2->main_quit; +	Gtk3->main_quit;      };      my @all = all_entries($l);      foreach (@all) {  	my $e = $_; #- for closures -	if (@all == 1 || $e->{quit_if_double_click}) { +	# we only consider real widgets (aka ignoring labels and Help/Release Notes/... buttons): +	if ((grep { !$_->{install_button} && $_->{type} ne 'only_label' } @all) == 1 || $e->{quit_if_double_click}) {  	    #- i'm the only one, double click means accepting  	    $e->{quit_if_double_click_cooked} = sub { $_[1]->type =~ /^2/ && $ok_clicked->() };  	} @@ -653,7 +719,7 @@ sub create_widgets {  		$mainw->{rwindow}->hide;  		if (my $v = $e->{clicked_may_quit}()) {  		    $mainw->{retval} = $v; -		    Gtk2->main_quit; +		    Gtk3->main_quit;  		}  		$mainw->{rwindow}->show;  		$update->(); @@ -677,11 +743,16 @@ sub create_widgets {  	};      } -    my $box = create_widgets_block($o, $l, $update, \$ignore); +    # add asterisks before titles when there're more than one: +    my @all_titles = all_title_entries($l); +    if (2 <= @all_titles) { +        ${$_->{val}} = mygtk3::asteriskize(${$_->{val}}) foreach @all_titles; +    } + +    my $box = create_widgets_block($o, $common, $l, $update, \$ignore); -    my $tooltips = Gtk2::Tooltips->new;      foreach my $e (@all) { -	$tooltips->set_tip($e->{w}, $e->{help}) if $e->{help} && !ref($e->{help}); +	$e->{w}->set_tooltip_text($e->{help}) if $e->{help} && !ref($e->{help});      }      $box, $set_all; @@ -703,25 +774,72 @@ sub filter_widgets {  my $help_path = "/usr/share/doc/installer-help"; +sub is_help_file_exist { +    my ($_o, $id) = @_; +    # just ignore anchors: +    $id =~ s/#.*//; +    -e "$help_path/$id.html"; +} +  sub load_from_uri { -    my ($document, $url) = @_; -    $url =~ s/#.*$//; # prevent segfaults on anchors -    $url = get_html_file($::o, $url); -    my $str = scalar(cat_($url)); -    c::set_tagged_utf8($str); -    $document->clear; -    $document->open_stream("text/html"); -    $document->write_stream($str); +    my ($view, $url) = @_; +    $view->load_uri(get_html_file($::o, $url));  }  sub get_html_file {      my ($o, $url) = @_; -    find { -e $_ } map { "$help_path/${_}" } +    my $anchor; +    ($url, $anchor) = $url =~ /(.*)#(.*)/ if $url =~ /#/; +    $url .= '.html' if $url !~ /\.html$/; +    $url = find { -e $_ } map { "$help_path/${_}" }        map {            my $id = $_;            require lang; -          map { ("$_/$id") } (split ':', lang::getLANGUAGE($o->{locale}{lang})), ''; +          map { ("$_/$id") } map { $_, lc($_) } (split ':', lang::getLANGUAGE($o->{locale}{lang})), '';        } $url; +    $url = "file://$url"; +    $anchor ? "$url#$anchor" : $url; +} + +sub display_help_window { +    my ($o, $common) = @_; +    if (my $file = $common->{interactive_help_id}) { +        require Gtk3::WebKit2; +        my $view = gtknew('WebKit2_WebView'); + +        load_from_uri($view, $file); + +        my $w = ugtk3->new(N("Help"), modal => 1); +        gtkadd($w->{rwindow}, +               gtkpack_(Gtk3::VBox->new, +                        1, create_scrolled_window(gtkset_border_width($view, 5), +                                                  [ 'never', 'automatic' ], +                                              ), +                        0, Gtk3::HSeparator->new, +                        0, gtkpack(create_hbox('end'), +                                   gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) +                               ), +                    ), +           ); +        mygtk3::set_main_window_size($w->{rwindow}); +        $w->{real_window}->grab_focus; +        $w->{real_window}->show_all; +        $w->main; +        return; +    } elsif (my $message = $common->{interactive_help}->()) { +        $o->ask_warn(N("Help"), $message); +    } +} + +sub display_help { +    my ($o, $common) = @_; +    # not very safe but we run in a restricted environment anyway: +    my $f = '/tmp/help.txt'; +    if ($common->{interactive_help}) { +       output($f, $common->{interactive_help}->()); +    } +    local $ENV{LC_ALL} = $::o->{locale}{lang} || 'C'; +    system('display_installer_help', $common->{interactive_help_id} || $f, $o->{locale}{lang});   }  sub ask_fromW { @@ -729,7 +847,7 @@ sub ask_fromW {      filter_widgets($l); -    my $mainw = ugtk2->new($common->{title}, %$o, modal => 1, if__($::main_window, transient => $::main_window, modal => 1), +    my $mainw = ugtk3->new($common->{title}, %$o, if__($::main_window, transient => $::main_window),                             if_($common->{icon}, icon => $common->{icon}), banner_title => $common->{banner_title},  		       ); @@ -737,47 +855,12 @@ sub ask_fromW {      $mainw->{box_allow_grow} = 1;      my $pack = create_box_with_title($mainw, @{$common->{messages}}); -    mygtk2::set_main_window_size($mainw->{rwindow}) if $mainw->{pop_it} && !$common->{auto_window_size} && (@$l || $mainw->{box_size} == 200); +    mygtk3::set_main_window_size($mainw->{rwindow}) if $mainw->{pop_it} && !$common->{auto_window_size} && (@$l || $mainw->{box_size} == 200);      my @more_buttons = ( -			if_($common->{interactive_help},  -			    [ N("Help"), sub {  -                         if (my $file = $common->{interactive_help_id}) { -                             require Gtk2::Html2; -                             my $view     = Gtk2::Html2::View->new; -                             my $document = Gtk2::Html2::Document->new; -                             $document->signal_connect(request_url => sub { -                                 my ($_document, $url, $stream) = @_; -                                 $stream->write(join('', cat_("$help_path/$url"))); -                                 $stream->close; -                             }); -                             $document->signal_connect('link-clicked' => \&load_from_uri); -                             $view->set_document($document); - -                             load_from_uri($document, "$file.html"); - -                             my $w = ugtk2->new(N("Help"), transient => $mainw->{real_window}, modal => 1); -                             gtkadd($w->{rwindow}, -                                    gtkpack_(Gtk2::VBox->new, -                                             1, create_scrolled_window(gtkset_border_width($view, 5), -                                                                       [ 'never', 'automatic' ], -                                                                   ), -                                             0, gtkpack(create_hbox('edge'), -                                                        gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) -                                                    ), -                                         ), -                                 ); -                             # make parent visible still visible: -                             local ($::real_windowwidth, $::real_windowheight) = ($::real_windowwidth - 50, $::real_windowheight - 50); -                             mygtk2::set_main_window_size($w->{rwindow}); -                             $w->{real_window}->grab_focus; -                             $w->{real_window}->show_all; -                             $w->main; -                             return; -                         } -				  my $message = $common->{interactive_help}->() or return; -				  $o->ask_warn(N("Help"), $message); -			      }, 1 ]), +			if_($common->{interactive_help} || $common->{interactive_help_id},  +                            [ gtknew('Install_Button', text => N("Help"), +                                     clicked => sub { display_help($o, $common) }), undef, 1 ]),  			if_($common->{more_buttons}, @{$common->{more_buttons}}),  		       );      my $buttons_pack = ($common->{ok} || !exists $common->{ok}) && $mainw->create_okcancel($common->{ok}, $common->{cancel}, '', @more_buttons); @@ -787,13 +870,13 @@ sub ask_fromW {      if ($buttons_pack) {  	$pack->pack_end(gtkshow($buttons_pack), 0, 0, 0);      } -    ugtk2::gtkadd($mainw->{window}, $pack); +    ugtk3::gtkadd($mainw->{window}, $pack);      $set_all->();      my $entry_to_focus = find { $_->{focus} && $_->{focus}() } @$l;      my $widget_to_focus = $entry_to_focus ? $entry_to_focus->{focus_w} :                            $common->{focus_cancel} ? $mainw->{cancel} : -			    @$l && (!$mainw->{ok} || @$l == 1 && member(ref($l->[0]{focus_w}), "Gtk2::TreeView", "Gtk2::RadioButton")) ?  +			    @$l && (!$mainw->{ok} || @$l == 1 && member(ref($l->[0]{focus_w}), "Gtk3::TreeView", "Gtk3::RadioButton")) ?   			      $l->[0]{focus_w} :   			      $mainw->{ok};      $widget_to_focus->grab_focus if $widget_to_focus; @@ -816,7 +899,7 @@ sub ask_fromW {  sub ask_browse_tree_info_refW {      my ($o, $common) = @_;      add2hash($common, { wait_message => sub { $o->wait_message(@_) } }); -    ugtk2::ask_browse_tree_info($common); +    ugtk3::ask_browse_tree_info($common);  } @@ -831,48 +914,58 @@ sub ask_from__add_modify_removeW {      $o->ask_from($title, $message, $l, %callback);  } +my $reuse_timeout; +  sub wait_messageW {      my ($o, $title, $message, $message_modifiable) = @_; -    my $to_modify = Gtk2::Label->new(scalar warp_text(ref $message_modifiable ? '' : $message_modifiable)); +    my $to_modify = Gtk3::Label->new(scalar warp_text(ref $message_modifiable ? '' : $message_modifiable)); + +    Glib::Source->remove($reuse_timeout) if $reuse_timeout; $reuse_timeout = '';      my $Window = gtknew('MagicWindow', -			title => $title, -			pop_it => defined $o->{pop_wait_messages} ? $o->{pop_wait_messages} : !$::isInstall,  +			if_($title, title => $title), +			pop_it => defined $o->{pop_wait_messages} ? $o->{pop_wait_messages} : 1,  +			pop_and_reuse => $::isInstall,  			modal => 1,  -			$::isInstall ? (banner => Gtk2::Banner->new((get_default_step_items())[0], $message)) : (), +			$::isInstall ? (banner => gtknew('Install_Title', text => $message)) : (),  			no_Window_Manager => exists $o->{no_Window_Manager} ? $o->{no_Window_Manager} : !$::isStandalone, -			if__($::main_window, transient_for => $::main_window),  			child => gtknew('VBox', padding => 4, border_width => 10, children => [  			    1, $to_modify,  			    if_(ref($message_modifiable), 0, $message_modifiable),  			]),  		      ); -    $Window->signal_connect(expose_event => sub { $Window->{displayed} = 1; 0 }); +    mygtk3::enable_sync_flush($Window);      $Window->{wait_messageW} = $to_modify; -    mygtk2::sync($Window) while !$Window->{displayed}; +    mygtk3::sync_flush($Window);      $Window;  }  sub wait_message_nextW {      my ($_o, $message, $Window) = @_; -    return if $message eq $Window->{wait_messageW}->get_text; #- needed otherwise no expose_event :( +    return if $message eq $Window->{wait_messageW}->get_text; #- needed otherwise no draw :(      $Window->{displayed} = 0;      $Window->{wait_messageW}->set($message); -    mygtk2::sync($Window) while !$Window->{displayed}; +    mygtk3::sync($Window) while !$Window->{displayed};  }  sub wait_message_endW {      my ($_o, $Window) = @_; -    mygtk2::may_destroy($Window); -    mygtk2::flush(); +    if ($Window->{pop_and_reuse}) { +	$reuse_timeout = Glib::Timeout->add(100, sub { +	    mygtk3::destroy_previous_popped_and_reuse_window(); +	}); +    } else { +	mygtk3::may_destroy($Window); +	mygtk3::flush(); +    }  }  sub wait_message_with_progress_bar {      my ($in, $o_title) = @_; -    my $progress = Gtk2::ProgressBar->new; +    my $progress = gtknew('ProgressBar');      my $w = $in->wait_message($o_title, $progress);      my $displayed; -    $progress->signal_connect(expose_event => sub { $displayed = 1; 0 }); +    $progress->signal_connect(draw => sub { $displayed = 1; 0 });      $w, sub {  	my ($msg, $current, $total) = @_;  	if ($msg) { @@ -886,11 +979,11 @@ sub wait_message_with_progress_bar {  		$progress->set_fraction($fraction);  		$progress->show;  		$displayed = 0; -		mygtk2::flush() while !$displayed; +		mygtk3::flush() while !$displayed;  	    }  	} else {  	    $progress->hide; -	    mygtk2::flush(); +	    mygtk3::flush();  	}      };  } diff --git a/perl-install/interactive/http.pm b/perl-install/interactive/http.pm index 52372ab7a..70017c41d 100644 --- a/perl-install/interactive/http.pm +++ b/perl-install/interactive/http.pm @@ -1,4 +1,4 @@ -package interactive::http; # $Id$ +package interactive::http;  use diagnostics;  use strict; @@ -115,7 +115,7 @@ sub ask_fromW {  	open_stdout(); # re-open for writing  	cont_stdout(N("Error")); -	print $q->h1(N("Error")), $q->p("Sorry, you can not go back"); +	print $q->h1(N("Error")), $q->p("Sorry, you cannot go back");  	goto redisplay;      }      each_index { diff --git a/perl-install/interactive/stdio.pm b/perl-install/interactive/stdio.pm index 199b5573c..5bc53a0f5 100644 --- a/perl-install/interactive/stdio.pm +++ b/perl-install/interactive/stdio.pm @@ -1,4 +1,4 @@ -package interactive::stdio; # $Id$ +package interactive::stdio;  use diagnostics;  use strict; @@ -63,7 +63,7 @@ ask_fromW_begin:      my @labels;      my $format_label = sub { my ($e) = @_; return sprintf("`%s' %s %s\n", ${$e->{val}}, $e->{label}, $e->{text}) };      my $do_widget = sub { -	my ($e, $ind) = @_; +	my ($e, $_ind) = @_;  	if ($e->{type} eq 'bool') {  	    print "$e->{text} $e->{label}\n"; @@ -170,7 +170,7 @@ sub wait_messageW {      print join "\n", $message, $message_modifiable;  }  sub wait_message_nextW {  -    my $m = join "\n", $_[1]; +    my $m = $_[1];      print "\r$m", ' ' x (60 - length $m);  }  sub wait_message_endW { print "\nDone\n" } | 
