From 89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 1 Mar 2007 15:47:15 +0000 Subject: (remove_callback) enable to delete several medium at once (#21532) --- Rpmdrake/edit_urpm_sources.pm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Rpmdrake/edit_urpm_sources.pm') diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm index 4af06bdc..f6418651 100755 --- a/Rpmdrake/edit_urpm_sources.pm +++ b/Rpmdrake/edit_urpm_sources.pm @@ -353,19 +353,25 @@ sub options_callback() { } sub remove_callback() { - my $row = selrow(); - $row == -1 and return; + my @rows = selected_rows(); + my $wait; + $#rows == -1 and return; interactive_msg( N("Source Removal"), - N("Are you sure you want to remove source \"%s\"?", to_utf8($urpm->{media}[$row]{name})), + $#rows == 0 ? + N("Are you sure you want to remove source \"%s\"?", to_utf8($urpm->{media}[$rows[0]]{name})) : + N("Are you sure you want to remove the following sources ?") . "\n\n\n" . + join("\n\n", sort map { to_utf8($urpm->{media}[$_]{name}) } @rows), yesno => 1, transient => $::main_window, ) or return; my $wait = wait_msg(N("Please wait, removing medium...")); - urpm::media::remove_media($urpm, [ $urpm->{media}[$row] ]); - urpm::media::write_urpmi_cfg($urpm); - remove_wait_msg($wait); + foreach my $row (@rows) { + urpm::media::remove_media($urpm, [ $urpm->{media}[$row] ]); + urpm::media::write_urpmi_cfg($urpm); + remove_wait_msg($wait); + } return 1; } -- cgit v1.2.1