[epiphany] ephy-window: remove the tabs menu



commit fdf7054db6d84b554b3ea52ed60d065f211765e0
Author: Xan Lopez <xan igalia com>
Date:   Mon Dec 5 00:21:40 2011 +0100

    ephy-window: remove the tabs menu
    
    It is not present in the new design. The Alt+<num> accelerators are
    dying with it, but it will be pretty easy to bring them back if
    needed.

 data/ui/epiphany-ui.xml |   14 --
 src/Makefile.am         |    2 -
 src/ephy-tabs-menu.c    |  486 -----------------------------------------------
 src/ephy-tabs-menu.h    |   61 ------
 src/ephy-window.c       |   73 +-------
 5 files changed, 7 insertions(+), 629 deletions(-)
---
diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml
index ad8577c..a962341 100644
--- a/data/ui/epiphany-ui.xml
+++ b/data/ui/epiphany-ui.xml
@@ -86,20 +86,6 @@
 
 		<menu name="ToolsMenu" action="Tools"/>
 
-		<menu name="TabsMenu" action="Tabs">
-			<menuitem name="TabsPreviousMenu" action="TabsPrevious"/>
-			<menuitem name="TabsNextMenu" action="TabsNext"/>
-			<separator name="TabsSep1"/>
-			<placeholder name="TabsMoveGroup">
-				<menuitem name="TabsMoveLeftMenu" action="TabsMoveLeft"/>
-				<menuitem name="TabsMoveRightMenu" action="TabsMoveRight"/>
-			</placeholder>
-			<menuitem name="TabsDetach" action="TabsDetach"/>
-			<placeholder name="TabsOpen">
-				<separator name="TabsSep2"/>
-			</placeholder>
-		</menu>
-
 		<menu name="HelpMenu" action="Help">
 			<menuitem name="HelpContentsMenu" action="HelpContents"/>
 			<menuitem name="HelpAboutMenu" action="HelpAbout"/>
diff --git a/src/Makefile.am b/src/Makefile.am
index 49463d6..97418ad 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,7 +29,6 @@ NOINST_H_FILES = \
 	ephy-navigation-history-action.h	\
 	ephy-navigation-up-action.h		\
 	ephy-password-info.h			\
-	ephy-tabs-menu.h			\
 	ephy-toolbars-model.h			\
 	ephy-toolbar.h				\
 	languages.h				\
@@ -73,7 +72,6 @@ libephymain_la_SOURCES = \
 	ephy-password-info.c	        	\
 	ephy-session.c				\
 	ephy-shell.c				\
-	ephy-tabs-menu.c			\
 	ephy-toolbars-model.c			\
 	ephy-toolbar.c				\
 	ephy-window.c				\
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3dcf58f..81866f0 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -49,7 +49,6 @@
 #include "ephy-shell.h"
 #include "ephy-state.h"
 #include "ephy-stock-icons.h"
-#include "ephy-tabs-menu.h"
 #include "ephy-toolbar.h"
 #include "ephy-type-builtins.h"
 #include "ephy-web-view.h"
@@ -110,7 +109,6 @@ static const GtkActionEntry ephy_menu_entries [] = {
 	{ "Bookmarks", NULL, N_("_Bookmarks") },
 	{ "Go", NULL, N_("_Go") },
 	{ "Tools", NULL, N_("T_ools") },
-	{ "Tabs", NULL, N_("_Tabs") },
 	{ "Help", NULL, N_("_Help") },
 	{ "Toolbar", NULL, N_("_Toolbars") },
 	{ "PopupAction", NULL, "" },
@@ -376,6 +374,13 @@ static const struct
 	{ GDK_KEY_s,		GDK_CONTROL_MASK,	"FileSaveAs",		 FALSE },
 	{ GDK_KEY_R,		GDK_CONTROL_MASK |
 				GDK_SHIFT_MASK,		"ViewReload",		 FALSE },
+	/* Tab navigation */
+	{ GDK_KEY_Page_Up,      GDK_CONTROL_MASK,       "TabsNext",              FALSE },
+	{ GDK_KEY_Page_Down,    GDK_CONTROL_MASK,       "TabsPrevious",          FALSE },
+	{ GDK_KEY_Page_Up,      GDK_CONTROL_MASK |
+	                        GDK_SHIFT_MASK,       "TabsMoveRight",           FALSE },
+	{ GDK_KEY_Page_Down,    GDK_CONTROL_MASK |
+	                        GDK_SHIFT_MASK,       "TabsMoveLeft",            FALSE },
 	/* Support all the MSIE tricks as well ;) */
 	{ GDK_KEY_F5,		0,			"ViewReload",		 FALSE },
 	{ GDK_KEY_F5,		GDK_CONTROL_MASK,	"ViewReload",		 FALSE },
@@ -444,7 +449,6 @@ struct _EphyWindowPrivate
 	GtkActionGroup *action_group;
 	GtkActionGroup *popups_action_group;
 	EphyEncodingMenu *enc_menu;
-	EphyTabsMenu *tabs_menu;
 	GtkNotebook *notebook;
 	EphyEmbed *active_embed;
 	EphyFindToolbar *find_toolbar;
@@ -2893,44 +2897,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
 	}
 }
 
