aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-web-view.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2010-05-03 19:35:12 +0800
committerXan Lopez <xan@gnome.org>2010-05-03 19:40:33 +0800
commitea394862505225b631b677d33aa6c9203f850486 (patch)
tree76c692a265723b5c030535b5799dc69bf4a6bf63 /embed/ephy-web-view.c
parent6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b (diff)
downloadgsoc2013-epiphany-ea394862505225b631b677d33aa6c9203f850486.tar.gz
gsoc2013-epiphany-ea394862505225b631b677d33aa6c9203f850486.tar.zst
gsoc2013-epiphany-ea394862505225b631b677d33aa6c9203f850486.zip
Emit a signal when loading the homepage
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r--embed/ephy-web-view.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index c3fa53a89..380dabd94 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1776,6 +1776,21 @@ ephy_web_view_class_init (EphyWebViewClass *klass)
1,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
+/**
+ * EphyWebView::loading-homepage
+ * @view: the #EphyWebView that received the signal
+ *
+ * The ::loading-homepage signal is emitted when the @view is about to
+ * load the homepage set by the user.
+ **/
+ g_signal_new ("loading-homepage",
+ EPHY_TYPE_WEB_VIEW,
+ G_SIGNAL_RUN_FIRST,
+ NULL, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
g_type_class_add_private (gobject_class, sizeof (EphyWebViewPrivate));
}
@@ -3535,23 +3550,25 @@ ephy_web_view_save (EphyWebView *view, const char *uri)
gboolean
ephy_web_view_load_homepage (EphyWebView *view)
{
- char *home;
- gboolean is_empty;
+ char *home;
+ gboolean is_empty;
- home = eel_gconf_get_string (CONF_GENERAL_HOMEPAGE);
+ g_signal_emit_by_name (view, "loading-homepage");
- if (home == NULL || home[0] == '\0')
- {
- g_free (home);
+ home = eel_gconf_get_string (CONF_GENERAL_HOMEPAGE);
- home = g_strdup ("about:blank");
- }
+ if (home == NULL || home[0] == '\0')
+ {
+ g_free (home);
+
+ home = g_strdup ("about:blank");
+ }
- is_empty = ephy_embed_utils_url_is_empty (home);
- ephy_web_view_load_url (view, home);
+ is_empty = ephy_embed_utils_url_is_empty (home);
+ ephy_web_view_load_url (view, home);
- g_free (home);
+ g_free (home);
- return is_empty;
+ return is_empty;
}