aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Harvey <peter.a.harvey@gmail.com>2006-02-02 22:01:38 +0800
committerPeter Anthony Harvey <paharvey@src.gnome.org>2006-02-02 22:01:38 +0800
commit42396674cbe534a6e5d0ca0bf232872179a306a2 (patch)
tree38a36efe8b432568e79c3eda6f2704e00818b0cd
parent4d8b2c6114da0d8b629215a2ca690411d1d71949 (diff)
downloadgsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar
gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.gz
gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.bz2
gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.lz
gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.xz
gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.zst
gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.zip
src/bookmarks/ephy-bookmark-action.c
2006-02-02 Peter Harvey <peter.a.harvey@gmail.com> * src/bookmarks/ephy-bookmark-action.c Allow bookmarks on the toolbar to be dragged. * src/bookmarks/ephy-topic-action.c Remove redundant function call.
-rw-r--r--ChangeLog10
-rw-r--r--src/bookmarks/ephy-bookmark-action.c25
-rw-r--r--src/bookmarks/ephy-topic-action.c1
3 files changed, 35 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a799db847..fdfeb06ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-02-02 Peter Harvey <peter.a.harvey@gmail.com>
+
+ * src/bookmarks/ephy-bookmark-action.c
+
+ Allow bookmarks on the toolbar to be dragged.
+
+ * src/bookmarks/ephy-topic-action.c
+
+ Remove redundant function call.
+
2006-02-02 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-session.c: (save_yourself_cb), (die_cb),
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 55ef0ac71..11fd985e8 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -31,6 +31,7 @@
#include "ephy-shell.h"
#include "ephy-gui.h"
#include "ephy-debug.h"
+#include "ephy-dnd.h"
#include <glib/gi18n.h>
#include <gtk/gtkwidget.h>
@@ -49,6 +50,10 @@
#include <string.h>
+static const GtkTargetEntry drag_types[] = {
+ {EPHY_DND_URL_TYPE, 0, 0},
+};
+
/* FIXME tweak this, or make it configurable? (bug 148093) */
#define ENTRY_WIDTH_CHARS 12
#define TOOLITEM_WIDTH_CHARS 20
@@ -414,6 +419,21 @@ button_release_cb (GtkWidget *widget,
return FALSE;
}
+static void
+drag_data_get_cb (GtkWidget *widget,
+ GdkDragContext *context,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint32 time,
+ GtkAction *action)
+{
+ EphyNode *node = ephy_bookmark_action_get_bookmark (EPHY_BOOKMARK_ACTION (action));
+ const char *location = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_LOCATION);
+
+ g_return_if_fail (location != NULL);
+
+ gtk_selection_data_set (selection_data, selection_data->target, 8, (unsigned char *)location, strlen (location));
+}
static void
connect_proxy (GtkAction *action, GtkWidget *proxy)
@@ -448,6 +468,11 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
entry = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "entry"));
g_signal_connect (entry, "activate", G_CALLBACK (activate_cb), action);
g_signal_connect (entry, "key-press-event", G_CALLBACK (entry_key_press_cb), action);
+
+ g_signal_connect (button, "drag-data-get",
+ G_CALLBACK (drag_data_get_cb), action);
+ gtk_drag_source_set (button, GDK_BUTTON1_MASK, drag_types,
+ G_N_ELEMENTS (drag_types), GDK_ACTION_COPY);
}
else if (GTK_IS_MENU_ITEM (proxy))
{
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c
index 97b5e3dbf..2ce6b5f7f 100644
--- a/src/bookmarks/ephy-topic-action.c
+++ b/src/bookmarks/ephy-topic-action.c
@@ -342,7 +342,6 @@ button_press_cb (GtkWidget *button,
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
- button_toggled_cb (button, action);
return TRUE;
}