From 3844f2dc783a6e505e7f114bc1a747e5c040021c Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 24 Sep 2003 12:06:06 +0000 Subject: Dave Bordoley 2003-09-24 Marco Pesenti Gritti Dave Bordoley * src/ephy-tab.c: (ephy_tab_action_activate_cb), (ephy_tab_init): * src/ephy-tabs-menu.c: (tab_added_cb), (tab_removed_cb), (ephy_tabs_menu_set_window), (ephy_tabs_menu_set_property), (ephy_tabs_menu_class_init), (ephy_tabs_menu_init), (ephy_tabs_menu_clean), (ephy_tabs_menu_update): * src/ephy-window.c: (ephy_window_set_active_tab), (tab_added_cb), (tab_removed_cb), (tabs_reordered_cb): Use radio buttons for tabs menu. Do not recreate the action group every time but keep it synced. * src/ephy-notebook.c: (ephy_notebook_insert_page): Emit added signal before activating the page. --- src/ephy-tab.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/ephy-tab.c') diff --git a/src/ephy-tab.c b/src/ephy-tab.c index c5091239a..8e5b4605a 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #define EPHY_TAB_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TAB, EphyTabPrivate)) @@ -70,7 +71,7 @@ struct EphyTabPrivate int total_requests; int width; int height; - GtkAction *action; + GtkRadioAction *action; float zoom; EmbedSecurityLevel security_level; TabNavigationFlags nav_flags; @@ -230,7 +231,11 @@ ephy_tab_action_activate_cb (GtkAction *action, EphyTab *tab) { g_return_if_fail (EPHY_IS_TAB (tab)); - ephy_window_jump_to_tab (tab->priv->window, tab); + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) && + ephy_window_get_active_tab (tab->priv->window) != tab) + { + ephy_window_jump_to_tab (tab->priv->window, tab); + } } static void @@ -1005,10 +1010,11 @@ ephy_tab_init (EphyTab *tab) id = g_strdup_printf ("Tab%lu", tab_id++); - tab->priv->action = g_object_new (GTK_TYPE_ACTION, + tab->priv->action = g_object_new (GTK_TYPE_RADIO_ACTION, "name", id, "label", _("Blank page"), NULL); + g_free (id); g_signal_connect (tab->priv->action, "activate", G_CALLBACK (ephy_tab_action_activate_cb), tab); -- cgit v1.2.3