summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2003-02-10 11:11:58 +0000
committerDaouda Lo <daouda@mandriva.com>2003-02-10 11:11:58 +0000
commit6b8e5e1f0c6f4913093dc075563617f7f7adf5f8 (patch)
tree33f321f44a514d3b55b0e00ffa6b320eb2151840
parent5374021c0bf4efb1728aa3cc76b4a3b32413f6df (diff)
downloaddrakx-backup-do-not-use-6b8e5e1f0c6f4913093dc075563617f7f7adf5f8.tar
drakx-backup-do-not-use-6b8e5e1f0c6f4913093dc075563617f7f7adf5f8.tar.gz
drakx-backup-do-not-use-6b8e5e1f0c6f4913093dc075563617f7f7adf5f8.tar.bz2
drakx-backup-do-not-use-6b8e5e1f0c6f4913093dc075563617f7f7adf5f8.tar.xz
drakx-backup-do-not-use-6b8e5e1f0c6f4913093dc075563617f7f7adf5f8.zip
- http connections handled.
-rw-r--r--perl-install/standalone/drakhelp35
1 files changed, 17 insertions, 18 deletions
diff --git a/perl-install/standalone/drakhelp b/perl-install/standalone/drakhelp
index a3a0a9653..4f2eca29f 100644
--- a/perl-install/standalone/drakhelp
+++ b/perl-install/standalone/drakhelp
@@ -17,22 +17,21 @@ my $in = interactive->vnew;
my $locale = lang::read('', $>);
if (!member($locale->{lang}, qw(de en es fr it ru))) { $locale->{lang} = 'en' };
-my $path_to_help = "/usr/share/doc/mandrake/" . $locale->{lang} . "/";
-
--d $path_to_help or $in->do_pkgs->install('mandrake_doc-drakxtools-' . $locale->{lang});
-
-if ((my $wm = any::running_window_manager()) eq 'kwin') {
- system("mdklaunchhelp " . $path_to_help . $ARGV[0] . "&");
-} elsif ($wm eq 'gnome-session') {
- system("yelp ghelp://" . $path_to_help . $ARGV[0] . "&")
-} else {
- on_request_help($path_to_help . $ARGV[0])
-}
-
-sub on_request_help {
- my ($link) = @_;
- my $browser = $ENV{BROWSER} || find { -x "/usr/bin/$_" } qw(mozilla konqueror galeon) or $in->ask_warn('drakhelp', N("No browser is installed on your system, Please install one if you want to browse the help system"));
- standalone::explanations("Connection to help system at $link");
- system("$browser $link &");
-}
+my $path2help = "/usr/share/doc/mandrake/" . $locale->{lang} . "/";
+-d $path2help or $in->do_pkgs->install('mandrake_doc-drakxtools-' . $locale->{lang});
+
+my $path = $ARGV[0] =~ /^http|^www/ ? $ARGV[0] : $path2help . $ARGV[0];
+
+my $wm = any::running_window_manager();
+my %launchhelp = (
+ 'kwin' => sub { system("mdklaunchhelp " . $path . "&") },
+ 'gnome-session' => sub { system("yelp ghelp://" . $path . "&") },
+ 'other' => sub { my $browser = $ENV{BROWSER} || find { -x "/usr/bin/$_" } qw(mozilla konqueror galeon) or $in->ask_warn('drakhelp', N("No browser is installed on your system, Please install one if you want to browse the help system"));
+ standalone::explanations("Connection to help system at $link");
+ system("$browser " . $path . "&")
+ }
+ );
+member($wm, 'kwin', 'gnome-session') or $wm = 'other';
+eval { $launchhelp{$wm}->() };
+