aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--src/ephy-notebook.c18
2 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e53e6bfa6..d8da63800 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2004-11-21 Christian Persch <chpe@cvs.gnome.org>
+ * src/ephy-notebook.c: (ephy_notebook_add_tab):
+
+ If the signal handler for tab-added reordered the tabs,
+ emit the tabs-reordered signal.
+
+2004-11-21 Christian Persch <chpe@cvs.gnome.org>
+
* embed/mozilla/EphyUtils.cpp:
* embed/mozilla/EphyUtils.h:
* embed/print-dialog.h:
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index d57094ddf..2afb5a1c1 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -906,6 +906,7 @@ ephy_notebook_add_tab (EphyNotebook *nb,
gboolean jump_to)
{
GtkWidget *label;
+ int new_position;
g_return_if_fail (EPHY_IS_TAB (tab));
@@ -936,15 +937,24 @@ ephy_notebook_add_tab (EphyNotebook *nb,
g_signal_emit (G_OBJECT (nb), signals[TAB_ADDED], 0, tab);
- if (jump_to)
+ /* The signal handler may have reordered the tabs */
+ new_position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), GTK_WIDGET (tab));
+
+ /* if the signal handler reordered the tabs, emit "tabs-reordered",
+ * so that the tabs menu updates itself.
+ */
+ if (position != new_position)
{
- /* The signal handler may have reordered the tabs */
- position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), GTK_WIDGET(tab));
+ g_signal_emit (nb, signals[TABS_REORDERED], 0);
+ }
+ if (jump_to)
+ {
gtk_notebook_set_current_page (GTK_NOTEBOOK (nb),
- position);
+ new_position);
g_object_set_data (G_OBJECT (tab), "jump_to",
GINT_TO_POINTER (jump_to));
+
}
}