From c7a2957c9b83687701c279d3a09c9556491d0826 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 13 Dec 2013 15:48:15 +0100 Subject: fix edit button being unsensitive (mga#11961) --- Rpmdrake/edit_urpm_sources.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm index 7c7fe434..577a72b1 100644 --- a/Rpmdrake/edit_urpm_sources.pm +++ b/Rpmdrake/edit_urpm_sources.pm @@ -1032,17 +1032,18 @@ sub mainwindow() { 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; + my ($rows) = $selection->get_selected_rows; my $model = $list; + my $size = $#{$rows}; # we can delete several medium at a time: - $remove_button and $remove_button->set_sensitive($#rows != -1); + $remove_button and $remove_button->set_sensitive($size != -1); # we can only edit/move one item at a time: - $_ and $_->set_sensitive(@rows == 1) foreach $up_button, $dw_button, $edit_button; + $_ and $_->set_sensitive($size == 0) foreach $up_button, $dw_button, $edit_button; # we can only up/down one item if not at begin/end: - return if @rows != 1; + return if $size != 0; - my $curr_path = $rows[0]; + my $curr_path = $rows->[0]; my $first_path = $model->get_path($model->get_iter_first); $up_button->set_sensitive($first_path && $first_path->compare($curr_path)); -- cgit v1.2.1