diff options
Diffstat (limited to 'perl-install/interactive/stdio.pm')
-rw-r--r-- | perl-install/interactive/stdio.pm | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/perl-install/interactive/stdio.pm b/perl-install/interactive/stdio.pm index 04b5abfcf..9dca9eaba 100644 --- a/perl-install/interactive/stdio.pm +++ b/perl-install/interactive/stdio.pm @@ -70,7 +70,7 @@ ask_fromW_begin: print N("Your choice? (0/1, default `%s') ", ${$e->{val}} || '0'); my $i = readln(); if ($i) { - to_bool($i) != to_bool(${$e->{val}}) and $common->{callbacks}{changed}->($ind); + to_bool($i) != to_bool(${$e->{val}}) and $common->{changed}->($ind); ${$e->{val}} = $i; } } elsif ($e->{type} =~ /list/) { @@ -89,12 +89,12 @@ ask_fromW_begin: print "\n"; my $i = good_choice(may_apply($e->{format}, ${$e->{val}}), $n); print "Setting to <", $i ? ${$e->{list}}[$i-1] : ${$e->{val}}, ">\n"; - $i and ${$e->{val}} = ${$e->{list}}[$i-1], $common->{callbacks}{changed}->($ind); + $i and ${$e->{val}} = ${$e->{list}}[$i-1], $common->{changed}->($ind); } elsif ($e->{type} eq 'button') { print N("Button `%s': %s", $e->{label}, may_apply($e->{format}, ${$e->{val}})), " $e->{text}\n"; print N("Do you want to click on this button?"); my $i = readln(); - $i && $i !~ /^n/i and $e->{clicked_may_quit}(), $common->{callbacks}{changed}->($ind); + $i && $i !~ /^n/i and $e->{clicked_may_quit}(), $common->{changed}->($ind); } elsif ($e->{type} eq 'label') { my $t = $format_label->($e); push @labels, $t; @@ -106,7 +106,7 @@ ask_fromW_begin: ${$e->{val}} = $i || ${$e->{val}}; ${$e->{val}} = '' if ${$e->{val}} eq 'void'; print "Setting to <", ${$e->{val}}, ">\n"; - $i and $common->{callbacks}{changed}->($ind); + $i and $common->{changed}->($ind); } else { printf "UNSUPPORTED WIDGET TYPE (type <%s> label <%s> text <%s> val <%s>\n", $e->{type}, $e->{label}, $e->{text}, ${$e->{val}}; } @@ -153,17 +153,18 @@ Your choice? "); } else { $i = 1; } - my ($callback_error) = $common->{callbacks}{$i == 2 ? 'canceled' : 'complete'}->(); - $callback_error and goto ask_fromW_begin; + if ($i == 1 && !$common->{validate}()) { + goto ask_fromW_begin; + } return $i != 2; } sub wait_messageW { - my ($_o, $_title, $message) = @_; - print join "\n", @$message; + my ($_o, $_title, $message, $message_modifiable) = @_; + print join "\n", $message, $message_modifiable; } sub wait_message_nextW { - my $m = join "\n", @{$_[1]}; + my $m = join "\n", $_[1]; print "\r$m", ' ' x (60 - length $m); } sub wait_message_endW { print "\nDone\n" } |