diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2008-08-15 03:21:10 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-15 03:21:10 +0800 |
commit | 09cfe5d5690a75e8f79c94b052980dd191965054 (patch) | |
tree | bbac8fbf0e5d44cbf96c3cff50ccfa9cd4411e84 | |
parent | d5258efe7aed378df171fecc3055b065e1403c0e (diff) | |
download | gsoc2013-evolution-09cfe5d5690a75e8f79c94b052980dd191965054.tar.gz gsoc2013-evolution-09cfe5d5690a75e8f79c94b052980dd191965054.tar.zst gsoc2013-evolution-09cfe5d5690a75e8f79c94b052980dd191965054.zip |
New convenience function for launching help from Evolution. Displays an
2008-08-14 Matthew Barnes <mbarnes@redhat.com>
* e-util/e-util.c (e_display_help):
New convenience function for launching help from Evolution.
Displays an error dialog over the given parent window if an
error occurs.
* addressbook/gui/contact-editor/e-contact-editor.c:
* calendar/gui/dialogs/comp-editor.c:
* plugins/email-custom-header/gui/contact-editor/e-contact-editor.c:
* plugins/exchange-operations/exchange-send-options.c:
* widgets/misc/e-multi-config-dialog.c:
* widgets/misc/e-send-options.c:
Use e_display_help() for displaying help.
svn path=/trunk/; revision=35991
-rw-r--r-- | addressbook/ChangeLog | 5 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 14 | ||||
-rw-r--r-- | calendar/ChangeLog | 5 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 8 | ||||
-rw-r--r-- | e-util/ChangeLog | 7 | ||||
-rw-r--r-- | e-util/e-util.c | 42 | ||||
-rw-r--r-- | e-util/e-util.h | 4 | ||||
-rw-r--r-- | plugins/email-custom-header/ChangeLog | 5 | ||||
-rw-r--r-- | plugins/email-custom-header/email-custom-header.c | 12 | ||||
-rw-r--r-- | plugins/exchange-operations/ChangeLog | 5 | ||||
-rw-r--r-- | plugins/exchange-operations/exchange-send-options.c | 13 | ||||
-rw-r--r-- | widgets/misc/ChangeLog | 6 | ||||
-rw-r--r-- | widgets/misc/e-multi-config-dialog.c | 11 | ||||
-rw-r--r-- | widgets/misc/e-send-options.c | 12 |
14 files changed, 94 insertions, 55 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 892a7bce87..f634649050 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +2008-08-14 Matthew Barnes <mbarnes@redhat.com> + + * gui/contact-editor/e-contact-editor.c: + Use e_display_help() for displaying help. + 2008-08-12 Matthew Barnes <mbarnes@redhat.com> * gui/component/GNOME_Evolution_Addressbook.server.in.in: diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index ebdc6bf22f..a226cfe132 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -28,10 +28,7 @@ #include <time.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> -#include <libgnomeui/gnome-window-icon.h> -#include <libgnome/gnome-util.h> #include <glib/gi18n.h> -#include <libgnome/gnome-help.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <libedataserverui/e-categories-dialog.h> @@ -45,6 +42,7 @@ #include "addressbook/gui/component/addressbook.h" #include "addressbook/printing/e-contact-print.h" #include "addressbook/gui/widgets/eab-gui-util.h" +#include "e-util/e-util.h" #include "e-util/e-gui-utils.h" #include "e-util/e-error.h" #include "misc/e-dateedit.h" @@ -3210,14 +3208,8 @@ app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) static void show_help_cb (GtkWidget *widget, gpointer data) { - GError *error = NULL; - - gnome_help_display ( - "evolution.xml", "usage-contact-cards", &error); - if (error != NULL) { - g_warning ("%s", error->message); - g_error_free (error); - } + /* FIXME Pass a proper parent window. */ + e_display_help (NULL, "usage-contact-cards"); } static GList * diff --git a/calendar/ChangeLog b/calendar/ChangeLog index cca6e6a6ca..a98600a82b 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2008-08-14 Matthew Barnes <mbarnes@redhat.com> + + * gui/dialogs/comp-editor.c: + Use e_display_help() for displaying help. + 2008-08-17 Chenthill Palanisamy <pchenthill@novell.com> * gui/dialogs/event-page.c: (source_changed_cb): diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index fa7054d942..18d2431d2b 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -31,6 +31,7 @@ #include <glib/gstdio.h> #include <gdk/gdkkeysyms.h> #include <libgnome/libgnome.h> +#include <e-util/e-util.h> #include <e-util/e-dialog-utils.h> #include <e-util/e-util-private.h> #include <e-util/gconf-bridge.h> @@ -2257,16 +2258,11 @@ static void comp_editor_show_help (CompEditor *editor) { CompEditorClass *class; - GError *error = NULL; class = COMP_EDITOR_GET_CLASS (editor); g_return_if_fail (class->help_section != NULL); - gnome_help_display ("evolution.xml", class->help_section, &error); - if (error != NULL) { - g_warning ("%s", error->message); - g_error_free (error); - } + e_display_help (GTK_WINDOW (editor), class->help_section); } diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 50d649d4d0..0c80024a22 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,10 @@ +2008-08-14 Matthew Barnes <mbarnes@redhat.com> + + * e-util.c (e_display_help): + New convenience function for launching help from Evolution. + Displays an error dialog over the given parent window if an + error occurs. + 2008-08-13 Matthew Barnes <mbarnes@redhat.com> * e-gui-utils.c (e_create_image_widget): diff --git a/e-util/e-util.c b/e-util/e-util.c index 116ebd3f55..815f75e033 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_str_without_underscores: * @s: the string to strip underscores from. * diff --git a/e-util/e-util.h b/e-util/e-util.h index 63cb6f4a5c..484ab59702 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -25,7 +25,7 @@ #define _E_UTIL_H_ #include <sys/types.h> -#include <glib-object.h> +#include <gtk/gtk.h> #include <limits.h> #include <gconf/gconf-client.h> #include <cairo.h> @@ -42,6 +42,8 @@ typedef enum { } EFocus; const gchar * e_get_user_data_dir (void); +void e_display_help (GtkWindow *parent, + const gchar *link_id); char * e_str_without_underscores (const char *s); gint e_str_compare (gconstpointer x, diff --git a/plugins/email-custom-header/ChangeLog b/plugins/email-custom-header/ChangeLog index f3c5c58464..2c992a4fac 100644 --- a/plugins/email-custom-header/ChangeLog +++ b/plugins/email-custom-header/ChangeLog @@ -1,3 +1,8 @@ +2008-08-14 Matthew Barnes <mbarnes@redhat.com> + + * gui/contact-editor/e-contact-editor.c: + Use e_display_help() for displaying help. + 2008-08-12 Bharath Acharya <abharath@novell.com> * Makefile.am: Have a check for OS_WIN32 and handle the schema data diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index 6918a9b43c..ab882cc197 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -26,7 +26,6 @@ #include <glib/gi18n.h> #include <gconf/gconf-client.h> #include <e-util/e-error.h> -#include <libgnome/libgnome.h> #include <glade/glade.h> #include "mail/em-menu.h" #include "mail/em-utils.h" @@ -34,6 +33,7 @@ #include "composer/e-msg-composer.h" #include "libedataserver/e-account.h" #include "e-util/e-config.h" +#include "e-util/e-util.h" #include "email-custom-header.h" @@ -197,7 +197,6 @@ epech_header_options_cb (GtkDialog *dialog, gint state, gpointer func_data) { EmailCustomHeaderOptionsDialogPrivate *priv; CustomHeaderOptionsDialog *mch; - GError *error = NULL; mch = func_data; priv = mch->priv; @@ -211,12 +210,9 @@ epech_header_options_cb (GtkDialog *dialog, gint state, gpointer func_data) g_object_unref (priv->xml); break; case GTK_RESPONSE_HELP: - gnome_help_display ( - "evolution.xml", priv->help_section, &error); - if (error) { - g_warning ("%s", error->message); - g_error_free (error); - } + e_display_help ( + GTK_WINDOW (priv->main), + priv->help_section); break; } diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index f16f1301cf..09fb3274af 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,8 @@ +2008-08-14 Matthew Barnes <mbarnes@redhat.com> + + * exchange-send-options.c: + Use e_display_help() for displaying help. + 2008-08-06 Milan Crha <mcrha@redhat.com> ** Fix for bug #435969 diff --git a/plugins/exchange-operations/exchange-send-options.c b/plugins/exchange-operations/exchange-send-options.c index 02c50e78e0..ef7687df93 100644 --- a/plugins/exchange-operations/exchange-send-options.c +++ b/plugins/exchange-operations/exchange-send-options.c @@ -26,9 +26,8 @@ #include <libedataserverui/e-name-selector.h> #include <libedataserverui/e-contact-store.h> #include "exchange-operations.h" +#include <e-util/e-util.h> #include <e-util/e-error.h> -#include <libgnome/libgnome.h> -#include <libgnome/gnome-i18n.h> #include <glade/glade.h> #include "e-util/e-util-private.h" @@ -280,7 +279,6 @@ static void exchange_send_options_cb (GtkDialog *dialog, gint state, gpointer fu { ExchangeSendOptionsDialogPrivate *priv; ExchangeSendOptionsDialog *sod; - GError *error = NULL; sod = func_data; priv = sod->priv; @@ -295,12 +293,9 @@ static void exchange_send_options_cb (GtkDialog *dialog, gint state, gpointer fu g_object_unref (priv->xml); break; case GTK_RESPONSE_HELP: - gnome_help_display ( - "evolution.xml", priv->help_section, &error); - if (error != NULL) { - g_warning ("%s", error->message); - g_error_free (error); - } + e_display_help ( + GTK_WINDOW (priv->main), + priv->help_section); break; } g_signal_emit (G_OBJECT (func_data), signals[SOD_RESPONSE], 0, state); diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 5f7fd73f51..15f82821c4 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,9 @@ +2008-08-14 Matthew Barnes <mbarnes@redhat.com> + + * e-multi-config-dialog.c: + * e-send-options.c: + Use e_display_help() for displaying help. + 2008-08-11 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #546892 diff --git a/widgets/misc/e-multi-config-dialog.c b/widgets/misc/e-multi-config-dialog.c index 159b14561c..780a33baaa 100644 --- a/widgets/misc/e-multi-config-dialog.c +++ b/widgets/misc/e-multi-config-dialog.c @@ -26,14 +26,13 @@ #include "e-multi-config-dialog.h" +#include <e-util/e-util.h> #include <table/e-table-scrolled.h> #include <table/e-table-memory-store.h> #include <table/e-cell-pixbuf.h> #include <table/e-cell-vbox.h> #include <table/e-cell-text.h> -#include <libgnome/gnome-help.h> - #define SWITCH_PAGE_INTERVAL 250 struct _EMultiConfigDialogPrivate { @@ -172,18 +171,12 @@ static void impl_response (GtkDialog *dialog, int response_id) { EMultiConfigDialog *multi_config_dialog; - GError *error = NULL; multi_config_dialog = E_MULTI_CONFIG_DIALOG (dialog); switch (response_id) { case GTK_RESPONSE_HELP: - gnome_help_display ( - "evolution.xml", "config-prefs", &error); - if (error != NULL) { - g_warning ("%s", error->message); - g_error_free (error); - } + e_display_help (GTK_WINDOW (dialog), "config-prefs"); break; case GTK_RESPONSE_CLOSE: default: diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 32eb33b484..33c80d6917 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -23,11 +23,11 @@ #endif #include <string.h> -#include <libgnome/libgnome.h> #include <glib/gi18n.h> #include <glade/glade.h> #include <time.h> +#include "e-util/e-util.h" #include "e-util/e-util-private.h" #include "e-dateedit.h" @@ -586,7 +586,6 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data { ESendOptionsDialogPrivate *priv; ESendOptionsDialog *sod; - GError *error = NULL; sod = func_data; priv = sod->priv; @@ -600,12 +599,9 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data g_object_unref (priv->xml); break; case GTK_RESPONSE_HELP: - gnome_help_display ( - "evolution.xml", priv->help_section, &error); - if (error != NULL) { - g_warning ("%s", error->message); - g_error_free (error); - } + e_display_help ( + GTK_WINDOW (priv->main), + priv->help_section); break; } |