aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorJorn Baayen <jbaayen@gnome.org>2005-01-22 03:33:03 +0800
committerJorn Baayen <jbaayen@src.gnome.org>2005-01-22 03:33:03 +0800
commit549171e9af818b784548fc2bed4bd375006b7adc (patch)
tree5a3e639a8fe9f2175adde95c9e60ae77a76a8016 /src/bookmarks
parent39f7d93acea222b6b3e1cd53875ac16f5cbdea4f (diff)
downloadgsoc2013-epiphany-549171e9af818b784548fc2bed4bd375006b7adc.tar
gsoc2013-epiphany-549171e9af818b784548fc2bed4bd375006b7adc.tar.gz
gsoc2013-epiphany-549171e9af818b784548fc2bed4bd375006b7adc.tar.bz2
gsoc2013-epiphany-549171e9af818b784548fc2bed4bd375006b7adc.tar.lz
gsoc2013-epiphany-549171e9af818b784548fc2bed4bd375006b7adc.tar.xz
gsoc2013-epiphany-549171e9af818b784548fc2bed4bd375006b7adc.tar.zst
gsoc2013-epiphany-549171e9af818b784548fc2bed4bd375006b7adc.zip
Add proper _NETSCAPE_URL drag support, supplying the URL as well as the
2005-01-21 Jorn Baayen <jbaayen@gnome.org> * lib/widgets/ephy-node-view.c: (ephy_node_view_add_column), (ephy_node_view_enable_drag_source): * lib/widgets/ephy-node-view.h: * lib/widgets/ephy-tree-model-sort.c: (ephy_tree_model_sort_init), (ephy_tree_model_sort_multi_row_draggable), (ephy_tree_model_sort_set_base_drag_column_id), (ephy_tree_model_sort_set_extra_drag_column_id), (each_property_get_data_binder): * lib/widgets/ephy-tree-model-sort.h: * src/bookmarks/ephy-bookmark-action.c: (drag_data_get_cb): * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_construct): * src/bookmarks/ephy-topics-selector.c: (ephy_topics_selector_constructor): * src/ephy-encoding-dialog.c: (ephy_encoding_dialog_init): * src/ephy-history-window.c: (ephy_history_window_construct): Add proper _NETSCAPE_URL drag support, supplying the URL as well as the title. As a side effect most data_columns in NodeViews have been obsoleted. Fixes #163937.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c11
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c37
-rw-r--r--src/bookmarks/ephy-topics-selector.c2
3 files changed, 27 insertions, 23 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index f219853d6..876c386f4 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -402,7 +402,8 @@ drag_data_get_cb (GtkWidget *widget, GdkDragContext *context,
GtkSelectionData *selection_data, guint info,
guint32 time, EphyBookmarkAction *action)
{
- const char *address;
+ const char *address, *title;
+ char *data;
g_return_if_fail (action->priv->node != NULL);
@@ -410,8 +411,14 @@ drag_data_get_cb (GtkWidget *widget, GdkDragContext *context,
EPHY_NODE_BMK_PROP_LOCATION);
g_return_if_fail (address != NULL);
+ title = ephy_node_get_property_string (action->priv->node,
+ EPHY_NODE_BMK_PROP_TITLE);
+ g_return_if_fail (title != NULL);
+
+ data = g_strdup_printf ("%s\n%s", address, title);
gtk_selection_data_set (selection_data, selection_data->target, 8,
- (unsigned char *) address, strlen (address));
+ (unsigned char *) data, strlen (data));
+ g_free (data);
}
static int
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 550212608..4bc02e83d 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -1575,7 +1575,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
EphyNode *node;
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
- int col_id, details_value;
+ int col_id, url_col_id, title_col_id, details_value;
ephy_gui_ensure_window_group (GTK_WINDOW (editor));
@@ -1645,9 +1645,16 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
col_id = ephy_node_view_add_data_column (EPHY_NODE_VIEW (key_view),
G_TYPE_STRING, -1,
provide_keyword_uri, editor);
+ ephy_node_view_add_column (EPHY_NODE_VIEW (key_view), _("Topics"),
+ G_TYPE_STRING,
+ EPHY_NODE_KEYWORD_PROP_NAME,
+ EPHY_NODE_VIEW_SHOW_PRIORITY |
+ EPHY_NODE_VIEW_EDITABLE |
+ EPHY_NODE_VIEW_SEARCHABLE, NULL, NULL);
ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (key_view),
topic_drag_types,
- n_topic_drag_types, col_id);
+ n_topic_drag_types,
+ col_id, -1);
ephy_node_view_enable_drag_dest (EPHY_NODE_VIEW (key_view),
topic_drag_dest_types,
n_topic_drag_dest_types);
@@ -1657,12 +1664,6 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
"changed",
G_CALLBACK (view_selection_changed_cb),
editor);
- ephy_node_view_add_column (EPHY_NODE_VIEW (key_view), _("Topics"),
- G_TYPE_STRING,
- EPHY_NODE_KEYWORD_PROP_NAME,
- EPHY_NODE_VIEW_SHOW_PRIORITY |
- EPHY_NODE_VIEW_EDITABLE |
- EPHY_NODE_VIEW_SEARCHABLE, NULL);
ephy_node_view_set_priority (EPHY_NODE_VIEW (key_view),
EPHY_NODE_KEYWORD_PROP_PRIORITY);
ephy_node_view_set_sort (EPHY_NODE_VIEW (key_view), G_TYPE_STRING,
@@ -1713,24 +1714,20 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
/* Bookmarks View */
bm_view = ephy_node_view_new (node, editor->priv->bookmarks_filter);
add_focus_monitor (editor, bm_view);
- col_id = ephy_node_view_add_data_column (EPHY_NODE_VIEW (bm_view),
- G_TYPE_STRING,
- EPHY_NODE_BMK_PROP_LOCATION,
- NULL, NULL);
- ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (bm_view),
- bmk_drag_types,
- n_bmk_drag_types,
- col_id);
- editor->priv->title_col = ephy_node_view_add_column
+ title_col_id = ephy_node_view_add_column
(EPHY_NODE_VIEW (bm_view), _("Title"),
G_TYPE_STRING, EPHY_NODE_BMK_PROP_TITLE,
EPHY_NODE_VIEW_EDITABLE |
EPHY_NODE_VIEW_SEARCHABLE,
- provide_favicon);
- editor->priv->address_col = ephy_node_view_add_column
+ provide_favicon, &(editor->priv->title_col));
+ url_col_id = ephy_node_view_add_column
(EPHY_NODE_VIEW (bm_view), _("Address"),
G_TYPE_STRING, EPHY_NODE_BMK_PROP_LOCATION,
- 0, NULL);
+ 0, NULL, &(editor->priv->address_col));
+ ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (bm_view),
+ bmk_drag_types,
+ n_bmk_drag_types,
+ url_col_id, title_col_id);
ephy_node_view_set_sort (EPHY_NODE_VIEW (bm_view), G_TYPE_STRING,
EPHY_NODE_BMK_PROP_TITLE, GTK_SORT_ASCENDING);
gtk_container_add (GTK_CONTAINER (scrolled_window), bm_view);
diff --git a/src/bookmarks/ephy-topics-selector.c b/src/bookmarks/ephy-topics-selector.c
index 6e16946ab..57cee2cd0 100644
--- a/src/bookmarks/ephy-topics-selector.c
+++ b/src/bookmarks/ephy-topics-selector.c
@@ -200,7 +200,7 @@ ephy_topics_selector_constructor (GType type,
EPHY_NODE_KEYWORD_PROP_NAME,
EPHY_NODE_VIEW_SHOW_PRIORITY |
EPHY_NODE_VIEW_EDITABLE |
- EPHY_NODE_VIEW_SEARCHABLE, NULL);
+ EPHY_NODE_VIEW_SEARCHABLE, NULL, NULL);
ephy_node_view_set_sort (EPHY_NODE_VIEW (selector), G_TYPE_STRING,
EPHY_NODE_KEYWORD_PROP_NAME, GTK_SORT_ASCENDING);