summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-08 12:57:48 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-08 12:57:48 +0000
commitd0aeec3268601990d512dc23a2e69eb43d9a20c7 (patch)
treef61d12e3ba6d512ae7f707f4a6f905303ba16b74
parent9892c2940c447ae5ce53e52db3bd419391972274 (diff)
downloadcontrol-center-d0aeec3268601990d512dc23a2e69eb43d9a20c7.tar
control-center-d0aeec3268601990d512dc23a2e69eb43d9a20c7.tar.gz
control-center-d0aeec3268601990d512dc23a2e69eb43d9a20c7.tar.bz2
control-center-d0aeec3268601990d512dc23a2e69eb43d9a20c7.tar.xz
control-center-d0aeec3268601990d512dc23a2e69eb43d9a20c7.zip
implement new data structure handling in order to add subgroups with
title in the right part of the control-center
-rwxr-xr-xcontrol-center20
1 files changed, 14 insertions, 6 deletions
diff --git a/control-center b/control-center
index 35e8c5bd..bba60472 100755
--- a/control-center
+++ b/control-center
@@ -1233,12 +1233,13 @@ sub clean_list {
foreach (@tree) {
- my ($text, $icon, $subtree) = @$_;
+ my ($text, $icon, $subtrees) = @$_;
+
+ my @subtrees = grep { !is_empty_array_ref($_->{list}) } @$subtrees;
- my @subtree = clean_list($subtree);
# Skip empty classes:
- next if !@subtree;
+ next if !@subtrees;
my $_my_index = $index++;
my $string = join("\n", qq(<HTML>
@@ -1256,7 +1257,7 @@ foreach (@tree) {
</style>
</HEAD>
-<BODY><TABLE BORDER=0 cellspacing="20" WIDTH="100%">
+<BODY>
));
my $view = Gtk2::Html2::View->new;
my $document = Gtk2::Html2::Document->new;
@@ -1276,6 +1277,11 @@ foreach (@tree) {
# Create right notebook pages :
+ foreach my $subtree (@subtrees) {
+ $string .= qq(
+<h2>$subtree->{title}</h2>
+<TABLE BORDER=0 cellspacing="20" WIDTH="100%">
+);
$string .= join("\n",
map {
"<TR>" . join("\n", grep { defined $_ } @$_) . "</TR>" }
@@ -1302,14 +1308,16 @@ foreach (@tree) {
@widgets
</TR></TABLE>
);
- } @subtree)
+ } @{$subtree->{list}})
);
+ $string .= "</TABLE>\n";
+ }
# b/c we use Pango text markup language, we've to protect '&' caracter:
$text =~ s/&/&amp;/g;
$page_count++;
- $string .= qq(</TABLE></BODY></HTML>);
+ $string .= qq(</BODY></HTML>);
$document->clear;
$document->open_stream("text/html");