diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-04-28 01:09:58 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-28 01:09:58 +0800 |
commit | 4d94003629211bb7cb57189742b718201d2c27bd (patch) | |
tree | 693ae06447b471e76bf9baccaa91d7e7e7981fa8 /src | |
parent | fbe3cc4fcb4bdfd7bd28443a0852a4b79ff920c6 (diff) | |
download | gsoc2013-epiphany-4d94003629211bb7cb57189742b718201d2c27bd.tar gsoc2013-epiphany-4d94003629211bb7cb57189742b718201d2c27bd.tar.gz gsoc2013-epiphany-4d94003629211bb7cb57189742b718201d2c27bd.tar.bz2 gsoc2013-epiphany-4d94003629211bb7cb57189742b718201d2c27bd.tar.lz gsoc2013-epiphany-4d94003629211bb7cb57189742b718201d2c27bd.tar.xz gsoc2013-epiphany-4d94003629211bb7cb57189742b718201d2c27bd.tar.zst gsoc2013-epiphany-4d94003629211bb7cb57189742b718201d2c27bd.zip |
Update sensitivity on selection changes. Thanks xan to find this one.
2003-04-27 Marco Pesenti Gritti <marco@it.gnome.org>
* src/bookmarks/ephy-bookmarks-editor.c:
(ephy_bookmarks_editor_update_menu), (view_selection_changed_cb),
(ephy_bookmarks_editor_construct):
Update sensitivity on selection changes. Thanks xan to find
this one.
* src/toolbar.c: (remove_action), (topic_remove_cb),
(bookmark_remove_cb):
Get back bookmarks/toolbar sync on bookmark removal.
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 17 | ||||
-rwxr-xr-x | src/toolbar.c | 46 |
2 files changed, 57 insertions, 6 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index ffaa078c5..4fb95efc2 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -597,6 +597,8 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor) GList *selected; GtkWidget *focus_widget; + LOG ("Update menu sensitivity") + bmk_focus = ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->bm_view)); key_focus = ephy_node_view_is_target @@ -1037,6 +1039,12 @@ provide_favicon (EphyNode *node, GValue *value, gpointer user_data) } static void +view_selection_changed_cb (GtkWidget *view, EphyBookmarksEditor *editor) +{ + ephy_bookmarks_editor_update_menu (editor); +} + +static void ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) { GtkTreeSelection *selection; @@ -1125,6 +1133,10 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) 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); + g_signal_connect (G_OBJECT (selection), + "changed", + G_CALLBACK (view_selection_changed_cb), + editor); ephy_node_view_add_column (EPHY_NODE_VIEW (key_view), _("Topics"), G_TYPE_STRING, EPHY_NODE_KEYWORD_PROP_NAME, @@ -1203,6 +1215,11 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) "show_popup", G_CALLBACK (ephy_bookmarks_editor_show_popup_cb), editor); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (bm_view)); + g_signal_connect (G_OBJECT (selection), + "changed", + G_CALLBACK (view_selection_changed_cb), + editor); selected_id_str = eel_gconf_get_string (CONF_BOOKMARKS_SELECTED_NODE); selected_id = g_ascii_strtoull (selected_id_str, NULL, 10); diff --git a/src/toolbar.c b/src/toolbar.c index 631bc94c2..e6c419861 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -376,22 +376,53 @@ toolbar_set_window (Toolbar *t, EphyWindow *window) } static void +remove_action (EphyToolbarsModel *model, + const char *action_name) +{ + int i, n_toolbars, l, n_items; + + n_toolbars = egg_toolbars_model_n_toolbars + (EGG_TOOLBARS_MODEL (model)); + + for (i = 0; i < n_toolbars; i++) + { + n_items = egg_toolbars_model_n_items (EGG_TOOLBARS_MODEL (model), i); + for (l = 0; l < n_items; l++) + { + const char *i_name; + gboolean sep; + + i_name = egg_toolbars_model_item_nth + (EGG_TOOLBARS_MODEL (model), i, l, &sep); + if (!sep && strcmp (action_name, i_name) == 0) + { + egg_toolbars_model_remove_item + (EGG_TOOLBARS_MODEL (model), i, l); + } + } + } +} + +static void topic_remove_cb (EphyBookmarks *eb, long id, Toolbar *t) { -/* EggAction *action; + EggAction *action; char *name; + EphyToolbarsModel *model; + + model = ephy_shell_get_toolbars_model (ephy_shell); name = g_strdup_printf ("GoTopicId%ld", id); action = egg_action_group_get_action (t->priv->action_group, name); if (action) { - egg_toolbars_group_remove_action (toolbars_group, action->name); + remove_action (model, action->name); egg_action_group_remove_action (t->priv->action_group, action); } - g_free (name);*/ + g_free (name); } static void @@ -399,18 +430,21 @@ bookmark_remove_cb (EphyBookmarks *eb, long id, Toolbar *t) { -/* EggAction *action; + EggAction *action; char *name; + EphyToolbarsModel *model; + + model = ephy_shell_get_toolbars_model (ephy_shell); name = g_strdup_printf ("GoBookmarkId%ld", id); action = egg_action_group_get_action (t->priv->action_group, name); if (action) { - egg_toolbars_group_remove_action (toolbars_group, action->name); + remove_action (model, action->name); egg_action_group_remove_action (t->priv->action_group, action); } - g_free (name);*/ + g_free (name); } static void |