From 4d6b0773e691905cdfcf8ed0011225edc5e394fc Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Tue, 18 Nov 2014 19:06:16 +0100 Subject: Group sorting --- lib/AdminPanel/Rpmdragora/gui.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/AdminPanel/Rpmdragora') diff --git a/lib/AdminPanel/Rpmdragora/gui.pm b/lib/AdminPanel/Rpmdragora/gui.pm index 4065051..28e10f4 100644 --- a/lib/AdminPanel/Rpmdragora/gui.pm +++ b/lib/AdminPanel/Rpmdragora/gui.pm @@ -1407,6 +1407,7 @@ sub toggle_nodes { } # invoke set_leaf_state($pkgname, node_state, ) # node_state = {to_install, to_remove,...} + $set_state->($_, node_state($_), $detail_list); if (my $pkg = $pkgs->{$_}{pkg}) { # FIXME: shouldn't we threat all of them as POSITIVE (as selected size) @@ -1487,13 +1488,18 @@ sub _build_tree { #- we populate all the groups tree at first %$elems = (); # better loop on packages, create groups tree and push packages in the proper place: + my @groups = (); foreach my $pkg (@elems) { my $grp = $pkg->[1]; # no state for groups (they're not packages and thus have no state) - add_parent($tree, $grp, undef); + push @groups, $grp; + $elems->{$grp} ||= []; push @{$elems->{$grp}}, $pkg; } + foreach my $grp (sort @groups) { + add_parent($tree, $grp, undef); + } } -- cgit v1.2.1