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/toolbar.c | |
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/toolbar.c')
-rwxr-xr-x | src/toolbar.c | 46 |
1 files changed, 40 insertions, 6 deletions
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 |