#!/usr/bin/perl use strict; use diagnostics; use lib qw(/usr/lib/libDrakX); use standalone; #- warning, standalone must be loaded very first, for 'explanations' use interactive; use common; use any; use ctxhelp; use log; sub usage() { print STDERR N(" drakhelp 0.1 Copyright (C) 2003-2004 Mandrakesoft. This is free software and may be redistributed under the terms of the GNU GPL. Usage: ") . N(" --help - display this help ") . N(" --id - load the html help page which refers to id_label ") . N(" --doc - link to another web page ( for WM welcome frontend) "); exit(0) } my ($opt, $idlabel) = @ARGV; @ARGV == 2 && ($opt eq '--id' || $opt eq '--doc' || $opt eq '--help') or usage(); $ugtk2::wm_icon = "help"; my $in = interactive->vnew; my ($instpath, $ancpath, $package) = ctxhelp::path2help($opt, $idlabel); -e $instpath or system("/usr/sbin/drakhelp_inst $package"); -e $instpath or $in->ask_warn(N("Mandrakelinux Help Center"), N("%s cannot be displayed \n. No Help entry of this type\n", $instpath)); my $wm = any::running_window_manager(); my %launchhelp = ( 'kwin' => sub { system("webclient-kde " . $ancpath . "&") }, 'gnome-session' => sub { system("yelp ghelp://" . $ancpath . "&") }, 'other' => sub { my $browser = $ENV{BROWSER} || find { -x "/usr/bin/$_" } qw(mozilla konqueror epiphany 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")); log::explanations("Loading help system : $ancpath"); system("$browser " . $ancpath . "&") } ); member($wm, 'kwin', 'gnome-session') or $wm = 'other'; -e $instpath and eval { $launchhelp{$wm}->() }; > Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-09 13:16:09 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-09 13:16:09 +0000
commitf019b21180311a8b62fa224347fe6495249be24c (patch)
tree66f007a277d7c1982ee9ddca38d14ff8faf128b6
parent706e187feaae6481ddf1e4cee64e0e2b302020da (diff)
downloaddrakx-backup-do-not-use-f019b21180311a8b62fa224347fe6495249be24c.tar
drakx-backup-do-not-use-f019b21180311a8b62fa224347fe6495249be24c.tar.gz
drakx-backup-do-not-use-f019b21180311a8b62fa224347fe6495249be24c.tar.bz2
drakx-backup-do-not-use-f019b21180311a8b62fa224347fe6495249be24c.tar.xz
drakx-backup-do-not-use-f019b21180311a8b62fa224347fe6495249be24c.zip
better style (#41358)