From 63a4260c9d703cf8560e0a0f50b1b54541e9da5d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 19 Dec 2002 03:56:04 +0000 Subject: [PATCH] Rename "Go To Specified Frame" to "Go To Corresponding Frame" (I'm not sure there *is* a good name for it). Put it in the "Tools" menu as well (although I'm not sure what top-level menu it belongs in, or if it should get a new one). Make those items sensitive only if there's an FT_FRAMENUM item selected in the protocol tree pane. Clean up some menu paths in "set_menu_sensitivity()" (not that it matters, as only the last component, and the first component if it's a menu factory name, are used). svn path=/trunk/; revision=6803 --- gtk/menu.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/gtk/menu.c b/gtk/menu.c index 1dc68fea01..225d082a63 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.80 2002/12/19 02:58:53 guy Exp $ + * $Id: menu.c,v 1.81 2002/12/19 03:56:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -217,6 +217,8 @@ static GtkItemFactoryEntry menu_items[] = 0, NULL, NULL), ITEM_FACTORY_ENTRY("/Tools/_Decode As...", NULL, decode_as_cb, 0, NULL, NULL), + ITEM_FACTORY_ENTRY("/Tools/_Go To Corresponding Frame", NULL, goto_framenum_cb, + 0, NULL, NULL), /* {"/Tools/Graph", NULL, NULL, 0, NULL}, future use */ ITEM_FACTORY_ENTRY("/_Tools/TCP Stream Analysis", NULL, NULL, 0, "", NULL), @@ -312,7 +314,7 @@ static GtkItemFactoryEntry tree_view_menu_items[] = 0, NULL, NULL), ITEM_FACTORY_ENTRY("/", NULL, NULL, 0, "", NULL), ITEM_FACTORY_ENTRY("/_Resolve Name", NULL, resolve_name_cb, 0, NULL, NULL), - ITEM_FACTORY_ENTRY("/_Go To Specified Frame", NULL, goto_framenum_cb, 0, NULL, NULL), + ITEM_FACTORY_ENTRY("/_Go To Corresponding Frame", NULL, goto_framenum_cb, 0, NULL, NULL), ITEM_FACTORY_ENTRY("/Protocol Properties...", NULL, properties_cb, 0, NULL, NULL), ITEM_FACTORY_ENTRY("/Match", NULL, NULL, 0, "", NULL), @@ -438,6 +440,8 @@ set_menu_sensitivity_meat(GtkItemFactory *ifactory, gchar *path, gint val) { /* /menu/path - old functionality */ /* /menu/path - new functionality */ /* MenuName:
, , , */ +/* XXX - is this really supposed to ignore all but the */ +/* last component of the menu path? */ static void set_menu_sensitivity (gchar *path, gint val) { GSList *menu_list = popup_menu_list; @@ -602,8 +606,8 @@ set_menus_for_captured_packets(gboolean have_captured_packets) set_menu_sensitivity("/Display/Colorize Display...", have_captured_packets); set_menu_sensitivity("/Tools/Summary", have_captured_packets); set_menu_sensitivity("/Tools/Protocol Hierarchy Statistics", have_captured_packets); - set_menu_sensitivity("/Display/Match", have_captured_packets); - set_menu_sensitivity("/Display/Prepare", have_captured_packets); + set_menu_sensitivity("/Match", have_captured_packets); + set_menu_sensitivity("/Prepare", have_captured_packets); } /* Enable or disable menu items based on whether a packet is selected. */ @@ -641,19 +645,28 @@ set_menus_for_selected_tree_row(gboolean have_selected_tree) } else { properties = prefs_is_registered_protocol(proto_registrar_get_abbrev(hfinfo->parent)); } + if (hfinfo->type == FT_FRAMENUM) { + set_menu_sensitivity("
/Tools/Go To Corresponding Frame", TRUE); + set_menu_sensitivity("/Go To Corresponding Frame", TRUE); + } else { + set_menu_sensitivity("
/Tools/Go To Corresponding Frame", FALSE); + set_menu_sensitivity("/Go To Corresponding Frame", FALSE); + } set_menu_sensitivity("
/Display/Match", proto_can_match_selected(finfo_selected)); - set_menu_sensitivity("/Display/Match", + set_menu_sensitivity("/Match", proto_can_match_selected(finfo_selected)); set_menu_sensitivity("
/Display/Prepare", proto_can_match_selected(finfo_selected)); - set_menu_sensitivity("/Display/Prepare", + set_menu_sensitivity("/Prepare", proto_can_match_selected(finfo_selected)); } else { set_menu_sensitivity("
/Display/Match", FALSE); - set_menu_sensitivity("/Display/Match", FALSE); + set_menu_sensitivity("/Match", FALSE); set_menu_sensitivity("
/Display/Prepare", FALSE); - set_menu_sensitivity("/Display/Prepare", FALSE); + set_menu_sensitivity("/Prepare", FALSE); + set_menu_sensitivity("
/Tools/Go To Corresponding Frame", FALSE); + set_menu_sensitivity("/Go To Corresponding Frame", FALSE); } set_menu_sensitivity("/Protocol Properties...", have_selected_tree && properties);