forked from osmocom/wireshark
Add a popup menu for the hexdump window. For now, it has only the
common items but let's prepare the future (e.g. Match selected)... svn path=/trunk/; revision=2314
This commit is contained in:
parent
ccdbb6ca6d
commit
e0a8d41556
|
@ -1,7 +1,7 @@
|
|||
/* keys.h
|
||||
* Key definitions for various objects
|
||||
*
|
||||
* $Id: keys.h,v 1.10 2000/01/18 08:38:16 guy Exp $
|
||||
* $Id: keys.h,v 1.11 2000/08/20 21:55:57 deniel Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -43,5 +43,6 @@
|
|||
#define PM_MENU_LIST_KEY "popup_menu_menu_list"
|
||||
#define PM_PACKET_LIST_KEY "popup_menu_packet_list"
|
||||
#define PM_TREE_VIEW_KEY "popup_menu_tree_view"
|
||||
#define PM_HEXDUMP_KEY "popup_menu_hexdump"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* main.c
|
||||
*
|
||||
* $Id: main.c,v 1.140 2000/08/20 15:38:50 deniel Exp $
|
||||
* $Id: main.c,v 1.141 2000/08/20 21:55:58 deniel Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -1484,6 +1484,10 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs)
|
|||
/* Byte view. */
|
||||
create_byte_view(bv_size, l_pane, &byte_view, &bv_scrollw,
|
||||
prefs->gui_scrollbar_on_right);
|
||||
gtk_signal_connect_object(GTK_OBJECT(byte_view), "button_press_event",
|
||||
GTK_SIGNAL_FUNC(popup_menu_handler),
|
||||
gtk_object_get_data(GTK_OBJECT(popup_menu_object),
|
||||
PM_HEXDUMP_KEY));
|
||||
|
||||
/* Filter/info box */
|
||||
stat_hbox = gtk_hbox_new(FALSE, 1);
|
||||
|
|
13
gtk/menu.c
13
gtk/menu.c
|
@ -1,7 +1,7 @@
|
|||
/* menu.c
|
||||
* Menu routines
|
||||
*
|
||||
* $Id: menu.c,v 1.39 2000/08/16 19:15:11 deniel Exp $
|
||||
* $Id: menu.c,v 1.40 2000/08/20 21:55:57 deniel Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -166,11 +166,17 @@ static GtkItemFactoryEntry tree_view_menu_items[] =
|
|||
{"/Expand All", NULL, GTK_MENU_FUNC(expand_all_cb), 0, NULL}
|
||||
};
|
||||
|
||||
static GtkItemFactoryEntry hexdump_menu_items[] =
|
||||
{
|
||||
{"/Follow TCP Stream", NULL, GTK_MENU_FUNC(follow_stream_cb), 0, NULL},
|
||||
{"/Filters...", NULL, GTK_MENU_FUNC(filter_dialog_cb), 0, NULL}
|
||||
};
|
||||
|
||||
static int initialize = TRUE;
|
||||
static GtkItemFactory *factory = NULL;
|
||||
static GtkItemFactory *packet_list_menu_factory = NULL;
|
||||
static GtkItemFactory *tree_view_menu_factory = NULL;
|
||||
static GtkItemFactory *hexdump_menu_factory = NULL;
|
||||
|
||||
static GSList *popup_menu_list = NULL;
|
||||
|
||||
|
@ -210,6 +216,11 @@ menus_init(void) {
|
|||
gtk_item_factory_create_items_ac(tree_view_menu_factory, sizeof(tree_view_menu_items)/sizeof(tree_view_menu_items[0]), tree_view_menu_items, NULL, 2);
|
||||
gtk_object_set_data(GTK_OBJECT(popup_menu_object), PM_TREE_VIEW_KEY, tree_view_menu_factory->widget);
|
||||
popup_menu_list = g_slist_append((GSList *)popup_menu_list, tree_view_menu_factory);
|
||||
|
||||
hexdump_menu_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL);
|
||||
gtk_item_factory_create_items_ac(hexdump_menu_factory, sizeof(hexdump_menu_items)/sizeof(hexdump_menu_items[0]), hexdump_menu_items, NULL, 2);
|
||||
gtk_object_set_data(GTK_OBJECT(popup_menu_object), PM_HEXDUMP_KEY, hexdump_menu_factory->widget);
|
||||
popup_menu_list = g_slist_append((GSList *)popup_menu_list, hexdump_menu_factory);
|
||||
|
||||
factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", grp);
|
||||
gtk_item_factory_create_items_ac(factory, nmenu_items, menu_items, NULL,2);
|
||||
|
|
Loading…
Reference in New Issue