summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-09-27 14:34:42 +0000
committerThierry Vignaud <tv@mandriva.org>2007-09-27 14:34:42 +0000
commit4744d41537604f28b948e3400d7695aa4309bf41 (patch)
tree600d33168297f643ec92602fe37b9a5213db4e8c /perl-install
parentc291628f2600cb05f681c77973311eb7a6c1f3e0 (diff)
downloaddrakx-4744d41537604f28b948e3400d7695aa4309bf41.tar
drakx-4744d41537604f28b948e3400d7695aa4309bf41.tar.gz
drakx-4744d41537604f28b948e3400d7695aa4309bf41.tar.bz2
drakx-4744d41537604f28b948e3400d7695aa4309bf41.tar.xz
drakx-4744d41537604f28b948e3400d7695aa4309bf41.zip
(get_html_file)
- split it out of ask_fromW(), - use it in load_from_uri() so that we try translated links first (#33679)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install/NEWS3
-rw-r--r--perl-install/interactive/gtk.pm22
2 files changed, 16 insertions, 9 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 3c0b99c79..761b03f59 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,6 @@
+- help:
+ o try translated links first (#33679)
+
Version 10.4.216 - 27 September 2007, by Pascal "Pixel" Rigaux
- allow to choose countries like "Angola" which have no locale (en_AO) in the
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index 6044273d6..c0775d2ba 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -702,7 +702,7 @@ my $help_path = "/usr/share/doc/installer-help";
sub load_from_uri {
my ($document, $url) = @_;
- $url = "$help_path/$url" if $url !~ m!^/!;
+ $url = get_html_file($::o, $url);
my $str = scalar(cat_($url));
c::set_tagged_utf8($str);
$document->clear;
@@ -710,6 +710,16 @@ sub load_from_uri {
$document->write_stream($str);
}
+sub get_html_file {
+ my ($o, $url) = @_;
+ find { -e $_ } map { "$help_path/${_}" }
+ map {
+ my $id = $_;
+ require lang;
+ map { ("$_/$id") } (split ':', lang::getLANGUAGE($o->{locale}{lang}));
+ } $url;
+}
+
sub ask_fromW {
my ($o, $common, $l) = @_;
@@ -728,13 +738,7 @@ sub ask_fromW {
my @more_buttons = (
if_($common->{interactive_help},
[ N("Help"), sub {
- if (my $file = find { -e $_ } map { "$help_path/${_}.html" }
- map {
- my $id = $_;
- require lang;
- map { "$_/$id" } (split ':', lang::getLANGUAGE($o->{locale}{lang}));
- } $common->{interactive_help_id}
- ) {
+ if (my $file = $common->{interactive_help_id}) {
require Gtk2::Html2;
my $view = Gtk2::Html2::View->new;
my $document = Gtk2::Html2::Document->new;
@@ -746,7 +750,7 @@ sub ask_fromW {
$document->signal_connect('link-clicked' => \&load_from_uri);
$view->set_document($document);
- load_from_uri($document, $file);
+ load_from_uri($document, "$file.html");
my $w = ugtk2->new(N("Help"), transient => $mainw->{real_window}, modal => 1);
gtkadd($w->{rwindow},