aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--file.c6
-rw-r--r--gtk/main.c14
-rw-r--r--gtk/main.h4
-rw-r--r--gtk/menu.c6
-rw-r--r--gtk/proto_draw.c23
-rw-r--r--gtk/proto_draw.h4
6 files changed, 49 insertions, 8 deletions
diff --git a/file.c b/file.c
index 285388aa28..7acc0362c7 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.88 1999/09/11 04:50:34 gerald Exp $
+ * $Id: file.c,v 1.89 1999/09/11 12:33:56 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -911,6 +911,8 @@ select_packet(capture_file *cf, int row)
/* A packet is selected, so "File/Print Packet" has something to print. */
set_menu_sensitivity("/File/Print Packet", TRUE);
+ set_menu_sensitivity("/Display/Collapse All", TRUE);
+ set_menu_sensitivity("/Display/Expand All", TRUE);
}
/* Unselect the selected packet, if any. */
@@ -931,6 +933,8 @@ unselect_packet(capture_file *cf)
/* No packet is selected, so "File/Print Packet" has nothing to print. */
set_menu_sensitivity("/File/Print Packet", FALSE);
+ set_menu_sensitivity("/Display/Collapse All", FALSE);
+ set_menu_sensitivity("/Display/Expand All", FALSE);
}
static void
diff --git a/gtk/main.c b/gtk/main.c
index 28830f6475..5ee848eeda 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
-/* ethereal.c
+/* main.c
*
- * $Id: main.c,v 1.2 1999/09/09 03:32:01 gram Exp $
+ * $Id: main.c,v 1.3 1999/09/11 12:36:14 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -406,6 +406,16 @@ tree_view_cb(GtkWidget *w, gpointer data) {
gtk_text_thaw(GTK_TEXT(byte_view));
}
+void collapse_all_cb(GtkWidget *widget, gpointer data) {
+ if (cf.protocol_tree)
+ collapse_all_tree(cf.protocol_tree, tree_view);
+}
+
+void expand_all_cb(GtkWidget *widget, gpointer data) {
+ if (cf.protocol_tree)
+ expand_all_tree(cf.protocol_tree, tree_view);
+}
+
void
file_quit_cmd_cb (GtkWidget *widget, gpointer data) {
if (cf.save_file && !cf.user_saved) {
diff --git a/gtk/main.h b/gtk/main.h
index 68e5d261bc..9aa88bfb1d 100644
--- a/gtk/main.h
+++ b/gtk/main.h
@@ -1,7 +1,7 @@
/* ethereal.h
* Global defines, etc.
*
- * $Id: main.h,v 1.3 1999/09/10 07:19:51 guy Exp $
+ * $Id: main.h,v 1.4 1999/09/11 12:36:14 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -65,5 +65,7 @@ void file_reload_cmd_cb(GtkWidget *, gpointer);
void file_print_cmd_cb(GtkWidget *, gpointer);
void file_print_packet_cmd_cb(GtkWidget *, gpointer);
void main_realize_cb(GtkWidget *, gpointer);
+void expand_all_cb(GtkWidget *, gpointer);
+void collapse_all_cb(GtkWidget *, gpointer);
#endif /* ethereal.h */
diff --git a/gtk/menu.c b/gtk/menu.c
index 2ead929673..db523c1a4b 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -1,7 +1,7 @@
/* menu.c
* Menu routines
*
- * $Id: menu.c,v 1.3 1999/09/09 03:32:02 gram Exp $
+ * $Id: menu.c,v 1.4 1999/09/11 12:38:18 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -101,6 +101,8 @@ static GtkItemFactoryEntry menu_items[] =
{"/Display/_Options...", NULL, GTK_MENU_FUNC(display_opt_cb), 0, NULL},
{"/Display/_Match Selected", NULL, GTK_MENU_FUNC(match_selected_cb), 0, NULL},
{"/Display/_Colorize Display...", NULL, GTK_MENU_FUNC(color_display_cb), 0, NULL},
+ {"/Display/Collapse _All", NULL, GTK_MENU_FUNC(collapse_all_cb), 0, NULL},
+ {"/Display/_Expand All", NULL, GTK_MENU_FUNC(expand_all_cb), 0, NULL},
{"/_Tools", NULL, NULL, 0, "<Branch>" },
{"/Tools/_Follow TCP Stream", NULL, GTK_MENU_FUNC(follow_stream_cb), 0, NULL},
/* {"/Tools/Graph", NULL, NULL, 0, NULL}, future use */
@@ -148,6 +150,8 @@ menus_init(void) {
set_menu_sensitivity("/Edit/Copy", FALSE);
set_menu_sensitivity("/Edit/Paste", FALSE);
set_menu_sensitivity("/Edit/Find", FALSE);
+ set_menu_sensitivity("/Display/Collapse All", FALSE);
+ set_menu_sensitivity("/Display/Expand All", FALSE);
set_menu_sensitivity("/Tools/Graph", FALSE);
set_menu_sensitivity("/Tools/Summary", FALSE);
}
diff --git a/gtk/proto_draw.c b/gtk/proto_draw.c
index 80f53bc534..2a49b8311e 100644
--- a/gtk/proto_draw.c
+++ b/gtk/proto_draw.c
@@ -1,7 +1,7 @@
/* gtkpacket.c
* Routines for GTK+ packet display
*
- * $Id: proto_draw.c,v 1.1 1999/09/09 02:42:40 gram Exp $
+ * $Id: proto_draw.c,v 1.2 1999/09/11 12:38:18 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -52,6 +52,8 @@
extern GtkWidget *byte_view;
extern GdkFont *m_r_font, *m_b_font;
+static gint tree_type[NUM_TREE_TYPES];
+
static void
proto_tree_draw_node(GNode *node, gpointer data);
@@ -119,6 +121,24 @@ packet_hex_print(GtkText *bv, guint8 *pd, gint len, gint bstart, gint blen) {
}
}
+void expand_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view) {
+ int i;
+ for(i=0; i < NUM_TREE_TYPES; i++) {
+ tree_type[i] = 1;
+ }
+ gtk_tree_clear_items(GTK_TREE(tree_view), 0, -1);
+ proto_tree_draw(protocol_tree, tree_view);
+}
+
+void collapse_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view) {
+ int i;
+ for(i=0; i < NUM_TREE_TYPES; i++) {
+ tree_type[i] = 0;
+ }
+ gtk_tree_clear_items(GTK_TREE(tree_view), 0, -1);
+ proto_tree_draw(protocol_tree, tree_view);
+}
+
static void
expand_tree(GtkWidget *w, gpointer data) {
gint *val = (gint *) data;
@@ -152,7 +172,6 @@ proto_tree_draw_node(GNode *node, gpointer data)
GtkWidget *ti, *subtree;
gchar label_str[ITEM_LABEL_LENGTH];
gchar *label_ptr;
- static gint tree_type[NUM_TREE_TYPES];
if (!fi->visible)
return;
diff --git a/gtk/proto_draw.h b/gtk/proto_draw.h
index e2f95fa500..b0e92c8c33 100644
--- a/gtk/proto_draw.h
+++ b/gtk/proto_draw.h
@@ -1,7 +1,7 @@
/* gtkpacket.h
* Definitions for GTK+ packet display structures and routines
*
- * $Id: proto_draw.h,v 1.1 1999/09/09 02:42:40 gram Exp $
+ * $Id: proto_draw.h,v 1.2 1999/09/11 12:38:18 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -33,5 +33,7 @@ void packet_hex_print(GtkText *, guint8 *, gint, gint, gint);
#define E_TREEINFO_LEN_KEY "tree_info_len"
void proto_tree_draw(proto_tree *protocol_tree, GtkWidget *tree_view);
+void expand_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
+void collapse_all_tree(proto_tree *protocol_tree, GtkWidget *tree_view);
#endif