aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-12-13 15:48:15 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-12-13 15:48:15 +0100
commitc7a2957c9b83687701c279d3a09c9556491d0826 (patch)
treebb1117936f17b0fdb77cd9632e4cd9e84f67fe4f /Rpmdrake
parenta676cb683e1c84b4fa04c68efe3d17ac8616836c (diff)
downloadrpmdrake-c7a2957c9b83687701c279d3a09c9556491d0826.tar
rpmdrake-c7a2957c9b83687701c279d3a09c9556491d0826.tar.gz
rpmdrake-c7a2957c9b83687701c279d3a09c9556491d0826.tar.bz2
rpmdrake-c7a2957c9b83687701c279d3a09c9556491d0826.tar.xz
rpmdrake-c7a2957c9b83687701c279d3a09c9556491d0826.zip
fix edit button being unsensitive (mga#11961)
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/edit_urpm_sources.pm11
1 files changed, 6 insertions, 5 deletions
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));