diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-03-26 03:53:58 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-03-26 03:53:58 +0800 |
commit | b3320ef7127e9fa0ca93c6c024466e1e1f0ae1c7 (patch) | |
tree | 2db543911c8a7d013d10f3475e3eab6135f9b8f6 /lib/widgets/ephy-tree-model-sort.c | |
parent | 4a0747542c21fa5660cbf09d4b3aca5520ef8ca9 (diff) | |
download | gsoc2013-epiphany-b3320ef7127e9fa0ca93c6c024466e1e1f0ae1c7.tar.gz gsoc2013-epiphany-b3320ef7127e9fa0ca93c6c024466e1e1f0ae1c7.tar.zst gsoc2013-epiphany-b3320ef7127e9fa0ca93c6c024466e1e1f0ae1c7.zip |
Make ids private
2003-03-25 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/ephy-dnd.c:
* lib/ephy-dnd.h:
Make ids private
* lib/widgets/ephy-editable-toolbar.c: (impl_get_action_name),
(impl_get_action), (drag_data_received_cb), (setup_toolbar),
(setup_item), (ensure_action), (ephy_editable_toolbar_class_init),
(update_editor_sheet), (ephy_editable_toolbar_get_action_name),
(ephy_editable_toolbar_get_action):
* lib/widgets/ephy-editable-toolbar.h:
Rework special actions api.
* lib/widgets/ephy-tree-model-sort.c: (ephy_tree_model_sort_init),
(ephy_tree_model_sort_set_drag_property),
(each_url_get_data_binder),
(ephy_tree_model_sort_multi_drag_data_get):
* lib/widgets/ephy-tree-model-sort.h:
Support nodes dnd. Need more work, see FIXME
* src/bookmarks/Makefile.am:
* src/bookmarks/ephy-bookmarks-editor.c:
(ephy_bookmarks_editor_construct):
* src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_init),
(ephy_bookmarks_finalize), (ephy_bookmarks_find_keyword):
* src/bookmarks/ephy-node-view.c:
(ephy_node_view_enable_drag_source):
* src/bookmarks/ephy-node-view.h:
* src/history-dialog.c: (history_dialog_setup_view):
* src/toolbar.c: (toolbar_get_action_name), (toolbar_get_action),
(toolbar_class_init):
Support for topics dnd. The menu is still not implemented
but the hard part is done. Cant finish it until the weekend :/
Diffstat (limited to 'lib/widgets/ephy-tree-model-sort.c')
-rw-r--r-- | lib/widgets/ephy-tree-model-sort.c | 54 |
1 files changed, 47 insertions, 7 deletions
diff --git a/lib/widgets/ephy-tree-model-sort.c b/lib/widgets/ephy-tree-model-sort.c index 3c2377cf0..41369afd9 100644 --- a/lib/widgets/ephy-tree-model-sort.c +++ b/lib/widgets/ephy-tree-model-sort.c @@ -26,6 +26,7 @@ #include "eggtreemultidnd.h" #include "ephy-dnd.h" #include "ephy-marshal.h" +#include "ephy-debug.h" static void ephy_tree_model_sort_class_init (EphyTreeModelSortClass *klass); static void ephy_tree_model_sort_init (EphyTreeModelSort *ma); @@ -43,6 +44,7 @@ static gboolean ephy_tree_model_sort_multi_drag_data_delete (EggTreeMultiDragSou struct EphyTreeModelSortPrivate { char *str_list; + guint drag_property_id; }; enum @@ -119,6 +121,8 @@ static void ephy_tree_model_sort_init (EphyTreeModelSort *ma) { ma->priv = g_new0 (EphyTreeModelSortPrivate, 1); + + ma->priv->drag_property_id = -1; } static void @@ -185,6 +189,13 @@ ephy_tree_model_sort_multi_row_draggable (EggTreeMultiDragSource *drag_source, G return TRUE; } +void +ephy_tree_model_sort_set_drag_property (EphyTreeModelSort *ms, + guint id) +{ + ms->priv->drag_property_id = id; +} + static gboolean ephy_tree_model_sort_multi_drag_data_delete (EggTreeMultiDragSource *drag_source, GList *path_list) @@ -216,8 +227,10 @@ each_url_get_data_binder (EphyDragEachSelectedItemDataGet iteratee, if (node == NULL) return; - value = ephy_node_get_property_string (node, - EPHY_DND_NODE_PROPERTY); + value = ephy_node_get_property_string + (node, EPHY_TREE_MODEL_SORT (model)->priv->drag_property_id); + + LOG ("Data get %s", value) iteratee (value, -1, -1, -1, -1, data); } @@ -228,13 +241,40 @@ ephy_tree_model_sort_multi_drag_data_get (EggTreeMultiDragSource *drag_source, GList *path_list, guint info, GtkSelectionData *selection_data) -{ gpointer icontext[2]; +{ + EphyTreeModelSort *ms = EPHY_TREE_MODEL_SORT (drag_source); - icontext[0] = path_list; - icontext[1] = drag_source; + /* FIXME use the target type here, not property_id */ - ephy_dnd_drag_data_get (NULL, NULL, selection_data, - info, 0, &icontext, each_url_get_data_binder); + if (ms->priv->drag_property_id != -1) + { + gpointer icontext[2]; + + icontext[0] = path_list; + icontext[1] = drag_source; + + ephy_dnd_drag_data_get (NULL, NULL, selection_data, + info, 0, &icontext, each_url_get_data_binder); + } + else + { + GtkTreeIter iter; + GtkTreePath *path = gtk_tree_row_reference_get_path (path_list->data); + EphyNode *node = NULL; + char *data; + + gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path); + g_signal_emit (G_OBJECT (drag_source), + ephy_tree_model_sort_signals[NODE_FROM_ITER], + 0, &iter, &node); + + /* FIXME free */ + data = g_strdup_printf ("%ld", ephy_node_get_id (node)); + + gtk_selection_data_set (selection_data, + selection_data->target, + 8, data, strlen (data)); + } return TRUE; } |