diff options
author | Adam Hooper <adamh@src.gnome.org> | 2004-12-18 04:02:42 +0800 |
---|---|---|
committer | Adam Hooper <adamh@src.gnome.org> | 2004-12-18 04:02:42 +0800 |
commit | 13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08 (patch) | |
tree | b32cf7a8687fd4a5be92a564629891c19b264080 /src | |
parent | 9bf71295e9a4e5cdfe9dc4380343616c49b161c6 (diff) | |
download | gsoc2013-epiphany-13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08.tar gsoc2013-epiphany-13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08.tar.gz gsoc2013-epiphany-13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08.tar.bz2 gsoc2013-epiphany-13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08.tar.lz gsoc2013-epiphany-13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08.tar.xz gsoc2013-epiphany-13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08.tar.zst gsoc2013-epiphany-13c8b7335b1aacf79bb4f1e735f6b88bd8dd6e08.zip |
Use gtk_show_about_dialog(), and handle urls and mailto.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-main.c | 23 | ||||
-rw-r--r-- | src/ephy-shell.c | 2 | ||||
-rw-r--r-- | src/window-commands.c | 46 |
3 files changed, 36 insertions, 35 deletions
diff --git a/src/ephy-main.c b/src/ephy-main.c index 3bb38481e..49bc8f998 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -29,12 +29,14 @@ #include <libgnomeui/gnome-ui-init.h> #include <libgnomeui/gnome-app-helper.h> +#include <gtk/gtkaboutdialog.h> #include <gtk/gtkmain.h> #include <gtk/gtkmessagedialog.h> #include <libgnome/gnome-program.h> #include <bonobo/bonobo-main.h> #include <glib/gi18n.h> #include <libgnomevfs/gnome-vfs-init.h> +#include <libgnomevfs/gnome-vfs-utils.h> #include <libxml/xmlversion.h> static gboolean open_in_existing = FALSE; @@ -70,6 +72,23 @@ static struct poptOption popt_options[] = }; static void +handle_url (GtkAboutDialog *about, + const char *link, + gpointer data) +{ + ephy_shell_new_tab (ephy_shell, NULL, NULL, link, + EPHY_NEW_TAB_OPEN_PAGE); +} + +static void +handle_email (GtkAboutDialog *about, + const char *link, + gpointer data) +{ + gnome_vfs_url_show (link); +} + +static void shell_weak_notify (gpointer data, GObject *where_the_object_was) { @@ -166,6 +185,10 @@ main (int argc, char *argv[]) eel_gconf_monitor_add ("/apps/epiphany/lockdown"); eel_gconf_monitor_add ("/desktop/gnome/lockdown"); + /* Extensions may want these, so don't initialize in window-cmds */ + gtk_about_dialog_set_url_hook (handle_url, NULL, NULL); + gtk_about_dialog_set_email_hook (handle_email, NULL, NULL); + bonobo_activate (); ephy_shell = ephy_shell_new (); diff --git a/src/ephy-shell.c b/src/ephy-shell.c index a72fe5d36..46a56b2b6 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -511,7 +511,7 @@ load_homepage (EphyEmbed *embed) * @url: an url to load or %NULL * * Create a new tab and the parent window when necessary. - * Ever use this function to open urls in new window/tabs. + * Use this function to open urls in new window/tabs. * * ReturnValue: the created #EphyTab **/ diff --git a/src/window-commands.c b/src/window-commands.c index 0f89e32b7..171e16263 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -52,11 +52,11 @@ #include <libgnomevfs/gnome-vfs-utils.h> #include <libgnomeui/gnome-stock-icons.h> #include <libgnomevfs/gnome-vfs-mime-handlers.h> +#include <gtk/gtkaboutdialog.h> #include <gtk/gtkeditable.h> #include <gtk/gtkmain.h> #include <gtk/gtkicontheme.h> #include <gtk/gtktoggleaction.h> -#include <gtk/gtkaboutdialog.h> #include <glib/gi18n.h> enum @@ -879,9 +879,6 @@ void window_cmd_help_about (GtkAction *action, GtkWidget *window) { - static GtkWidget *about = NULL; - GtkWidget** ptr; - static char *authors[] = { "Marco Pesenti Gritti <marco@gnome.org>", "Xan Lopez <xan@gnome.org>", @@ -890,42 +887,23 @@ window_cmd_help_about (GtkAction *action, NULL }; - char *documenters[] = { + static char *documenters[] = { "Patanjali Somayaji <patanjali@codito.com>", "David Bordoley <bordoley@msu.edu>", "Piers Cornwell <piers@gnome.org>", NULL }; - if (about != NULL) - { - gtk_window_present (GTK_WINDOW (about)); - - return; - } - - - about = g_object_new (GTK_TYPE_ABOUT_DIALOG, - "name", _("Epiphany"), - "version", VERSION, - "copyright", "Copyright \xc2\xa9 2002-2004 Marco Pesenti Gritti", - "authors", authors, - "documenters", documenters, - "translator-credits", _("translator-credits"), - "logo-icon-name", "web-browser", - NULL); - - gtk_window_set_icon_name (GTK_WINDOW (about), "web-browser"); - - g_signal_connect (about, "response", G_CALLBACK (gtk_widget_destroy), NULL); - - gtk_window_set_transient_for (GTK_WINDOW (about), GTK_WINDOW (window)); - gtk_window_set_destroy_with_parent (GTK_WINDOW (about), TRUE); - - ptr = &about; - g_object_add_weak_pointer (G_OBJECT (about), (gpointer *)ptr); - - gtk_window_present (GTK_WINDOW (about)); + gtk_show_about_dialog (GTK_WINDOW (window), + "name", _("Epiphany"), + "version", VERSION, + "copyright", "Copyright \xc2\xa9 2002-2004 Marco Pesenti Gritti", + "authors", authors, + "documenters", documenters, + "translator-credits", _("translator-credits"), + "logo-icon-name", "web-browser", + "website", "http://www.gnome.org/projects/epiphany", + NULL); } void |