aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-editor.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-17 20:59:52 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-17 20:59:52 +0800
commit609b92cfa632385313d1d2421b516bdb41fdbf00 (patch)
tree09fc963d624f5723fc75551eb125b3d7d825f795 /src/bookmarks/ephy-bookmarks-editor.c
parent9e94d5208ee7d936c6d3595435b9364fec5850dd (diff)
downloadgsoc2013-epiphany-609b92cfa632385313d1d2421b516bdb41fdbf00.tar
gsoc2013-epiphany-609b92cfa632385313d1d2421b516bdb41fdbf00.tar.gz
gsoc2013-epiphany-609b92cfa632385313d1d2421b516bdb41fdbf00.tar.bz2
gsoc2013-epiphany-609b92cfa632385313d1d2421b516bdb41fdbf00.tar.lz
gsoc2013-epiphany-609b92cfa632385313d1d2421b516bdb41fdbf00.tar.xz
gsoc2013-epiphany-609b92cfa632385313d1d2421b516bdb41fdbf00.tar.zst
gsoc2013-epiphany-609b92cfa632385313d1d2421b516bdb41fdbf00.zip
New abstracted implementations. Nicer and will be useful for history
2003-04-17 Marco Pesenti Gritti <marco@it.gnome.org> * lib/widgets/Makefile.am: * lib/widgets/ephy-node-view.c: * lib/widgets/ephy-node-view.h: * lib/widgets/ephy-tree-model-node.c: * lib/widgets/ephy-tree-model-node.h: New abstracted implementations. Nicer and will be useful for history dialog interface rehash to make it more consistent with bookmarks (this was the hard part of the work). * src/bookmarks/Makefile.am: * src/bookmarks/ephy-bookmarks-editor.c: Use them. * src/history-dialog.c: Temp hack to keep the thing building until I actually rewrite history dialog. 2
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c52
1 files changed, 40 insertions, 12 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index b9782120f..25fd53357 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -44,6 +44,7 @@
#include "popup-commands.h"
#include "ephy-state.h"
#include "window-commands.h"
+#include "ephy-debug.h"
static GtkTargetEntry topic_drag_dest_types [] =
{
@@ -118,6 +119,7 @@ struct EphyBookmarksEditorPrivate
GtkWidget *window;
EggMenuMerge *ui_merge;
EggActionGroup *action_group;
+ int priority_col;
};
enum
@@ -532,12 +534,12 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
if (key_focus && selected)
{
EphyNode *node = EPHY_NODE (selected->data);
- EphyBookmarksKeywordPriority priority;;
+ EphyNodeViewPriority priority;;
priority = ephy_node_get_property_int
(node, EPHY_NODE_KEYWORD_PROP_PRIORITY);
- if (priority == -1) priority = EPHY_BOOKMARKS_KEYWORD_NORMAL_PRIORITY;
- key_normal = (priority == EPHY_BOOKMARKS_KEYWORD_NORMAL_PRIORITY);
+ if (priority == -1) priority = EPHY_NODE_VIEW_NORMAL_PRIORITY;
+ key_normal = (priority == EPHY_NODE_VIEW_NORMAL_PRIORITY);
g_list_free (selected);
}
@@ -828,6 +830,28 @@ menu_activate_cb (EphyNodeView *view,
}
static void
+provide_favicon (EphyNode *node, GValue *value, gpointer user_data)
+{
+ EphyFaviconCache *cache;
+ const char *icon_location;
+ GdkPixbuf *pixbuf = NULL;
+
+ cache = ephy_embed_shell_get_favicon_cache (EPHY_EMBED_SHELL (ephy_shell));
+ icon_location = ephy_node_get_property_string
+ (node, EPHY_NODE_BMK_PROP_ICON);
+
+ LOG ("Get favicon for %s", icon_location ? icon_location : "None")
+
+ if (icon_location)
+ {
+ pixbuf = ephy_favicon_cache_get (cache, icon_location);
+ }
+
+ g_value_init (value, GDK_TYPE_PIXBUF);
+ g_value_set_object (value, pixbuf);
+}
+
+static void
ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
{
GtkTreeSelection *selection;
@@ -913,12 +937,15 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
n_topic_drag_types,
-1);
ephy_node_view_enable_drag_dest (EPHY_NODE_VIEW (key_view),
- topic_drag_dest_types,
- n_topic_drag_dest_types);
+ topic_drag_dest_types,
+ n_topic_drag_dest_types);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (key_view));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
ephy_node_view_add_column (EPHY_NODE_VIEW (key_view), _("Topics"),
- EPHY_TREE_MODEL_NODE_COL_KEYWORD, TRUE, TRUE);
+ G_TYPE_STRING,
+ EPHY_NODE_KEYWORD_PROP_NAME,
+ EPHY_NODE_KEYWORD_PROP_PRIORITY,
+ TRUE, TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_window), key_view);
gtk_widget_set_size_request (key_view, 130, -1);
gtk_widget_show (key_view);
@@ -932,13 +959,13 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
G_CALLBACK (keyword_node_selected_cb),
editor);
g_signal_connect (G_OBJECT (key_view),
- "show_popup",
- G_CALLBACK (keyword_node_show_popup_cb),
- editor);
- g_signal_connect (G_OBJECT (key_view),
"node_dropped",
G_CALLBACK (node_dropped_cb),
editor);
+ g_signal_connect (G_OBJECT (key_view),
+ "show_popup",
+ G_CALLBACK (keyword_node_show_popup_cb),
+ editor);
vbox = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (hbox),
@@ -969,9 +996,10 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
bmk_drag_types,
n_bmk_drag_types,
EPHY_NODE_BMK_PROP_LOCATION);
- ephy_node_view_add_icon_column (EPHY_NODE_VIEW (bm_view), EPHY_TREE_MODEL_NODE_COL_ICON);
+ ephy_node_view_add_icon_column (EPHY_NODE_VIEW (bm_view), provide_favicon);
ephy_node_view_add_column (EPHY_NODE_VIEW (bm_view), _("Title"),
- EPHY_TREE_MODEL_NODE_COL_BOOKMARK, TRUE, TRUE);
+ G_TYPE_STRING, EPHY_NODE_BMK_PROP_TITLE,
+ -1, TRUE, TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_window), bm_view);
gtk_widget_show (bm_view);
editor->priv->bm_view = bm_view;