aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-31 01:49:42 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-31 01:49:42 +0800
commit43e01459631237732f52b29639220ed7eb71bd4f (patch)
tree0cf5233cd1e48d4566896119c823c8144af96ffe /src
parentfaa39db900ac68efda9f1632878407757e52a187 (diff)
downloadgsoc2013-epiphany-43e01459631237732f52b29639220ed7eb71bd4f.tar
gsoc2013-epiphany-43e01459631237732f52b29639220ed7eb71bd4f.tar.gz
gsoc2013-epiphany-43e01459631237732f52b29639220ed7eb71bd4f.tar.bz2
gsoc2013-epiphany-43e01459631237732f52b29639220ed7eb71bd4f.tar.lz
gsoc2013-epiphany-43e01459631237732f52b29639220ed7eb71bd4f.tar.xz
gsoc2013-epiphany-43e01459631237732f52b29639220ed7eb71bd4f.tar.zst
gsoc2013-epiphany-43e01459631237732f52b29639220ed7eb71bd4f.zip
When showing a modal alert put up by a web page, switch the window to that
2004-10-30 Christian Persch <chpe@cvs.gnome.org> * doc/reference/tmpl/ephy-embed.sgml: * embed/ephy-embed.c: (ephy_embed_base_init): * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * src/ephy-window.c: (modal_alert_cb), (tab_added_cb), (tab_removed_cb): When showing a modal alert put up by a web page, switch the window to that tab.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index ce09eaa57..8c6439644 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1817,11 +1817,34 @@ update_tabs_menu_sensitivity (EphyWindow *window)
g_object_set (action, "sensitive", detach, NULL);
}
+static gboolean
+modal_alert_cb (EphyEmbed *embed,
+ EphyWindow *window)
+{
+ EphyTab *tab;
+ char *address;
+
+ tab = ephy_tab_for_embed (embed);
+ g_return_val_if_fail (tab != NULL, FALSE);
+
+ ephy_window_jump_to_tab (window, tab);
+
+ /* make sure the location entry shows the real URL of the tab's page */
+ address = ephy_embed_get_location (embed, TRUE);
+ toolbar_set_location (window->priv->toolbar, address);
+ g_free (address);
+
+ /* don't suppress alert */
+ return FALSE;
+}
+
static void
tab_added_cb (EphyNotebook *notebook,
EphyTab *tab,
EphyWindow *window)
{
+ EphyEmbed *embed;
+
g_return_if_fail (EPHY_IS_TAB (tab));
window->priv->num_tabs++;
@@ -1830,6 +1853,12 @@ tab_added_cb (EphyNotebook *notebook,
g_signal_connect_object (G_OBJECT (tab), "notify::visible",
G_CALLBACK (sync_tab_visibility), window, 0);
+
+ embed = ephy_tab_get_embed (tab);
+ g_return_if_fail (embed != NULL);
+
+ g_signal_connect_after (embed, "ge-modal-alert",
+ G_CALLBACK (modal_alert_cb), window);
}
static void
@@ -1837,6 +1866,8 @@ tab_removed_cb (EphyNotebook *notebook,
EphyTab *tab,
EphyWindow *window)
{
+ EphyEmbed *embed;
+
g_return_if_fail (EPHY_IS_TAB (tab));
g_signal_handlers_disconnect_by_func (G_OBJECT (tab),
@@ -1849,6 +1880,12 @@ tab_removed_cb (EphyNotebook *notebook,
{
update_tabs_menu_sensitivity (window);
}
+
+ embed = ephy_tab_get_embed (tab);
+ g_return_if_fail (embed != NULL);
+
+ g_signal_handlers_disconnect_by_func
+ (embed, G_CALLBACK (modal_alert_cb), window);
}
static void