aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/gui.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-07-05 15:42:02 +0000
committerThierry Vignaud <tv@mandriva.org>2007-07-05 15:42:02 +0000
commit3b35b3bc015d02d344d0ada4dbce1e56de620f31 (patch)
tree69f5d60ed006dfb37a32cb33d063c21c5ffd15be /Rpmdrake/gui.pm
parentc03b88dad7a4a486fce6f6ebdfaf1c0c79a9e732 (diff)
downloadrpmdrake-3b35b3bc015d02d344d0ada4dbce1e56de620f31.tar
rpmdrake-3b35b3bc015d02d344d0ada4dbce1e56de620f31.tar.gz
rpmdrake-3b35b3bc015d02d344d0ada4dbce1e56de620f31.tar.bz2
rpmdrake-3b35b3bc015d02d344d0ada4dbce1e56de620f31.tar.xz
rpmdrake-3b35b3bc015d02d344d0ada4dbce1e56de620f31.zip
(toggle_all) split it out of ask_browse_tree_given_widgets_for_rpmdrake()
Diffstat (limited to 'Rpmdrake/gui.pm')
-rw-r--r--Rpmdrake/gui.pm28
1 files changed, 16 insertions, 12 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index e8b4143f..076b8be3 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -246,6 +246,21 @@ sub update_size {
}
}
+sub toggle_all {
+ my ($common, $_val) = @_;
+ my @l = children() or return;
+ my $w = $common->{widgets};
+
+ my @unsel = grep_unselected(@l);
+ use Data::Dumper; print Dumper \@unsel;
+ my @p = @unsel ?
+ #- not all is selected, select all if no option to potentially override
+ (exists $common->{partialsel_unsel} && $common->{partialsel_unsel}->(\@unsel, \@l) ? difference2(\@l, \@unsel) : @unsel)
+ : @l;
+ toggle_nodes($w->{tree}->window, $w->{detail_list_model}, \&set_leaf_state, undef, @p);
+ update_size($common);
+}
+
# ask_browse_tree_given_widgets_for_rpmdrake will run gtk+ loop. its main parameter "common" is a hash containing:
# - a "widgets" subhash which holds:
# o a "w" reference on a ugtk2 object
@@ -328,18 +343,7 @@ sub ask_browse_tree_given_widgets_for_rpmdrake {
0;
};
my $children = sub { map { $w->{detail_list_model}->get($_, $pkg_columns{text}) } gtktreeview_children($w->{detail_list_model}, $_[0]) };
- $common->{toggle_all} = sub {
- my ($_val) = @_;
- my @l = $children->() or return;
-
- my @unsel = grep_unselected(@l);
- my @p = @unsel ?
- #- not all is selected, select all if no option to potentially override
- (exists $common->{partialsel_unsel} && $common->{partialsel_unsel}->(\@unsel, \@l) ? difference2(\@l, \@unsel) : @unsel)
- : @l;
- toggle_nodes($w->{tree}->window, $w->{detail_list_model}, \&set_leaf_state, undef, @p);
- &$update_size;
- };
+
my $fast_toggle = sub {
my ($iter) = @_;
gtkset_mousecursor_wait($w->{w}{rwindow}->window);