aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index a3ce4fdf5..5cbb6d232 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -23,6 +23,7 @@
#include <gtk/gtkstock.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkvbox.h>
+#include <gdk/gdkkeysyms.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
@@ -340,6 +341,22 @@ ephy_bookmarks_editor_show_popup_cb (GtkWidget *view,
}
static void
+ephy_bookmarks_editor_key_pressed_cb (GtkWidget *view,
+ GdkEventKey *event,
+ EphyBookmarksEditor *editor)
+{
+ switch (event->keyval)
+ {
+ case GDK_Delete:
+ ephy_node_view_remove (editor->priv->bm_view);
+ break;
+ default:
+ break;
+ }
+
+}
+
+static void
ephy_bookmarks_editor_node_activated_cb (GtkWidget *view,
EphyNode *node,
EphyBookmarksEditor *editor)
@@ -667,6 +684,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
g_assert (editor->priv->bookmarks);
node = ephy_bookmarks_get_keywords (editor->priv->bookmarks);
+
+ /* Keywords View */
key_view = ephy_node_view_new (node, NULL);
ephy_node_view_set_browse_mode (key_view);
ephy_node_view_add_column (key_view, _("Keywords"),
@@ -691,6 +710,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
node = ephy_bookmarks_get_bookmarks (editor->priv->bookmarks);
editor->priv->bookmarks_filter = ephy_node_filter_new ();
+
+ /* Bookmarks View */
bm_view = ephy_node_view_new (node, editor->priv->bookmarks_filter);
ephy_node_view_enable_drag_source (bm_view);
ephy_node_view_add_icon_column (bm_view, EPHY_TREE_MODEL_NODE_COL_ICON);
@@ -700,6 +721,10 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
gtk_widget_show (GTK_WIDGET (bm_view));
editor->priv->bm_view = bm_view;
g_signal_connect (G_OBJECT (bm_view),
+ "key_press_event",
+ G_CALLBACK (ephy_bookmarks_editor_key_pressed_cb),
+ editor);
+ g_signal_connect (G_OBJECT (bm_view),
"node_activated",
G_CALLBACK (ephy_bookmarks_editor_node_activated_cb),
editor);