From 47e09de628b698d7cf2cc349cec604b779c06fe2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 1 Mar 2007 15:51:43 +0000 Subject: perl_checker cleanups --- Rpmdrake/edit_urpm_sources.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Rpmdrake') 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]; -- cgit v1.2.1