diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-09-27 14:34:42 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-09-27 14:34:42 +0000 |
commit | 4744d41537604f28b948e3400d7695aa4309bf41 (patch) | |
tree | 600d33168297f643ec92602fe37b9a5213db4e8c /perl-install/interactive | |
parent | c291628f2600cb05f681c77973311eb7a6c1f3e0 (diff) | |
download | drakx-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/interactive')
-rw-r--r-- | perl-install/interactive/gtk.pm | 22 |
1 files changed, 13 insertions, 9 deletions
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}, |