From e387048f92f9a3e0cb8fbae807e0ab2280f38e7f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 5 Jan 2003 12:27:06 +0000 Subject: - callbacks "Add", "Modify" and "Remove" return undef when they fail - callback "Add" return the new added element (not handled by interactive emulation, but correctly handled by interactive::gtk native ask_from__add_modify_removeW) --- perl-install/interactive.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index cb15777e1..c92215b31 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -264,12 +264,16 @@ sub ask_from__add_modify_remove { put_in_hash($e, { allow_empty_list => 1, val => \$chosen_element, type => 'list' }); while (1) { - my $c; + my $continue; my @l = (@$l, - map { my $s = $_; { val => translate($_), clicked_may_quit => sub { $callback{$s}->($chosen_element); $c = 1 } } } + map { my $s = $_; { val => translate($_), clicked_may_quit => sub { + my $r = $callback{$s}->($chosen_element); + defined $r or return; + $continue = 1; + } } } N_("Add"), if_(@{$e->{list}} > 0, N_("Modify"), N_("Remove"))); $o->ask_from_({ title => $title, messages => $message, callbacks => \%callback }, \@l) or return; - return if !$c; + return if !$continue; } } } -- cgit v1.2.1