diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-04-14 04:39:28 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-04-14 04:39:28 +0800 |
commit | f2738e3b37f0b84947059c310e5dc9e99dd3de12 (patch) | |
tree | df55ed6485ce114e0856e206d12c13e3b44ae61e /src | |
parent | 3c6234e1c9e2e91a2ffcdb643ba389c3bc123d1a (diff) | |
download | gsoc2013-epiphany-f2738e3b37f0b84947059c310e5dc9e99dd3de12.tar.gz gsoc2013-epiphany-f2738e3b37f0b84947059c310e5dc9e99dd3de12.tar.zst gsoc2013-epiphany-f2738e3b37f0b84947059c310e5dc9e99dd3de12.zip |
2004-04-09 Christian Persch <chpe@cvs.gnome.org>
2004-04-13 Christian Persch <chpe@cvs.gnome.org>
* src/bookmarks/ephy-bookmarks-menu.c: (add_bookmarks_menu),
(ephy_bookmarks_menu_rebuild):
* src/ephy-encoding-menu.c: (add_action):
* src/ephy-favorites-menu.c: (ephy_favorites_menu_rebuild):
* src/ephy-tabs-menu.c: (tab_added_cb):
2004-04-09 Christian Persch <chpe@cvs.gnome.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-menu.c | 23 | ||||
-rw-r--r-- | src/ephy-encoding-menu.c | 3 | ||||
-rw-r--r-- | src/ephy-favorites-menu.c | 8 | ||||
-rw-r--r-- | src/ephy-tabs-menu.c | 6 |
4 files changed, 30 insertions, 10 deletions
diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c index 18c00aa41..7391efc96 100644 --- a/src/bookmarks/ephy-bookmarks-menu.c +++ b/src/bookmarks/ephy-bookmarks-menu.c @@ -205,14 +205,18 @@ add_bookmarks_menu (EphyBookmarksMenu *menu, EphyNode *node, const char *path) GtkAction *action; EphyNode *child; long id; - char verb[30], name[30]; + char verb[30], name[30], accel_path[60]; child = l->data; id = ephy_node_get_id (child); - g_sprintf (verb, "OpenTopic%ld", ephy_node_get_id (child)); - g_sprintf (name, "%sName", verb); + g_snprintf (verb, sizeof (verb), + "OpenBmk%ld", ephy_node_get_id (child)); + g_snprintf (name, sizeof (name), "%sName", verb); + g_snprintf (accel_path, sizeof (accel_path), + "<Actions>/BookmarksActions/%s", verb); action = ephy_bookmark_action_new (verb, id); + gtk_action_set_accel_path (action, accel_path); gtk_action_group_add_action (p->action_group, action); g_object_unref (action); g_signal_connect (action, "go_location", @@ -271,7 +275,7 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu) for (l = node_list; l != NULL; l = l->next) { - char verb[30], name[30], path[60]; + char verb[30], name[30], path[60], accel_path[60]; const char *tmp; char *title; EphyNode *child; @@ -282,15 +286,20 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu) tmp = ephy_node_get_property_string (child, EPHY_NODE_KEYWORD_PROP_NAME); title = ephy_string_double_underscores (tmp); - g_sprintf (verb, "OpenTopic%ld", ephy_node_get_id (child)); - g_sprintf (name, "%sName", verb); - g_sprintf (path, "%s/%s", BOOKMARKS_MENU_PATH, name); + g_snprintf (verb, sizeof (verb), + "OpenTopic%ld", ephy_node_get_id (child)); + g_snprintf (name, sizeof (name), "%sName", verb); + g_snprintf (path, sizeof (path), + BOOKMARKS_MENU_PATH "/%s", name); + g_snprintf (accel_path, sizeof (accel_path), + "<Actions>/BookmarksActions/%s", verb); action = g_object_new (GTK_TYPE_ACTION, "name", verb, "label", title, "hide_if_empty", FALSE, NULL); + gtk_action_set_accel_path (action, accel_path); gtk_action_group_add_action (p->action_group, action); g_object_unref (action); g_free (title); diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c index bd76aa4d2..3eade8ced 100644 --- a/src/ephy-encoding-menu.c +++ b/src/ephy-encoding-menu.c @@ -338,7 +338,8 @@ add_action (EphyNode *encodings, EphyNode *node, EphyEncodingMenu *menu) G_CALLBACK (encoding_activate_cb), menu); - gtk_action_group_add_action (menu->priv->action_group, action); + gtk_action_group_add_action_with_accel + (menu->priv->action_group, action, NULL); g_object_unref (action); } diff --git a/src/ephy-favorites-menu.c b/src/ephy-favorites-menu.c index 40d3afddf..fee325c47 100644 --- a/src/ephy-favorites-menu.c +++ b/src/ephy-favorites-menu.c @@ -133,16 +133,20 @@ ephy_favorites_menu_rebuild (EphyFavoritesMenu *menu) { char verb[20]; char name[20]; + char accel_path[48]; EphyNode *node; GtkAction *action; - g_sprintf (verb, "GoFav%d", i); - g_sprintf (name, "GoFav%dMenu", i); + g_snprintf (verb, sizeof (verb),"GoFav%d", i); + g_snprintf (name, sizeof (name), "GoFav%dMenu", i); + g_snprintf (accel_path, sizeof (accel_path), + "<Actions>/FavoritesActions/%s", verb); node = g_ptr_array_index (children, i); action = ephy_bookmark_action_new (verb, ephy_node_get_id (node)); + gtk_action_set_accel_path (action, accel_path); gtk_action_group_add_action (p->action_group, action); g_object_unref (action); g_signal_connect (action, "go_location", diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c index df6984627..1ab5d1c1a 100644 --- a/src/ephy-tabs-menu.c +++ b/src/ephy-tabs-menu.c @@ -88,10 +88,16 @@ static void tab_added_cb (EphyNotebook *notebook, EphyTab *tab, EphyTabsMenu *menu) { GtkAction *action; + char accel_path[40]; g_return_if_fail (EPHY_IS_TAB (tab)); action = GTK_ACTION (ephy_tab_get_action (tab)); + + g_snprintf (accel_path, sizeof (accel_path), + "<Actions>/TabsActions/%s", gtk_action_get_name (action)); + gtk_action_set_accel_path (action, accel_path); + gtk_action_group_add_action (menu->priv->action_group, action); ephy_tabs_menu_update (menu); |