aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-12-18 03:11:31 +0800
committerChristian Persch <chpe@src.gnome.org>2006-12-18 03:11:31 +0800
commit4e3a7f17f3720fc271ced8e5d04ddecddb21579f (patch)
tree9355c321ccf12cd60a48d93d82498dac0e484854 /src/ephy-notebook.c
parent7bb2d46bde7f24278f1eef01fc97854b870b948f (diff)
downloadgsoc2013-epiphany-4e3a7f17f3720fc271ced8e5d04ddecddb21579f.tar
gsoc2013-epiphany-4e3a7f17f3720fc271ced8e5d04ddecddb21579f.tar.gz
gsoc2013-epiphany-4e3a7f17f3720fc271ced8e5d04ddecddb21579f.tar.bz2
gsoc2013-epiphany-4e3a7f17f3720fc271ced8e5d04ddecddb21579f.tar.lz
gsoc2013-epiphany-4e3a7f17f3720fc271ced8e5d04ddecddb21579f.tar.xz
gsoc2013-epiphany-4e3a7f17f3720fc271ced8e5d04ddecddb21579f.tar.zst
gsoc2013-epiphany-4e3a7f17f3720fc271ced8e5d04ddecddb21579f.zip
Allow to drag plaintext to tabbar. Bug #339339, patch by Michael Hofmann.
2006-12-17 Christian Persch <chpe@cvs.gnome.org> * src/ephy-notebook.c: (notebook_drag_data_received_cb), (ephy_notebook_init), (build_tab_label): Allow to drag plaintext to tabbar. Bug #339339, patch by Michael Hofmann.
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index d2411b6f0..9a81fe962 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -441,7 +441,14 @@ notebook_drag_data_received_cb (GtkWidget* widget, GdkDragContext *context,
}
else
{
- g_return_if_reached ();
+ char *text;
+
+ text = (char *) gtk_selection_data_get_text (selection_data);
+ if (text != NULL) {
+ ephy_link_open (EPHY_LINK (notebook), text, tab,
+ tab ? 0 : EPHY_LINK_NEW_TAB);
+ g_free (text);
+ }
}
}
@@ -504,6 +511,7 @@ ephy_notebook_init (EphyNotebook *notebook)
GTK_DEST_DEFAULT_DROP,
url_drag_types, G_N_ELEMENTS (url_drag_types),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
+ gtk_drag_dest_add_text_targets (GTK_WIDGET(notebook));
notebook->priv->tabs_vis_notifier_id = eel_gconf_notification_add
(CONF_ALWAYS_SHOW_TABS_BAR,
@@ -688,6 +696,7 @@ build_tab_label (EphyNotebook *nb, EphyTab *tab)
gtk_drag_dest_set (hbox, GTK_DEST_DEFAULT_ALL,
url_drag_types, G_N_ELEMENTS (url_drag_types),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
+ gtk_drag_dest_add_text_targets (hbox);
gtk_widget_show (hbox);
gtk_widget_show (label_ebox);