From 6be59e74845e71b11e1ade1e7e8de2ad6d87f590 Mon Sep 17 00:00:00 2001 From: David Adam Bordoley Date: Thu, 8 May 2003 16:22:12 +0000 Subject: Convenience function for displaying help. Remove unneeded include of 2003-05-08 David Adam Bordoley * lib/ephy-gui.c: (ephy_gui_help): * lib/ephy-gui.h: Convenience function for displaying help. Remove unneeded include of gnome-dialog.h * src/ephy-history-window.c: (cmd_help_contents): * src/prefs-dialog.c: (prefs_dialog_show_help): * src/window-commands.c: (window_cmd_help_contents), (window_cmd_help_about): * src/bookmarks/ephy-bookmark-properties.c: (ephy_bookmark_properties_help), (bookmark_properties_response_cb): * src/bookmarks/ephy-bookmarks-editor.c: (cmd_help_contents): * src/bookmarks/ephy-new-bookmark.c: (ephy_new_bookmark_help), (response_cb): Hook up help to windows/dialogs. Add the guilty parties to about. * help/C/epiphany.xml: Fixed the "To Create a New Bookmark" id. --- lib/ephy-gui.c | 28 ++++++++++++++++++++++++++++ lib/ephy-gui.h | 11 +++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c index ead789762..431b1cea2 100644 --- a/lib/ephy-gui.c +++ b/lib/ephy-gui.c @@ -22,7 +22,9 @@ #include #include #include +#include #include +#include /* Styles for tab labels */ GtkStyle *loading_text_style = NULL; @@ -146,3 +148,29 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename) return res; } + +void +ephy_gui_help (GtkWindow *parent, + const char *file_name, + const char *link_id) +{ + GError *err = NULL; + + gnome_help_display (file_name, link_id, &err); + + if (err != NULL) + { + GtkWidget *dialog; + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Could not display help: %s"), err->message); + g_signal_connect (G_OBJECT (dialog), "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); + gtk_widget_show (dialog); + g_error_free (err); + } +} diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h index 903f6e5bb..4db9caffb 100644 --- a/lib/ephy-gui.h +++ b/lib/ephy-gui.h @@ -22,24 +22,27 @@ /* system includes */ #include #include -#include #include G_BEGIN_DECLS -void ephy_gui_menu_position_under_widget (GtkMenu *menu, +void ephy_gui_menu_position_under_widget (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data); -gint ephy_gui_gtk_radio_button_get (GtkRadioButton *radio_button); +gint ephy_gui_gtk_radio_button_get (GtkRadioButton *radio_button); -void ephy_gui_gtk_radio_button_set (GtkRadioButton *radio_button, +void ephy_gui_gtk_radio_button_set (GtkRadioButton *radio_button, gint index); gboolean ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename); + +void ephy_gui_help (GtkWindow *parent, + const char *file_name, + const char *link_id); G_END_DECLS #endif -- cgit