aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-24 21:02:55 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-24 21:02:55 +0000
commita39c3fab30321ab0cc888069cdb9aea70a45ebce (patch)
tree1276b9678568af7129259d74bd3df0d7278e4710 /file.c
parentb99f04d32cfe34e5ff1d7f52518f36ae336e39a5 (diff)
new_packet_list_find_row_from_data() is always used to select a packet,
so get rid of the select_flag argument, and rename it new_packet_list_select_row_from_data(). It's also always passed a frame_data *, so make its argument a frame_data *. Its return value is used only to detect whether the packet was found in the display or not, so make it a gboolean. Check it in *all* cases where it's called, and change the dialog message a bit (the most likely cause is that the user cancelled a redissection of the packets, so not all packets in the capture file are in the display. Also, in the find case, pass it the new packet we found. svn path=/trunk/; revision=36839
Diffstat (limited to 'file.c')
-rw-r--r--file.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/file.c b/file.c
index a7f203931d..50c499e126 100644
--- a/file.c
+++ b/file.c
@@ -1923,7 +1923,15 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
if (selected_frame_num == 0) {
new_packet_list_select_first_row();
}else{
- new_packet_list_find_row_from_data(selected_frame, TRUE);
+ if (!new_packet_list_select_row_from_data(selected_frame)) {
+ /* We didn't find a row corresponding to this frame.
+ This means that the frame isn't being displayed currently,
+ so we can't select it. */
+ simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK,
+ "%sEnd of capture exceeded!%s\n\n"
+ "The capture file is probably not fully dissected.",
+ simple_dialog_primary_start(), simple_dialog_primary_end());
+ }
}
}
@@ -3214,7 +3222,7 @@ find_packet(capture_file *cf,
progdlg_t *progbar = NULL;
gboolean stop_flag;
int count;
- int row;
+ gboolean found;
float progbar_val;
GTimeVal start_time;
gchar status_str[100];
@@ -3357,16 +3365,16 @@ find_packet(capture_file *cf,
if (new_fd != NULL) {
/* Find and select */
cf->search_in_progress = TRUE;
- row = new_packet_list_find_row_from_data(fdata, TRUE);
+ found = new_packet_list_select_row_from_data(new_fd);
cf->search_in_progress = FALSE;
cf->search_pos = 0; /* Reset the position */
- if (row == -1) {
- /* We didn't find a row even though we know that a frame
- * exists that satifies the search criteria. This means that the
- * frame isn't being displayed currently so we can't select it. */
+ if (!found) {
+ /* We didn't find a row corresponding to this frame.
+ This means that the frame isn't being displayed currently,
+ so we can't select it. */
simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK,
"%sEnd of capture exceeded!%s\n\n"
- "The capture file is probably not fully loaded.",
+ "The capture file is probably not fully dissected.",
simple_dialog_primary_start(), simple_dialog_primary_end());
return FALSE;
}
@@ -3395,7 +3403,16 @@ cf_goto_frame(capture_file *cf, guint fnumber)
return FALSE; /* we failed to go to that packet */
}
- new_packet_list_find_row_from_data(fdata, TRUE);
+ if (!new_packet_list_select_row_from_data(fdata)) {
+ /* We didn't find a row corresponding to this frame.
+ This means that the frame isn't being displayed currently,
+ so we can't select it. */
+ simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK,
+ "%sEnd of capture exceeded!%s\n\n"
+ "The capture file is probably not fully dissected.",
+ simple_dialog_primary_start(), simple_dialog_primary_end());
+ return FALSE;
+ }
return TRUE; /* we got to that packet */
}