[Xfce4-commits] <midori:master> Add Copy to the refactored context menu

Christian Dywan noreply at xfce.org
Fri Oct 2 21:32:02 CEST 2009


Updating branch refs/heads/master
         to a6ee2320e85fe9b34aa076dc14f52a8258fcc873 (commit)
       from e4b09739fa2cc9dbba3bcb5cb4d67af4d1caaf4d (commit)

commit a6ee2320e85fe9b34aa076dc14f52a8258fcc873
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Oct 1 23:56:05 2009 +0200

    Add Copy to the refactored context menu

 midori/midori-view.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 109769f..35bcb69 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1449,6 +1449,18 @@ midori_web_view_menu_search_web_activate_cb (GtkWidget*  widget,
     g_free (uri);
 }
 
+#if WEBKIT_CHECK_VERSION (1, 1, 15)
+static void
+midori_web_view_menu_copy_activate_cb (GtkWidget*  widget,
+                                       MidoriView* view)
+{
+    GdkDisplay* display = gtk_widget_get_display (widget);
+    GtkClipboard* clipboard = gtk_clipboard_get_for_display (display,
+        GDK_SELECTION_CLIPBOARD);
+    gtk_clipboard_set_text (clipboard, view->selected_text, -1);
+}
+#endif
+
 #if !WEBKIT_CHECK_VERSION (1, 1, 3)
 static void
 midori_web_view_menu_save_as_activate_cb (GtkWidget*  widget,
@@ -1758,6 +1770,10 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
         midori_view_insert_menu_item (menu_shell, 0,
             _("_Search the Web"), GTK_STOCK_FIND,
             G_CALLBACK (midori_web_view_menu_search_web_activate_cb), widget);
+        gtk_menu_shell_append (menu_shell, gtk_separator_menu_item_new ());
+        midori_view_insert_menu_item (menu_shell, -1,
+            NULL, GTK_STOCK_COPY,
+            G_CALLBACK (midori_web_view_menu_copy_activate_cb), widget);
         #else
         items = gtk_container_get_children (GTK_CONTAINER (menu));
         menuitem = (GtkWidget*)g_list_nth_data (items, 0);



More information about the Xfce4-commits mailing list