aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/edit_urpm_sources.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-01 15:51:43 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-01 15:51:43 +0000
commit47e09de628b698d7cf2cc349cec604b779c06fe2 (patch)
treeeff8174d2c4d82352af35b8584579bf9cd2bc43a /Rpmdrake/edit_urpm_sources.pm
parent89a2aa4e8d304f03a928b0f8a6ecdf19dcd0f63d (diff)
downloadrpmdrake-47e09de628b698d7cf2cc349cec604b779c06fe2.tar
rpmdrake-47e09de628b698d7cf2cc349cec604b779c06fe2.tar.gz
rpmdrake-47e09de628b698d7cf2cc349cec604b779c06fe2.tar.bz2
rpmdrake-47e09de628b698d7cf2cc349cec604b779c06fe2.tar.xz
rpmdrake-47e09de628b698d7cf2cc349cec604b779c06fe2.zip
perl_checker cleanups
Diffstat (limited to 'Rpmdrake/edit_urpm_sources.pm')
-rwxr-xr-xRpmdrake/edit_urpm_sources.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index f6418651..dc7c02c8 100755
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -58,7 +58,7 @@ sub selected_rows {
my ($o_list_tv) = @_;
defined $o_list_tv or $o_list_tv = $list_tv;
my (@rows) = $o_list_tv->get_selection->get_selected_rows;
- return -1 if $#rows == -1;
+ return -1 if @rows == 0;
map { $_->to_string } @rows;
}
@@ -354,11 +354,10 @@ sub options_callback() {
sub remove_callback() {
my @rows = selected_rows();
- my $wait;
- $#rows == -1 and return;
+ @rows == 0 and return;
interactive_msg(
N("Source Removal"),
- $#rows == 0 ?
+ @rows == 1 ?
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),
@@ -907,7 +906,7 @@ sub mainwindow() {
my $list = Gtk2::ListStore->new("Glib::Boolean", "Glib::Boolean", "Glib::String");
$list_tv = Gtk2::TreeView->new_with_model($list);
$list_tv->get_selection->set_mode('multiple');
- my ($dw_button, $edit_button, $up_button, $update_button);
+ my ($dw_button, $edit_button, $remove_button, $up_button);
$list_tv->get_selection->signal_connect(changed => sub {
my ($selection) = @_;
my @rows = $selection->get_selected_rows;
@@ -915,7 +914,7 @@ sub mainwindow() {
# we can delete several medium at a time:
$remove_button and $remove_button->set_sensitive($#rows != -1);
# we can only edit/move one item at a time:
- $_ and $_->set_sensitive($#rows == 0) foreach $up_button, $dw_button, $edit_button;
+ $_ and $_->set_sensitive(@rows == 1) foreach $up_button, $dw_button, $edit_button;
return if !$#rows == 0;
my $curr_path = $rows[0];