[epiphany/overview-2: 9/9] Handle the "item-activated" signal in the overview



commit 14cbb02e3c7e2d3680b0bcb029cc52e8feddab0e
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Wed Jan 25 18:26:47 2012 +0200

    Handle the "item-activated" signal in the overview
    
    By opening the corresponding link
    
    https://bugzilla.gnome.org/show_bug.cgi?id=455173

 src/ephy-window.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index c447999..1970465 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2837,6 +2837,25 @@ setup_notebook (EphyWindow *window)
 }
 
 static void
+main_view_item_activated (GtkWidget *widget,
+			  gchar *id,
+			  GtkTreePath *path,
+			  EphyWindow *window)
+{
+	char *url;
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+
+	model = gd_main_view_get_model (GD_MAIN_VIEW (widget));
+	gtk_tree_model_get_iter (model, &iter, path);
+	gtk_tree_model_get (model, &iter,
+			    EPHY_OVERVIEW_STORE_URL, &url, -1);
+	ephy_link_open (EPHY_LINK (window), url, NULL,
+			ephy_link_flags_from_current_event ());
+	g_free (url);
+}
+
+static void
 setup_main_view (EphyWindow *window)
 {
 	EphyOverviewStore *store;
@@ -2845,6 +2864,8 @@ setup_main_view (EphyWindow *window)
 	store = g_object_new (EPHY_TYPE_OVERVIEW_STORE, NULL);
 	gd_main_view_set_model (GD_MAIN_VIEW (main_view),
 				GTK_TREE_MODEL (store));
+	g_signal_connect (main_view, "item-activated",
+			  G_CALLBACK (main_view_item_activated), window);
 }
 
 static void



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