From 385d87f37dbb8a9b07ad93998a825025042bb998 Mon Sep 17 00:00:00 2001 From: David Trowbridge Date: Tue, 27 Jan 2004 20:55:28 +0000 Subject: add definition for EVOLUTION_HELPDIR 2004-01-26 David Trowbridge * Makefile.am: add definition for EVOLUTION_HELPDIR * e-shell-window-commands.c: add handling for new "Quick Reference" menu svn path=/trunk/; revision=24472 --- shell/e-shell-window-commands.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'shell/e-shell-window-commands.c') diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c index d9092c22a8..fa45f34fb0 100644 --- a/shell/e-shell-window-commands.c +++ b/shell/e-shell-window-commands.c @@ -181,6 +181,35 @@ command_help_faq (BonoboUIComponent *uih, gnome_url_show ("http://www.ximian.com/apps/evolution-faq.html", NULL); /* FIXME use the error */ } +static void +command_quick_reference (BonoboUIComponent *uih, + EShellWindow *window, + const char *path) +{ + char *quickref; + char *uri; + const GList *lang_list = gnome_i18n_get_language_list ("LC_MESSAGES"); + for (; lang_list != NULL; lang_list = lang_list->next) { + const char *lang = lang_list->data; + + /* This has to be a valid language AND a language with + * no encoding postfix. The language will come up without + * encoding next */ + if (lang == NULL || strchr (lang, '.') != NULL) + continue; + + quickref = g_build_filename (EVOLUTION_HELPDIR, "quickref", lang, "quickref.pdf", NULL); + if (g_file_test (quickref, G_FILE_TEST_EXISTS)) { + uri = g_strconcat ("file://", quickref, NULL); + gnome_url_show (uri, NULL); + g_free (quickref); + g_free (uri); + return; + } + g_free (quickref); + } +} + static void command_work_offline (BonoboUIComponent *uih, @@ -279,6 +308,7 @@ static BonoboUIVerb tools_verbs[] = { static BonoboUIVerb help_verbs [] = { BONOBO_UI_VERB ("HelpFAQ", (BonoboUIVerbFn) command_help_faq), + BONOBO_UI_VERB ("QuickReference", (BonoboUIVerbFn) command_quick_reference), BONOBO_UI_VERB ("HelpSubmitBug", (BonoboUIVerbFn) command_submit_bug), BONOBO_UI_VERB ("HelpAbout", (BonoboUIVerbFn) command_about_box), -- cgit v1.2.3