diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-07-11 04:57:14 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-07-11 04:57:14 +0800 |
commit | 39e1b868fe021ab8fe04ade6774d04ed87c05a81 (patch) | |
tree | bd87552b218755815cc17acda43c3513ef316d2f /lib/widgets | |
parent | b6ccb049d514886311520d3c16c8b592dfcde3a3 (diff) | |
download | gsoc2013-epiphany-39e1b868fe021ab8fe04ade6774d04ed87c05a81.tar gsoc2013-epiphany-39e1b868fe021ab8fe04ade6774d04ed87c05a81.tar.gz gsoc2013-epiphany-39e1b868fe021ab8fe04ade6774d04ed87c05a81.tar.bz2 gsoc2013-epiphany-39e1b868fe021ab8fe04ade6774d04ed87c05a81.tar.lz gsoc2013-epiphany-39e1b868fe021ab8fe04ade6774d04ed87c05a81.tar.xz gsoc2013-epiphany-39e1b868fe021ab8fe04ade6774d04ed87c05a81.tar.zst gsoc2013-epiphany-39e1b868fe021ab8fe04ade6774d04ed87c05a81.zip |
Implement a way to disallow dragging from resp. dropping on certain nodes.
2005-07-10 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-node-common.h:
* lib/ephy-node.c: (ephy_node_new_with_id),
(ephy_node_signal_disconnect), (ephy_node_set_is_drag_source),
(ephy_node_get_is_drag_source), (ephy_node_set_is_drag_dest),
(ephy_node_get_is_drag_dest):
* lib/ephy-node.h:
* lib/widgets/ephy-node-view.c: (drag_motion_cb),
(drag_data_received_cb):
Implement a way to disallow dragging from resp. dropping on certain
nodes.
* src/bookmarks/ephy-bookmarks-editor.c:
(ephy_bookmarks_editor_update_menu):
* src/bookmarks/ephy-bookmarks.c: (save_filter),
(save_filter_local), (ephy_bookmarks_save),
(update_bookmark_keywords), (bookmark_is_categorized),
(resolve_cb), (browse_cb), (ephy_local_bookmarks_init),
(ephy_local_bookmarks_stop), (ephy_bookmarks_init),
(ephy_bookmarks_finalize), (ephy_bookmarks_get_topic_uri),
(ephy_bookmarks_find_keyword), (ephy_bookmarks_get_favorites),
(ephy_bookmarks_get_local):
* src/bookmarks/ephy-bookmarks.h:
Implement "Local Sites" topic, filled with zeroconf-discovered
bookmarks. Patch by Bastien Nocera, fixes bug #144969.
Diffstat (limited to 'lib/widgets')
-rw-r--r-- | lib/widgets/ephy-node-view.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index 668ac4ba6..23cc2fc60 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -309,7 +309,8 @@ drag_motion_cb (GtkWidget *widget, (node, view->priv->priority_prop_id); if (priority != EPHY_NODE_VIEW_ALL_PRIORITY && - priority != EPHY_NODE_VIEW_SPECIAL_PRIORITY) + priority != EPHY_NODE_VIEW_SPECIAL_PRIORITY && + ephy_node_get_is_drag_source (node)) { action = context->suggested_action; } @@ -374,6 +375,10 @@ drag_data_received_cb (GtkWidget *widget, return; } + /* appease GtkTreeView by preventing its drag_data_receive + * from being called */ + g_signal_stop_emission_by_name (view, "drag_data_received"); + if (!view->priv->have_drag_data) { view->priv->have_drag_data = TRUE; @@ -388,16 +393,18 @@ drag_data_received_cb (GtkWidget *widget, gboolean success = FALSE; GtkTreePath *path; - gtk_tree_view_get_dest_row_at_pos - (GTK_TREE_VIEW (widget), x, y, &path, &pos); - - g_return_if_fail (path != NULL); + if (gtk_tree_view_get_dest_row_at_pos + (GTK_TREE_VIEW (widget), x, y, &path, &pos) == FALSE) + { + return; + } node = get_node_from_path (view, path); + if (node == NULL) return; uris = gtk_selection_data_get_uris (selection_data); - if (uris != NULL) + if (uris != NULL && ephy_node_get_is_drag_dest (node)) { /* FIXME fill success */ g_signal_emit (G_OBJECT (view), @@ -416,12 +423,6 @@ drag_data_received_cb (GtkWidget *widget, gtk_tree_path_free (path); } } - - - /* appease GtkTreeView by preventing its drag_data_receive - * from being called */ - g_signal_stop_emission_by_name (GTK_TREE_VIEW (view), - "drag_data_received"); } static gboolean |