[Xfce4-commits] <midori:master> Add 'Open in New Window' to page context menu

Christian Dywan noreply at xfce.org
Mon Jun 21 22:26:01 CEST 2010


Updating branch refs/heads/master
         to bc6849494d4c95c8a00d55afc8951c5feb375001 (commit)
       from 63f754948031a8101d43d08909cc74a4b5ca3a0a (commit)

commit bc6849494d4c95c8a00d55afc8951c5feb375001
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Jun 21 21:24:01 2010 +0200

    Add 'Open in New Window' to page context menu
    
    While we're at it, the label of the according tab menu item
    should be the same.

 midori/midori-view.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 40352d9..a889492 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1939,6 +1939,14 @@ midori_web_view_menu_download_activate_cb (GtkWidget*  widget,
     sokoke_spawn_program (view->download_manager, view->link_uri, FALSE);
 }
 
+static void
+midori_view_tab_label_menu_window_new_cb (GtkWidget* menuitem,
+                                          GtkWidget* view)
+{
+    g_signal_emit (view, signals[NEW_WINDOW], 0,
+        midori_view_get_display_uri (MIDORI_VIEW (view)));
+}
+
 #if WEBKIT_CHECK_VERSION (1, 1, 17)
 static void
 midori_web_view_menu_inspect_element_activate_cb (GtkWidget*  widget,
@@ -2410,8 +2418,13 @@ midori_view_populate_popup (MidoriView* view,
 
         gtk_menu_shell_append (menu_shell, gtk_separator_menu_item_new ());
         menuitem = sokoke_action_create_popup_menu_item (
-                gtk_action_group_get_action (actions, "UndoTabClose"));
+            gtk_action_group_get_action (actions, "UndoTabClose"));
         gtk_menu_shell_append (menu_shell, menuitem);
+        menuitem = gtk_image_menu_item_new_from_stock (STOCK_WINDOW_NEW, NULL);
+        gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), _("Open in New _Window"));
+        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+        g_signal_connect (menuitem, "activate",
+            G_CALLBACK (midori_view_tab_label_menu_window_new_cb), view);
 
         #if WEBKIT_CHECK_VERSION (1, 1, 15)
         /* if (webkit_web_view_get_main_frame (web_view) != frame_under_mouse)
@@ -4004,13 +4017,6 @@ midori_view_tab_label_menu_open_cb (GtkWidget* menuitem,
     midori_browser_set_current_tab (browser, view);
 }
 
-static void
-midori_view_tab_label_menu_window_new_cb (GtkWidget* menuitem,
-                                          GtkWidget* view)
-{
-    g_signal_emit (view, signals[NEW_WINDOW], 0,
-        midori_view_get_display_uri (MIDORI_VIEW (view)));
-}
 
 static void
 midori_view_tab_label_menu_duplicate_tab_cb (GtkWidget*  menuitem,
@@ -4094,6 +4100,7 @@ midori_view_get_tab_menu (MidoriView* view)
     g_signal_connect (menuitem, "activate",
         G_CALLBACK (midori_view_tab_label_menu_open_cb), view);
     menuitem = gtk_image_menu_item_new_from_stock (STOCK_WINDOW_NEW, NULL);
+    gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), _("Open in New _Window"));
     gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
     g_signal_connect (menuitem, "activate",
         G_CALLBACK (midori_view_tab_label_menu_window_new_cb), view);



More information about the Xfce4-commits mailing list