[epiphany] ephy-history-view: open pages in a new tab on middle click



commit f4ed0fb98f033727eb22f62ddb3ba60424c8cc91
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Thu Mar 8 12:00:56 2012 +0200

    ephy-history-view: open pages in a new tab on middle click
    
    This was present in the old EphyNodeView history. Bring it back.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671635

 src/ephy-history-window.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 228c61e..0601278 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -576,26 +576,23 @@ ephy_history_window_row_activated_cb (GtkTreeView *view,
 	ephy_history_url_free (url);
 }
 
-#if 0
 static void
-ephy_history_window_node_middle_clicked_cb (GtkWidget *view,
-					    EphyNode *node,
-					    EphyHistoryWindow *editor)
+ephy_history_window_row_middle_clicked_cb (EphyHistoryView *view,
+					   GtkTreePath *path,
+					   EphyHistoryWindow *editor)
 {
 	EphyWindow *window;
-	const char *location;
+	EphyHistoryURL *url;
 
 	window = EPHY_WINDOW (get_target_window (editor));
+	url = ephy_urls_store_get_url_from_path (editor->priv->urls_store, path);
+	g_return_if_fail (url != NULL);
 
-	location = ephy_node_get_property_string
-		(node, EPHY_NODE_PAGE_PROP_LOCATION);
-	g_return_if_fail (location != NULL);
-
-	ephy_shell_new_tab (ephy_shell, window, NULL, location,
+	ephy_shell_new_tab (ephy_shell, window, NULL, url->url,
 			    EPHY_NEW_TAB_OPEN_PAGE |
 			    EPHY_NEW_TAB_IN_EXISTING_WINDOW);
+	ephy_history_url_free (url);
 }
-#endif
 
 static void
 ephy_history_window_update_menu (EphyHistoryWindow *editor)
@@ -1270,6 +1267,9 @@ ephy_history_window_constructed (GObject *object)
 			  "row-activated",
 			  G_CALLBACK (ephy_history_window_row_activated_cb),
 			  editor);
+	g_signal_connect (pages_view, "row-middle-clicked",
+			  G_CALLBACK (ephy_history_window_row_middle_clicked_cb),
+			  editor);
 	g_signal_connect (G_OBJECT (pages_view),
 			  "popup_menu",
 			  G_CALLBACK (ephy_history_window_show_popup_cb),



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