There's not much of note in ui/gtk/main_packet_panes.c; just do those

operations directly in ui/gtk/main.c.

svn path=/trunk/; revision=43295
This commit is contained in:
Guy Harris 2012-06-16 23:10:06 +00:00
parent 6cb63bbc6f
commit 26d50fb7a0
4 changed files with 13 additions and 119 deletions

View File

@ -99,7 +99,6 @@ WIRESHARK_GTK_SRC = \
main_airpcap_toolbar.c \
main_filter_toolbar.c \
main_menubar.c \
main_packet_panes.c \
manual_addr_resolv.c \
packet_panes.c \
main_statusbar.c \
@ -295,7 +294,6 @@ noinst_HEADERS = \
main_airpcap_toolbar.h \
main_filter_toolbar.h \
main_menubar_private.h \
main_packet_panes.h \
menus.h \
packet_panes.h \
main_statusbar_private.h \

View File

@ -1732,8 +1732,8 @@ main_cf_cb_packet_selected(gpointer data)
/* Display the GUI protocol tree and packet bytes.
XXX - why do we dump core if we call "proto_tree_draw()"
before calling "add_byte_views()"? */
add_main_byte_views(cf->edt);
main_proto_tree_draw(cf->edt->tree);
add_byte_views(cf->edt, tree_view_gbl, byte_nb_ptr_gbl);
proto_tree_draw(cf->edt->tree, tree_view_gbl);
/* Note: Both string and hex value searches in the packet data produce a non-zero
search_pos if successful */
@ -1750,8 +1750,17 @@ main_cf_cb_packet_selected(gpointer data)
static void
main_cf_cb_packet_unselected(capture_file *cf)
{
/* Clear out the display of that packet. */
main_clear_tree_and_hex_views();
/* No packet is being displayed; clear the hex dump pane by getting
rid of all the byte views. */
while (gtk_notebook_get_nth_page(GTK_NOTEBOOK(byte_nb_ptr_gbl), 0) != NULL)
gtk_notebook_remove_page(GTK_NOTEBOOK(byte_nb_ptr_gbl), 0);
/* Add a placeholder byte view so that there's at least something
displayed in the byte view notebook. */
add_byte_tab(byte_nb_ptr_gbl, "", NULL, NULL, tree_view_gbl);
/* And clear the protocol tree display as well. */
proto_tree_draw(NULL, tree_view_gbl);
/* No packet is selected. */
set_menus_for_selected_packet(cf);

View File

@ -1,67 +0,0 @@
/* main_packet_panes.c
* Routines for GTK+ packet display in the main window (packet details
* and hex dump panes)
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* 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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <epan/epan_dissect.h>
#include <epan/prefs.h>
#include <gtk/gtk.h>
#include "ui/gtk/gtkglobals.h"
#include "ui/gtk/main_packet_panes.h"
#include "ui/gtk/packet_panes.h"
void
add_main_byte_views(epan_dissect_t *edt)
{
add_byte_views(edt, tree_view_gbl, byte_nb_ptr_gbl);
}
void
main_proto_tree_draw(proto_tree *protocol_tree)
{
proto_tree_draw(protocol_tree, tree_view_gbl);
}
/*
* Clear the hex dump and protocol tree panes in the main window.
*/
void
main_clear_tree_and_hex_views(void)
{
/* Clear the hex dump by getting rid of all the byte views. */
while (gtk_notebook_get_nth_page(GTK_NOTEBOOK(byte_nb_ptr_gbl), 0) != NULL)
gtk_notebook_remove_page(GTK_NOTEBOOK(byte_nb_ptr_gbl), 0);
/* Add a placeholder byte view so that there's at least something
displayed in the byte view notebook. */
add_byte_tab(byte_nb_ptr_gbl, "", NULL, NULL, tree_view_gbl);
/* Clear the protocol tree */
main_proto_tree_draw(NULL);
}

View File

@ -1,46 +0,0 @@
/* main_packet_panes.h
* Definitions for GTK+ packet display structures and routines in the
* main window (packet details and hex dump panes)
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* 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 __MAIN_PACKET_PANES_H__
#define __MAIN_PACKET_PANES_H__
/** @file
* Packet tree and details panes.
* @ingroup main_window_group
*/
/** Create byte views in the main window.
*/
void add_main_byte_views(epan_dissect_t *edt);
/** Display the protocol tree in the main window.
*/
void main_proto_tree_draw(proto_tree *protocol_tree);
/** Clear the hex dump and protocol tree panes.
*/
void main_clear_tree_and_hex_views(void);
#endif /* __MAIN_PACKET_PANES_H__ */