diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-01-05 12:27:06 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-01-05 12:27:06 +0000 |
commit | e387048f92f9a3e0cb8fbae807e0ab2280f38e7f (patch) | |
tree | 8ca45226e1a3607f078f1744faf8b902b606c950 | |
parent | 2ba17c9b67869257e88f749a1b5ee6372acfcf9b (diff) | |
download | drakx-e387048f92f9a3e0cb8fbae807e0ab2280f38e7f.tar drakx-e387048f92f9a3e0cb8fbae807e0ab2280f38e7f.tar.gz drakx-e387048f92f9a3e0cb8fbae807e0ab2280f38e7f.tar.bz2 drakx-e387048f92f9a3e0cb8fbae807e0ab2280f38e7f.tar.xz drakx-e387048f92f9a3e0cb8fbae807e0ab2280f38e7f.zip |
- 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)
-rw-r--r-- | perl-install/interactive.pm | 10 |
1 files 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; } } } |