aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-01-04 20:52:05 +0800
committerChristian Persch <chpe@src.gnome.org>2004-01-04 20:52:05 +0800
commit753b29514d19fd54d51c2346bc6bb08ff1093cac (patch)
treee15206e10a0f54f52bcd5c2fd245d0d21f8750ee /src/ephy-notebook.c
parent1fe471d0ab202613f6802751f5604420e23727d1 (diff)
downloadgsoc2013-epiphany-753b29514d19fd54d51c2346bc6bb08ff1093cac.tar
gsoc2013-epiphany-753b29514d19fd54d51c2346bc6bb08ff1093cac.tar.gz
gsoc2013-epiphany-753b29514d19fd54d51c2346bc6bb08ff1093cac.tar.bz2
gsoc2013-epiphany-753b29514d19fd54d51c2346bc6bb08ff1093cac.tar.lz
gsoc2013-epiphany-753b29514d19fd54d51c2346bc6bb08ff1093cac.tar.xz
gsoc2013-epiphany-753b29514d19fd54d51c2346bc6bb08ff1093cac.tar.zst
gsoc2013-epiphany-753b29514d19fd54d51c2346bc6bb08ff1093cac.zip
Add API to check if an EphyEmbed has forms with user input in them.
2004-01-04 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed.c: (ephy_embed_has_modified_forms): * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: Add API to check if an EphyEmbed has forms with user input in them. Currently it required one modified textarea, or two modified text fields. * src/ephy-notebook.c: (ephy_notebook_class_init), (close_button_clicked_cb): * src/ephy-notebook.h: * src/ephy-window.c: (confirm_close_with_modified_forms), (ephy_window_delete_event_cb), (tab_delete_cb), (setup_notebook), (ephy_window_init), (ephy_window_remove_tab): When closing a window or tab, check if there is unsubmitted user input in form fields, and if so, warn the user before closing. Fixes bug #119857.
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 87bb719a6..799e27b74 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -20,7 +20,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
#endif
#include "ephy-notebook.h"
@@ -92,13 +92,14 @@ enum
TAB_REMOVED,
TABS_REORDERED,
TAB_DETACHED,
+ TAB_DELETE,
LAST_SIGNAL
};
-static GObjectClass *parent_class = NULL;
-
static guint signals[LAST_SIGNAL] = { 0 };
+static GObjectClass *parent_class = NULL;
+
GType
ephy_notebook_get_type (void)
{
@@ -175,6 +176,16 @@ ephy_notebook_class_init (EphyNotebookClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
+ signals[TAB_DELETE] =
+ g_signal_new ("tab_delete",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EphyNotebookClass, tab_delete),
+ g_signal_accumulator_true_handled, NULL,
+ ephy_marshal_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ GTK_TYPE_WIDGET);
g_type_class_add_private (object_class, sizeof(EphyNotebookPrivate));
}
@@ -852,9 +863,15 @@ static void
close_button_clicked_cb (GtkWidget *widget, GtkWidget *child)
{
EphyNotebook *notebook;
+ gboolean inhibited = FALSE;
notebook = EPHY_NOTEBOOK (gtk_widget_get_parent (child));
- ephy_notebook_remove_page (notebook, child);
+ g_signal_emit (G_OBJECT (notebook), signals[TAB_DELETE], 0, child, &inhibited);
+
+ if (inhibited == FALSE)
+ {
+ ephy_notebook_remove_page (notebook, child);
+ }
}
static GtkWidget *