From 77f3daa23dd2e5eb45aeda66598d2675606658f7 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 18 Jun 2004 00:42:36 +0000 Subject: - simplify item grouping - always show identification first --- perl-install/standalone/harddrake2 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index ffd0bc81b..d4a332f44 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -284,16 +284,14 @@ $tree->get_selection->signal_connect('changed' => sub { member($field, map { @$_ } map { values %$_ } @groups{$current_class, 'generic'}); } keys %device_fields; my @formated; - foreach my $class ($current_class, 'generic') { - my $class_groups = $groups{$class}; - foreach my $group (keys %$class_groups) { - my @fields = @{$class_groups->{$group}}; - # have we at least a member in that group? - next unless any { member($_, @fields) } @$grouped; - - push @formated, titleFormat($group); - push @formated, map { if_(ref $_, @$_) } $device_fields{$_} foreach @fields; - }; + my %groups = map { if_(ref $groups{$_}, %{$groups{$_}}) } $current_class, 'generic'; + foreach my $group (sort { $a eq N("Connection") } keys %groups) { + my @fields = @{$groups{$group}}; + # have we at least a member in that group? + next unless any { member($_, @fields) } @$grouped; + + push @formated, titleFormat($group); + push @formated, map { if_(ref $_, @$_) } $device_fields{$_} foreach @fields; }; push @formated, if_(@formated && @$ungrouped, titleFormat(N("Misc"))), map { @{$device_fields{$_}} } @$ungrouped; gtktext_insert($text, \@formated); -- cgit v1.2.1