aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/find_dlg.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-10-07 09:30:34 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-10-07 09:30:34 +0000
commitd6a720dd17fc27993724e334e6b5162d6f4c6518 (patch)
treed52cf410a991f61b6ddc74b7490686820e6a04f0 /gtk/find_dlg.c
parentcace3b6df92f0aa5459c6c48e5d2e02e264feab5 (diff)
Add Find Next/Find Previous submenu to conversation lists.
By using Find Next/Previous you will jump to the next/previous matching packet in the ethereal main window. I could not get CTRL-N / CTRL-B to work and was too lazy to research. It would be nice if CTRL-N / CTRL-P would invoke the same thing as selecting /Find Frame/Find Next/EP1 <-> EP2 or /Find Frame/Find Previous/EP1 <-> EP2 from the menu. I could not figure out how to get gtk to do this. The person that adds CTRL-N/CTRL-B here will be a hero. svn path=/trunk/; revision=8635
Diffstat (limited to 'gtk/find_dlg.c')
-rw-r--r--gtk/find_dlg.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/gtk/find_dlg.c b/gtk/find_dlg.c
index 1978f31c8e..9d219df3be 100644
--- a/gtk/find_dlg.c
+++ b/gtk/find_dlg.c
@@ -1,7 +1,7 @@
/* find_dlg.c
* Routines for "find frame" window
*
- * $Id: find_dlg.c,v 1.37 2003/09/09 02:41:00 gerald Exp $
+ * $Id: find_dlg.c,v 1.38 2003/10/07 09:30:34 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -800,3 +800,33 @@ find_previous_cb(GtkWidget *w , gpointer d)
{
find_previous_next(w, d, TRUE);
}
+
+/* this function jumps to the next packet matching the filter */
+void
+find_previous_next_frame_with_filter(char *filter, gboolean backwards)
+{
+ dfilter_t *sfcode;
+ gboolean sbackwards_saved;
+
+ /* temporarily set the direction we want to search */
+ sbackwards_saved=cfile.sbackward;
+ cfile.sbackward = backwards;
+
+ if (!dfilter_compile(filter, &sfcode)) {
+ /*
+ * XXX - this shouldn't happen, as the filter string is machine
+ * generated
+ */
+ return;
+ }
+ if (sfcode == NULL) {
+ /*
+ * XXX - this shouldn't happen, as the filter string is machine
+ * generated.
+ */
+ return;
+ }
+ find_packet_dfilter(&cfile, sfcode);
+ dfilter_free(sfcode);
+ cfile.sbackward=sbackwards_saved;
+}