Add Undo close tab to the tab context menu

It is very useful and some people who rarely use the page
context menu will look for it in the tab menu.
This commit is contained in:
Christian Dywan 2009-10-22 22:54:52 +02:00
parent 6ff3e3a17d
commit 4257bd2bbc

View file

@ -3224,13 +3224,6 @@ midori_view_get_proxy_menu_item (MidoriView* view)
return view->menu_item; return view->menu_item;
} }
static void
midori_view_tab_label_menu_new_tab_cb (GtkWidget* menuitem,
MidoriView* view)
{
g_signal_emit (view, signals[NEW_TAB], 0, "", FALSE);
}
static void static void
midori_view_tab_label_menu_open_cb (GtkWidget* menuitem, midori_view_tab_label_menu_open_cb (GtkWidget* menuitem,
GtkWidget* view) GtkWidget* view)
@ -3288,16 +3281,23 @@ midori_view_tab_label_menu_close_cb (GtkWidget* menuitem,
GtkWidget* GtkWidget*
midori_view_get_tab_menu (MidoriView* view) midori_view_get_tab_menu (MidoriView* view)
{ {
MidoriBrowser* browser;
GtkActionGroup* actions;
GtkWidget* menu; GtkWidget* menu;
GtkWidget* menuitem; GtkWidget* menuitem;
g_return_val_if_fail (MIDORI_IS_VIEW (view), NULL); g_return_val_if_fail (MIDORI_IS_VIEW (view), NULL);
browser = midori_browser_get_for_widget (GTK_WIDGET (view));
actions = midori_browser_get_action_group (browser);
menu = gtk_menu_new (); menu = gtk_menu_new ();
menuitem = gtk_menu_item_new_with_mnemonic (_("New _Tab")); menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "TabNew"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "UndoTabClose"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
g_signal_connect (menuitem, "activate",
G_CALLBACK (midori_view_tab_label_menu_new_tab_cb), view);
menuitem = gtk_separator_menu_item_new (); menuitem = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_OPEN, NULL); menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_OPEN, NULL);