summaryrefslogtreecommitdiffstats
path: root/control-center
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-05-16 03:56:07 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-05-16 03:56:07 +0000
commite5fc238d24405ce1795ae73f00f11e3eda8911d6 (patch)
treef7ce56437f1262cbdac486abb6deaf07773a267f /control-center
parent3a13cd0024697dd17e5c4e6b7ca352f0e69d12f6 (diff)
downloadcontrol-center-e5fc238d24405ce1795ae73f00f11e3eda8911d6.tar
control-center-e5fc238d24405ce1795ae73f00f11e3eda8911d6.tar.gz
control-center-e5fc238d24405ce1795ae73f00f11e3eda8911d6.tar.bz2
control-center-e5fc238d24405ce1795ae73f00f11e3eda8911d6.tar.xz
control-center-e5fc238d24405ce1795ae73f00f11e3eda8911d6.zip
improved layout of CREDITS in about dialog (#14995)
Diffstat (limited to 'control-center')
-rwxr-xr-xcontrol-center44
1 files changed, 28 insertions, 16 deletions
diff --git a/control-center b/control-center
index 0f4ab314..9cc1ef76 100755
--- a/control-center
+++ b/control-center
@@ -34,6 +34,7 @@ use network::netconnect; # for profiles
# i18n: IMPORTANT: to get correct namespace (drakconf instead of libDrakX)
BEGIN { unshift @::textdomains, 'drakconf' }
use ugtk2 qw(:create :dialogs :helpers :wrappers);
+use Gtk2::Pango;
use Gtk2::Html2;
@@ -1808,12 +1809,11 @@ sub about_mdk_cc() {
my $window_about = new_dialog(N("About - Mandriva Linux Control Center"));
my $tree_model = Gtk2::TreeStore->new("Glib::String", "Glib::String", "Glib::String");
- my $credits_model = Gtk2::TreeStore->new("Glib::String", "Glib::String");
- my ($list, $clist) = (Gtk2::TreeView->new_with_model($tree_model), Gtk2::TreeView->new_with_model($credits_model));
- $_->can_focus(0) foreach $list, $clist;
+ my $credits = Gtk2::TextView->new;
+ my $list = Gtk2::TreeView->new_with_model($tree_model);
+ $list->can_focus(0);
each_index { $list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => $::i)) } 0..2;
- each_index { $clist->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => $::i)) } 0..1;
- $_->set_headers_visible(0) foreach $list, $clist;
+ $list->set_headers_visible(0);
foreach my $row ([ N("Authors: "), '', '' ],
[ '', 'Chmouel Boudjnah', N("(original C version)") ],
@@ -1834,18 +1834,30 @@ sub about_mdk_cc() {
$tree_model->append_set(undef, [ map_index { $::i => $_ } @$row ]);
}
+ my ($previous_type, $not_first_title, $not_first_block);
foreach my $line (grep { $_ ne "\n" && !/^#/ } cat_(top(glob("/usr/share/doc/mandriva-release-*/CREDITS")))) {
- if ($line =~ /^\s*\* (.*)$/) {
- my ($contributor, $descr) = split(/:\s*/, $1, 2);
- chomp($descr);
- $descr =~ s/(["\@\$])/\\$1/g;
- $credits_model->append_set(undef, map_index { $::i => $_ } map { join("\n", warp_text(translate(c::to_utf8($_)), 30)) } $contributor, $descr);
- } else {
- chomp($line);
- $credits_model->append_set(undef, 0 => translate(common::sprintf_fixutf8($line)));
-
+ $line =~ s/ Limited Edition 2005 \|//;
+ if (my ($type, $comment, $contributor) = split(/\|/, $line, 3)) {
+ last if !$type;
+ $comment =~ s/^ //; # fix initial space of first section (CREDITS format should be enhanced to specify lines that really are sections)
+ chomp($contributor);
+ if ($previous_type ne $type) {
+ gtktext_append($credits, [ [ join('', if_($not_first_title, "\n"), translate(c::to_utf8($type)), "\n"),
+ { 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD, scale => Gtk2::Pango->PANGO_SCALE_LARGE } ] ]);
+ $previous_type = $type;
+ $not_first_title = 1;
+ }
+ if ($contributor) {
+ gtktext_append($credits,
+ #-PO: this is used as "language: translator" in credits part of the about dialog:
+ N("- %s: %s\n", map { translate($_) } $comment, $contributor)
+ );
+ } else {
+ $comment = $comment . "\n" if !$not_first_block; # fix spacing before second title;
+ gtktext_append($credits, join('', if_($not_first_block, "- "), translate($comment)) );
+ $not_first_block = 1;
+ }
}
-
}
@@ -1871,7 +1883,7 @@ sub about_mdk_cc() {
);
add2notebook($n, N("Authors"), $list);
- add2notebook($n, N("Mandriva Linux Contributors"), create_scrolled_window(gtkset_size_request($clist, 50, 50)));
+ add2notebook($n, N("Mandriva Linux Contributors"), gtkset_size_request(create_scrolled_window($credits), 650, 50));
$window_about->show_all;
}