From 38459fc216e9505a5174b174335ad162934ba6d8 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 12 Oct 2009 13:55:43 +0000 Subject: run help when pressing --- NEWS | 1 + control-center | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 46bd1e73..bf918fed 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ - fix tool URL which can be a translated UTF-8 string (eg: for CD/DVD entries) (#54457) +- run help when pressing Version 12.13.2 - 05 October 2006, Nicolas Lecureuil diff --git a/control-center b/control-center index e1209086..61f044d9 100755 --- a/control-center +++ b/control-center @@ -663,7 +663,7 @@ my @menu_items = ( [ N("/_Themes") . N("/_More themes"), undef, \&more_themes, undef, '' ] ), [ N("/_Help"), undef, undef, undef, '' ], - [ N("/_Help") . N("/_Help"), undef, sub { fork_("drakhelp --id $help_on_context", []) }, undef, '', N("Help") ], + [ N("/_Help") . N("/_Help"), undef, \&run_help, undef, '', N("Help") ], [ N("/_Help") . N("/_Release notes"), undef, sub { run_browser('Notes') }, undef, '', N("Help") ], [ N("/_Help") . N("/What's _New?"), undef, sub { run_browser("What's New?") }, undef, '', N("Help") ], [ N("/_Help") . N("/_Errata"), undef, sub { run_browser('Errata') }, undef, '', N("Help") ], @@ -673,6 +673,11 @@ my @menu_items = ( [ N("/_Help") . N("/_About..."), undef, \&about_mdk_cc, undef, '' ] ); + +sub run_help() { + fork_("drakhelp --id $help_on_context", []); +} + sub run_browser { my ($url) = @_; $url = "http://wiki.mandriva.com/en/$release->{version}_$url" if $url !~ m!^http://!; @@ -735,6 +740,10 @@ $view->set_size_request(-1, -1); $window_global->signal_connect(delete_event => \&quit_global); +my $accel = Gtk2::AccelGroup->new; +$accel->connect(Gtk2::Gdk->keyval_from_name('F1'), [], ['visible'], \&run_help); +$window_global->add_accel_group($accel); + use POSIX qw(:sys_utsname_h :math_h :sys_wait_h :unistd_h); my (undef, $nodename) = POSIX::uname(); $window_global->set_title(N("%s Control Center %s [on %s]", $branding, $version, $nodename)); -- cgit v1.2.1