From f274ed163f035102a4460a815582b8f5a2e1236a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 22 Jan 2002 22:36:12 +0000 Subject: - remove the default entry when that entry is removed - use allow_empty_list for displaying the entries --- perl-install/any.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'perl-install/any.pm') diff --git a/perl-install/any.pm b/perl-install/any.pm index f3ad81c22..cd1438d56 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -219,7 +219,7 @@ sub setupBootloader { while (1) { $in->set_help(arch() =~ /sparc/ ? 'setupSILOAddEntry' : arch() =~ /ppc/ ? 'setupYabootAddEntry' : 'setupBootloaderAddEntry') unless $::isStandalone; my ($c, $e); - $in->ask_from_( + $in->ask_from_( { messages => _("Here are the different entries. @@ -231,8 +231,8 @@ You can add some more or change the existing ones."), ref $e ? "$e->{label} ($e->{kernel_or_dev})" . ($b->{default} eq $e->{label} && " *") : translate($e); - }, list => [ @{$b->{entries}} ] }, - (map { my $s = $_; { val => translate($_), clicked_may_quit => sub { $c = $s; 1 } } } (__("Modify"), __("Add"), __("Done"))), + }, list => [ @{$b->{entries}} ], allow_empty_list => 1 }, + (map { my $s = $_; { val => translate($_), clicked_may_quit => sub { $c = $s; 1 } } } (if_(@{$b->{entries}} > 0, __("Modify")), __("Add"), __("Done"))), ] ); !$c || $c eq "Done" and last; @@ -318,6 +318,7 @@ if (arch() !~ /ppc/) { push @{$b->{entries}}, $e if $c eq "Add"; } else { + delete $b->{default} if $b->{default} eq $e->{label}; @{$b->{entries}} = grep { $_ != $e } @{$b->{entries}}; } } -- cgit v1.2.1