aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/edit_urpm_sources.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-01 15:47:15 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-01 15:47:15 +0000
commit89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d (patch)
treebb97c6e8475e32b3908379c9c7f2126d2599c910 /Rpmdrake/edit_urpm_sources.pm
parent1a1257453ed71d17df91031922c462073a4848e7 (diff)
downloadrpmdrake-89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d.tar
rpmdrake-89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d.tar.gz
rpmdrake-89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d.tar.bz2
rpmdrake-89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d.tar.xz
rpmdrake-89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d.zip
(remove_callback) enable to delete several medium at once (#21532)
Diffstat (limited to 'Rpmdrake/edit_urpm_sources.pm')
-rwxr-xr-xRpmdrake/edit_urpm_sources.pm18
1 files changed, 12 insertions, 6 deletions
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;
}