diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-15 04:19:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-15 04:19:12 +0800 |
commit | 7ade227e6409c98a4010992450e111cf7bb10520 (patch) | |
tree | bdd716d894ae2f3b1affaa6bb68950a89441db13 /e-util/e-util.c | |
parent | cca29c3424aede2bb3c9ec5a6d255ce490d3511b (diff) | |
download | gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.gz gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.zst gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.zip |
Merge revisions 35951:35992 from trunk.
svn path=/branches/kill-bonobo/; revision=35994
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r-- | e-util/e-util.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index 5bb42b2afa..06d7e1fcee 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -35,10 +35,11 @@ #include <sys/stat.h> #include <fcntl.h> -#include <glib.h> -#include <glib/gstdio.h> -#include <gtk/gtk.h> #include <gio/gio.h> +#include <gtk/gtk.h> +#include <glib/gi18n.h> +#include <glib/gstdio.h> +#include <libgnome/gnome-help.h> #include <libgnome/gnome-util.h> #ifdef G_OS_WIN32 @@ -70,6 +71,41 @@ e_get_user_data_dir (void) } /** + * e_display_help: + * @parent: a parent #GtkWindow or %NULL + * @link_id: help section to present or %NULL + * + * Opens the user documentation to the section given by @link_id, or to the + * table of contents if @link_id is %NULL. If the user documentation cannot + * be opened, it presents a dialog describing the error. The dialog is set + * as transient to @parent if @parent is non-%NULL. + **/ +void +e_display_help (GtkWindow *parent, + const gchar *link_id) +{ + GtkWidget *dialog; + GError *error = NULL; + + if (gnome_help_display ("evolution.xml", link_id, &error)) + return; + + dialog = gtk_message_dialog_new_with_markup ( + parent, GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "<big><b>%s</b></big>", + _("Could not display help for Evolution.")); + + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), "%s", error->message); + + gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); + g_error_free (error); +} + +/** * e_load_ui_definition: * @manager: a #GtkUIManager * @basename: basename of the UI definition file |