root / src / manual.c @ 1116
History | View | Annotate | Download (2.3 kB)
| 1 | 1 | hiro | /*
|
|---|---|---|---|
| 2 | 1 | hiro | * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client |
| 3 | 1 | hiro | * Copyright (C) 1999-2002 Hiroyuki Yamamoto |
| 4 | 1 | hiro | * |
| 5 | 1 | hiro | * This program is free software; you can redistribute it and/or modify |
| 6 | 1 | hiro | * it under the terms of the GNU General Public License as published by |
| 7 | 1 | hiro | * the Free Software Foundation; either version 2 of the License, or |
| 8 | 1 | hiro | * (at your option) any later version. |
| 9 | 1 | hiro | * |
| 10 | 1 | hiro | * This program is distributed in the hope that it will be useful, |
| 11 | 1 | hiro | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | 1 | hiro | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | 1 | hiro | * GNU General Public License for more details. |
| 14 | 1 | hiro | * |
| 15 | 1 | hiro | * You should have received a copy of the GNU General Public License |
| 16 | 1 | hiro | * along with this program; if not, write to the Free Software |
| 17 | 1 | hiro | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | 1 | hiro | */ |
| 19 | 1 | hiro | |
| 20 | 1 | hiro | #ifdef HAVE_CONFIG_H
|
| 21 | 1 | hiro | # include "config.h" |
| 22 | 1 | hiro | #endif
|
| 23 | 1 | hiro | |
| 24 | 1 | hiro | #include "defs.h" |
| 25 | 1 | hiro | |
| 26 | 1 | hiro | #include <glib.h> |
| 27 | 1 | hiro | #include <string.h> |
| 28 | 1 | hiro | |
| 29 | 1 | hiro | #include "prefs_common.h" |
| 30 | 1 | hiro | #include "manual.h" |
| 31 | 1 | hiro | #include "utils.h" |
| 32 | 1 | hiro | |
| 33 | 1 | hiro | static gchar *get_lang_str(ManualLang lang);
|
| 34 | 1 | hiro | |
| 35 | 1 | hiro | static gchar *get_lang_str(ManualLang lang)
|
| 36 | 1 | hiro | {
|
| 37 | 1 | hiro | switch (lang) {
|
| 38 | 1 | hiro | case MANUAL_LANG_DE:
|
| 39 | 1 | hiro | return "de"; |
| 40 | 1 | hiro | case MANUAL_LANG_EN:
|
| 41 | 1 | hiro | return "en"; |
| 42 | 1 | hiro | case MANUAL_LANG_ES:
|
| 43 | 1 | hiro | return "es"; |
| 44 | 1 | hiro | case MANUAL_LANG_FR:
|
| 45 | 1 | hiro | return "fr"; |
| 46 | 1 | hiro | case MANUAL_LANG_IT:
|
| 47 | 1 | hiro | return "it"; |
| 48 | 1 | hiro | case MANUAL_LANG_JA:
|
| 49 | 1 | hiro | return "ja"; |
| 50 | 1 | hiro | default:
|
| 51 | 1 | hiro | return NULL; |
| 52 | 1 | hiro | } |
| 53 | 1 | hiro | } |
| 54 | 1 | hiro | |
| 55 | 1 | hiro | void manual_open(ManualLang lang)
|
| 56 | 1 | hiro | {
|
| 57 | 1 | hiro | gchar *lang_str; |
| 58 | 1 | hiro | gchar *file_uri; |
| 59 | 1 | hiro | |
| 60 | 1 | hiro | lang_str = get_lang_str(lang); |
| 61 | 1 | hiro | if (!lang_str) return; |
| 62 | 1 | hiro | |
| 63 | 667 | hiro | file_uri = g_strconcat("file://",
|
| 64 | 667 | hiro | #ifdef G_OS_WIN32
|
| 65 | 667 | hiro | get_startup_dir(), |
| 66 | 667 | hiro | G_DIR_SEPARATOR_S "doc" G_DIR_SEPARATOR_S
|
| 67 | 667 | hiro | "manual",
|
| 68 | 667 | hiro | #else
|
| 69 | 667 | hiro | MANUALDIR, |
| 70 | 667 | hiro | #endif
|
| 71 | 1 | hiro | G_DIR_SEPARATOR_S, lang_str, G_DIR_SEPARATOR_S, |
| 72 | 1 | hiro | MANUAL_HTML_INDEX, NULL);
|
| 73 | 1 | hiro | debug_print("Opening manual: %s\n", file_uri);
|
| 74 | 1 | hiro | open_uri(file_uri, prefs_common.uri_cmd); |
| 75 | 1 | hiro | g_free(file_uri); |
| 76 | 1 | hiro | } |
| 77 | 1 | hiro | |
| 78 | 1 | hiro | void faq_open(ManualLang lang)
|
| 79 | 1 | hiro | {
|
| 80 | 1 | hiro | gchar *lang_str; |
| 81 | 1 | hiro | gchar *file_uri; |
| 82 | 1 | hiro | |
| 83 | 1 | hiro | lang_str = get_lang_str(lang); |
| 84 | 1 | hiro | if (!lang_str) return; |
| 85 | 1 | hiro | |
| 86 | 667 | hiro | file_uri = g_strconcat("file://",
|
| 87 | 667 | hiro | #ifdef G_OS_WIN32
|
| 88 | 667 | hiro | get_startup_dir(), |
| 89 | 667 | hiro | G_DIR_SEPARATOR_S "doc" G_DIR_SEPARATOR_S "faq", |
| 90 | 667 | hiro | #else
|
| 91 | 667 | hiro | FAQDIR, |
| 92 | 667 | hiro | #endif
|
| 93 | 1 | hiro | G_DIR_SEPARATOR_S, lang_str, G_DIR_SEPARATOR_S, |
| 94 | 1 | hiro | FAQ_HTML_INDEX, NULL);
|
| 95 | 1 | hiro | debug_print("Opening FAQ: %s\n", file_uri);
|
| 96 | 1 | hiro | open_uri(file_uri, prefs_common.uri_cmd); |
| 97 | 1 | hiro | g_free(file_uri); |
| 98 | 1 | hiro | } |