[epiphany] ephy-window: use tab-close-request to avoid code duplication



commit e2576b4990656f70f13d0ee5ebab295def18507a
Author: Diego Escalante Urrelo <diegoe igalia com>
Date:   Thu Feb 9 05:55:11 2012 -0500

    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

 src/ephy-window.c |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 74197ab..da5defb 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 *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]