aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-31 01:46:05 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-31 01:46:05 +0800
commit96b61f1e2c50ce20423136738e1a3e0a9d7364dc (patch)
treedcb97f1e845ac42fa5dba1e920d89f114c0fd8d0 /src/ephy-window.c
parentc9ccac921537b68b5620b485848094a0ffecc3c1 (diff)
downloadgsoc2013-epiphany-96b61f1e2c50ce20423136738e1a3e0a9d7364dc.tar
gsoc2013-epiphany-96b61f1e2c50ce20423136738e1a3e0a9d7364dc.tar.gz
gsoc2013-epiphany-96b61f1e2c50ce20423136738e1a3e0a9d7364dc.tar.bz2
gsoc2013-epiphany-96b61f1e2c50ce20423136738e1a3e0a9d7364dc.tar.lz
gsoc2013-epiphany-96b61f1e2c50ce20423136738e1a3e0a9d7364dc.tar.xz
gsoc2013-epiphany-96b61f1e2c50ce20423136738e1a3e0a9d7364dc.tar.zst
gsoc2013-epiphany-96b61f1e2c50ce20423136738e1a3e0a9d7364dc.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> * configure.ac: * 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/ephy-window.c')
-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 73495a6fd..4be634d05 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1957,11 +1957,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++;
@@ -1970,6 +1993,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
@@ -1977,6 +2006,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),
@@ -1989,6 +2020,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