aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@igalia.com>2012-02-09 18:55:11 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-02-11 04:06:40 +0800
commite2576b4990656f70f13d0ee5ebab295def18507a (patch)
tree0dff019db54ce82d3f7718bc77bd373b3482d747 /src
parenta32a038b0e39f9811799ca8315dd702659b2353d (diff)
downloadgsoc2013-epiphany-e2576b4990656f70f13d0ee5ebab295def18507a.tar.gz
gsoc2013-epiphany-e2576b4990656f70f13d0ee5ebab295def18507a.tar.zst
gsoc2013-epiphany-e2576b4990656f70f13d0ee5ebab295def18507a.zip
ephy-window: use tab-close-request to avoid code duplication
There were two paths checking for modified forms and downloads on tab closing. Instead of duplication code, make EphyEmbedContainer impl_remove_child trigger ::tab-close-request on EphyNotebook. https://bugzilla.gnome.org/show_bug.cgi?id=669736
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 74197ab47..da5defbb8 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -483,24 +483,11 @@ impl_remove_child (EphyEmbedContainer *container,
EphyEmbed *child)
{
EphyWindow *window;
- EphyWindowPrivate *priv;
- GtkNotebook *notebook;
- gboolean modified;
- int position;
window = EPHY_WINDOW (container);
- priv = window->priv;
-
- modified = ephy_web_view_has_modified_forms (ephy_embed_get_web_view (child));
- if (modified && confirm_close_with_modified_forms (window) == FALSE)
- {
- /* don't close the tab */
- return;
- }
-
- notebook = GTK_NOTEBOOK (priv->notebook);
- position = gtk_notebook_page_num (notebook, GTK_WIDGET (child));
- gtk_notebook_remove_page (notebook, position);
+ g_signal_emit_by_name (window->priv->notebook,
+ "tab-close-request",
+ child, window);
}
static EphyEmbed *