diff options
author | Cosimo Cecchi <cosimoc@src.gnome.org> | 2007-12-08 09:21:52 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@src.gnome.org> | 2007-12-08 09:21:52 +0800 |
commit | 34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843 (patch) | |
tree | 6623976a56f582c32e21e841608542d690e594f8 /lib/widgets | |
parent | 54c4609eb6687162156907152a34e2f7c6f29e8c (diff) | |
download | gsoc2013-epiphany-34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843.tar gsoc2013-epiphany-34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843.tar.gz gsoc2013-epiphany-34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843.tar.bz2 gsoc2013-epiphany-34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843.tar.lz gsoc2013-epiphany-34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843.tar.xz gsoc2013-epiphany-34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843.tar.zst gsoc2013-epiphany-34b80c1f8b7baf32d4cdb15c9f9b27a9a7db1843.zip |
Add "node-middle-clicked" signal to EphyNodeView.
Part of bug #385037.
svn path=/trunk/; revision=7762
Diffstat (limited to 'lib/widgets')
-rw-r--r-- | lib/widgets/ephy-node-view.c | 37 | ||||
-rw-r--r-- | lib/widgets/ephy-node-view.h | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index c01ec6ec1..3ef405619 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -90,6 +90,7 @@ enum NODE_ACTIVATED, NODE_SELECTED, NODE_DROPPED, + NODE_MIDDLE_CLICKED, LAST_SIGNAL }; @@ -573,6 +574,24 @@ path_toggled (GtkTreeModel *dummy_model, GtkTreePath *path, node, checked); } +static EphyNode * +process_middle_click (GtkTreePath *path, + EphyNodeView *view) +{ + EphyNode *node; + GtkTreeIter iter, iter2; + + gtk_tree_model_get_iter (view->priv->sortmodel, &iter, path); + gtk_tree_model_sort_convert_iter_to_child_iter + (GTK_TREE_MODEL_SORT (view->priv->sortmodel), &iter2, &iter); + gtk_tree_model_filter_convert_iter_to_child_iter + (GTK_TREE_MODEL_FILTER (view->priv->filtermodel), &iter, &iter2); + + node = ephy_tree_model_node_node_from_iter (view->priv->nodemodel, &iter); + + return node; +} + static gboolean ephy_node_view_key_press_cb (GtkTreeView *treeview, GdkEventKey *event, @@ -853,6 +872,14 @@ ephy_node_view_button_press_cb (GtkWidget *treeview, g_signal_emit_by_name (view, "popup_menu", &retval); } + else if (event->button == 2) + { + EphyNode *clicked_node; + + clicked_node = process_middle_click (path, view); + g_signal_emit (G_OBJECT (view), + ephy_node_view_signals[NODE_MIDDLE_CLICKED], 0, clicked_node); + } else if (event->button == 1) { if (view->priv->toggle_column >= 0) @@ -1724,6 +1751,16 @@ ephy_node_view_class_init (EphyNodeViewClass *klass) 2, G_TYPE_POINTER, G_TYPE_POINTER); + ephy_node_view_signals[NODE_MIDDLE_CLICKED] = + g_signal_new ("node_middle_clicked", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EphyNodeViewClass, node_middle_clicked), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); g_type_class_add_private (object_class, sizeof (EphyNodeViewPrivate)); } diff --git a/lib/widgets/ephy-node-view.h b/lib/widgets/ephy-node-view.h index b16c2f428..1d27a5e19 100644 --- a/lib/widgets/ephy-node-view.h +++ b/lib/widgets/ephy-node-view.h @@ -70,6 +70,7 @@ typedef struct void (*node_activated) (EphyNodeView *view, EphyNode *node); void (*node_selected) (EphyNodeView *view, EphyNode *node); void (*node_dropped) (EphyNodeView *view, EphyNode *node, GList *uris); + void (*node_middle_clicked) (EphyNodeView *view, EphyNode *node); } EphyNodeViewClass; GType ephy_node_view_get_type (void); |