aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-editor.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-29 16:50:19 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-29 16:50:19 +0800
commit56b18a72cbde121e7999846d99bb3e8eb91d4068 (patch)
treeee9ad4aa70d426a2d2c9060c2bc189a43e416698 /src/bookmarks/ephy-bookmarks-editor.c
parentfefbbb55910beadb0e568e917d3736cd5c62d31a (diff)
downloadgsoc2013-epiphany-56b18a72cbde121e7999846d99bb3e8eb91d4068.tar
gsoc2013-epiphany-56b18a72cbde121e7999846d99bb3e8eb91d4068.tar.gz
gsoc2013-epiphany-56b18a72cbde121e7999846d99bb3e8eb91d4068.tar.bz2
gsoc2013-epiphany-56b18a72cbde121e7999846d99bb3e8eb91d4068.tar.lz
gsoc2013-epiphany-56b18a72cbde121e7999846d99bb3e8eb91d4068.tar.xz
gsoc2013-epiphany-56b18a72cbde121e7999846d99bb3e8eb91d4068.tar.zst
gsoc2013-epiphany-56b18a72cbde121e7999846d99bb3e8eb91d4068.zip
Remove add_icon_column func and add the functionality to the normal
2003-04-29 Marco Pesenti Gritti <marco@it.gnome.org> * lib/widgets/ephy-node-view.c: (ephy_node_view_add_column): * lib/widgets/ephy-node-view.h: Remove add_icon_column func and add the functionality to the normal add_column. The icon will be packed in the same column. * src/bookmarks/ephy-bookmarks-editor.c: (entry_selection_changed_cb), (add_entry_monitor), (add_text_renderer_monitor), (cmd_add_topic), (cmd_rename), (build_search_box), (ephy_bookmarks_editor_construct), (toolbar_items_changed_cb), (ephy_bookmarks_editor_init): Fix for api change. Deal with 2 more sensitivity cases: bookmarks added by dnd to the toolbar and treeview text renderers. Remove hints until we have more columns. * src/ephy-history-window.c: (ephy_history_window_construct): Fix for new api * src/ephy-toolbars-model.c: (impl_add_item): Dont check if normal items are already in the toolbar: fix warnings.
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c71
1 files changed, 52 insertions, 19 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index cf4c7c619..d314ab660 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -82,6 +82,7 @@ static void ephy_bookmarks_editor_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
+static void ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor);
static void search_entry_changed_cb (GtkWidget *entry,
EphyBookmarksEditor *editor);
@@ -204,6 +205,36 @@ static EggActionGroupEntry ephy_bookmark_popup_entries [] = {
static guint ephy_bookmark_popup_n_entries = G_N_ELEMENTS (ephy_bookmark_popup_entries);
static void
+entry_selection_changed_cb (GtkWidget *widget, GParamSpec *pspec, EphyBookmarksEditor *editor)
+{
+ ephy_bookmarks_editor_update_menu (editor);
+}
+
+static void
+add_entry_monitor (EphyBookmarksEditor *editor, GtkWidget *entry)
+{
+ g_signal_connect (G_OBJECT (entry),
+ "notify::selection-bound",
+ G_CALLBACK (entry_selection_changed_cb),
+ editor);
+ g_signal_connect (G_OBJECT (entry),
+ "notify::cursor-position",
+ G_CALLBACK (entry_selection_changed_cb),
+ editor);
+}
+
+static void
+add_text_renderer_monitor (EphyBookmarksEditor *editor)
+{
+ GtkWidget *entry;
+
+ entry = gtk_window_get_focus (GTK_WINDOW (editor));
+ g_return_if_fail (GTK_IS_EDITABLE (entry));
+
+ add_entry_monitor (editor, entry);
+}
+
+static void
cmd_add_topic (EggAction *action,
EphyBookmarksEditor *editor)
{
@@ -213,6 +244,7 @@ cmd_add_topic (EggAction *action,
_("Type a topic"));
ephy_node_view_select_node (EPHY_NODE_VIEW (editor->priv->key_view), node);
ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view));
+ add_text_renderer_monitor (editor);
}
static void
@@ -234,6 +266,7 @@ cmd_rename (EggAction *action,
{
ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view));
}
+ add_text_renderer_monitor (editor);
}
static GtkWidget *
@@ -937,12 +970,6 @@ search_entry_changed_cb (GtkWidget *entry, EphyBookmarksEditor *editor)
g_free (search_text);
}
-static void
-search_selection_changed_cb (GtkWidget *widget, GParamSpec *pspec, EphyBookmarksEditor *editor)
-{
- ephy_bookmarks_editor_update_menu (editor);
-}
-
static GtkWidget *
build_search_box (EphyBookmarksEditor *editor)
{
@@ -960,14 +987,7 @@ build_search_box (EphyBookmarksEditor *editor)
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (search_entry_changed_cb),
editor);
- g_signal_connect (G_OBJECT (entry),
- "notify::selection-bound",
- G_CALLBACK (search_selection_changed_cb),
- editor);
- g_signal_connect (G_OBJECT (entry),
- "notify::cursor-position",
- G_CALLBACK (search_selection_changed_cb),
- editor);
+ add_entry_monitor (editor, entry);
label = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
@@ -1139,7 +1159,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
EPHY_NODE_KEYWORD_PROP_NAME,
EPHY_NODE_KEYWORD_PROP_PRIORITY,
EPHY_NODE_VIEW_AUTO_SORT |
- EPHY_NODE_VIEW_EDITABLE);
+ EPHY_NODE_VIEW_EDITABLE, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), key_view);
gtk_widget_set_size_request (key_view, 130, -1);
gtk_widget_show (key_view);
@@ -1186,16 +1206,15 @@ 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);
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (bm_view), TRUE);
ephy_node_view_enable_drag_source (EPHY_NODE_VIEW (bm_view),
bmk_drag_types,
n_bmk_drag_types,
EPHY_NODE_BMK_PROP_LOCATION);
- ephy_node_view_add_icon_column (EPHY_NODE_VIEW (bm_view), provide_favicon);
ephy_node_view_add_column (EPHY_NODE_VIEW (bm_view), _("Title"),
G_TYPE_STRING, EPHY_NODE_BMK_PROP_TITLE, -1,
EPHY_NODE_VIEW_AUTO_SORT |
- EPHY_NODE_VIEW_EDITABLE);
+ EPHY_NODE_VIEW_EDITABLE,
+ provide_favicon);
gtk_container_add (GTK_CONTAINER (scrolled_window), bm_view);
gtk_widget_show (bm_view);
editor->priv->bm_view = bm_view;
@@ -1216,7 +1235,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
"changed",
G_CALLBACK (view_selection_changed_cb),
editor);
-
+
ephy_state_add_window (GTK_WIDGET(editor),
"bookmarks_editor",
450, 400);
@@ -1316,9 +1335,23 @@ ephy_bookmarks_editor_get_property (GObject *object,
}
static void
+toolbar_items_changed_cb (EphyToolbarsModel *model,
+ int toolbar_position,
+ int position,
+ EphyBookmarksEditor *editor)
+{
+ ephy_bookmarks_editor_update_menu (editor);
+}
+
+static void
ephy_bookmarks_editor_init (EphyBookmarksEditor *editor)
{
editor->priv = g_new0 (EphyBookmarksEditorPrivate, 1);
editor->priv->tb_model = ephy_shell_get_toolbars_model (ephy_shell);
+
+ g_signal_connect (editor->priv->tb_model, "item_added",
+ G_CALLBACK (toolbar_items_changed_cb), editor);
+ g_signal_connect (editor->priv->tb_model, "item_removed",
+ G_CALLBACK (toolbar_items_changed_cb), editor);
}