wireshark/gtk/keys.h
Guy Harris 433e8801a1 Clean up the handling of filter strings:
have "filter_packets()" make a copy of the filter string handed
	to it, as it may save the filter string in the "capture_file"
	structure, and the caller of "filter_packets()" shouldn't have
	to worry about the string it passed to "filter_packets()" being
	stashed away somewhere so that it can't just free that string or
	change it;

	have callers of "filter_packets()" free up the string they
	handed to it, if the string was allocated and they're done with
	it;

	plug some memory leaks in "match_selected_cb_do()".

Check for an illegal "action" argument being passed to
"match_selected_cb_do()".

Move some keys out of "keys.h" into "gtk/main.c", as they're only used
in "gtk/main.c".

Make the pointer to the filter list a data item for the combo box, as
it's a copy of the list of strings for the combo box, rather than
attaching it to the widgets that activate the filter (a pointer to the
combo box *itself* is a data item for those widgets).

In "filter_activate_cb()", make a copy of the text from the text entry
field as soon as we fetch it, and use that copy.  Free that copy if
we didn't add the filter to the filter list.

Don't make a copy of the entire filter list and use that to set the
combo box's list of items - just use the list itself.  Also, when the
list is changed, make the new value the data for the combo box (the list
pointer will actually not be changed, because we happen to be using
"g_list_append()", but let's not rely on that).

svn path=/trunk/; revision=5368
2002-05-03 03:24:47 +00:00

49 lines
1.7 KiB
C

/* keys.h
* Key definitions for various objects
*
* $Id: keys.h,v 1.13 2002/05/03 03:24:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __KEYS_H__
#define __KEYS_H__
/* Keys for gtk_object_set_data */
#define E_DFILTER_TE_KEY "display_filter_entry"
#define E_RFILTER_TE_KEY "read_filter_te"
#define E_MPACKET_LIST_KEY "menu_packet_list"
#define E_MPACKET_LIST_ROW_KEY "menu_packet_list_row"
#define E_MPACKET_LIST_COL_KEY "menu_packet_list_col"
#define PRINT_CMD_LB_KEY "printer_command_label"
#define PRINT_CMD_TE_KEY "printer_command_entry"
#define PRINT_FILE_BT_KEY "printer_file_button"
#define PRINT_FILE_TE_KEY "printer_file_entry"
#define PLUGINS_DFILTER_TE "plugins_dfilter_te"
#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