-static void
-update_tabs_menu_sensitivity (EphyWindow *window)
-{
-	EphyWindowPrivate *priv = window->priv;
-	GtkActionGroup *action_group;
-	GtkAction *action;
-	GtkNotebook *notebook;
-	gboolean wrap_around;
-	int page, n_pages;
-	gboolean not_first, not_last;
-
-	notebook = GTK_NOTEBOOK (priv->notebook);
-	action_group = priv->action_group;
-	n_pages = gtk_notebook_get_n_pages (notebook);
-	page = gtk_notebook_get_current_page (notebook);
-	not_first = page > 0;
-	not_last = page + 1 < n_pages;
-
-	g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)),
-		      "gtk-keynav-wrap-around", &wrap_around,
-		      NULL);
-
-	if (!wrap_around)
-	{
-		action = gtk_action_group_get_action (action_group, "TabsPrevious");
-		gtk_action_set_sensitive (action, not_first);
-		action = gtk_action_group_get_action (action_group, "TabsNext");
-		gtk_action_set_sensitive (action, not_last);
-	}
-
-	action = gtk_action_group_get_action (action_group, "TabsMoveLeft");
-	gtk_action_set_sensitive (action, not_first);
-	action = gtk_action_group_get_action (action_group, "TabsMoveRight");
-	gtk_action_set_sensitive (action, not_last);
-	action = gtk_action_group_get_action (action_group, "TabsDetach");
-	ephy_action_change_sensitivity_flags (action, SENS_FLAG_CHROME, n_pages <= 1);
-}
-
 static gboolean
 embed_modal_alert_cb (EphyEmbed *embed,
 		      EphyWindow *window)
@@ -3107,8 +3073,6 @@ notebook_page_added_cb (EphyNotebook *notebook,
 
 	priv->num_tabs++;
 
-	update_tabs_menu_sensitivity (window);
-
 #if 0
 	g_signal_connect_object (embed, "open-link",
 				 G_CALLBACK (ephy_link_open), window,
@@ -3159,11 +3123,6 @@ notebook_page_removed_cb (EphyNotebook *notebook,
 
 	priv->num_tabs--;
 
-	if (priv->num_tabs > 0)
-	{
-		update_tabs_menu_sensitivity (window);
-	}
-
 	g_signal_handlers_disconnect_by_func
 		(ephy_embed_get_web_view (embed), G_CALLBACK (embed_modal_alert_cb), window);
 	g_signal_handlers_disconnect_by_func
@@ -3171,15 +3130,6 @@ notebook_page_removed_cb (EphyNotebook *notebook,
 }
 
 static void
-notebook_page_reordered_cb (EphyNotebook *notebook,
-			    EphyEmbed *embed,
-			    guint position,
-			    EphyWindow *window)
-{
-	update_tabs_menu_sensitivity (window);
-}
-
-static void
 notebook_page_close_request_cb (EphyNotebook *notebook,
 				EphyEmbed *embed,
 				EphyWindow *window)
@@ -3248,8 +3198,6 @@ setup_notebook (EphyWindow *window)
 			  G_CALLBACK (notebook_page_added_cb), window);
 	g_signal_connect (notebook, "page-removed",
 			  G_CALLBACK (notebook_page_removed_cb), window);
-	g_signal_connect (notebook, "page-reordered",
-			  G_CALLBACK (notebook_page_reordered_cb), window);
 	g_signal_connect (notebook, "tab-close-request",
 			  G_CALLBACK (notebook_page_close_request_cb), window);
 
@@ -3424,9 +3372,6 @@ ephy_window_dispose (GObject *object)
 		g_object_unref (priv->enc_menu);
 		priv->enc_menu = NULL;
 
-		g_object_unref (priv->tabs_menu);
-		priv->tabs_menu = NULL;
-
 		priv->action_group = NULL;
 		priv->popups_action_group = NULL;
 
@@ -3775,7 +3720,6 @@ ephy_window_constructor (GType type,
 	g_object_unref (css_file);
 
 	/* Initialize the menus */
-	priv->tabs_menu = ephy_tabs_menu_new (window);
 	priv->enc_menu = ephy_encoding_menu_new (window);
 
 	/* Add the toolbars to the window */
@@ -4178,9 +4122,6 @@ notebook_switch_page_cb (GtkNotebook *notebook,
 	ephy_window_set_active_tab (window, embed);
 
 	ephy_find_toolbar_set_embed (priv->find_toolbar, embed);
-
-	/* update window controls */
-	update_tabs_menu_sensitivity (window);
 }
 
 /**



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