summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-09-20 08:42:35 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-09-20 08:42:35 +0000
commit831c54c4f5b15e8d8fce18bd6f6d08974d689d56 (patch)
tree0537131334ea0bf565922349bf410e468fc3ad21 /file.c
parent776776960def92068adf7ada8e341aa01f6284c3 (diff)
downloadwireshark-831c54c4f5b15e8d8fce18bd6f6d08974d689d56.tar.gz
add two new callbacks:
cf_cb_file_closing (called before closing a capture file) cf_cb_file_closed will be called afterwards, but both only if a file is really closed as cf_close is called more often ... If we are closing large capture files (~20MB), the screen looks ugly while the file is closed. Change this so the screen will immediately go back to initial state and a dialog (without buttons) is shown that the file is currently closed. As the operation which takes most of the time to close the file is a single eth_clist_clear call, we can't use a progress bar here. cf_cb_live_capture_stopping: called when the user wants to stop the capture (toolbar or menu clicked). At least on Win32, the time between this and the actual stop completed can be noticeable (1-2 seconds), so the user doesn't know if the button press did anything at all. Do something similar as above, show a dialog box without buttons to inform that the close is in progress. svn path=/trunk/; revision=15891
Diffstat (limited to 'file.c')
-rw-r--r--file.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/file.c b/file.c
index 9b4f9977e6..aa8dc3d1f9 100644
--- a/file.c
+++ b/file.c
@@ -347,11 +347,17 @@ cf_reset_state(capture_file *cf)
void
cf_close(capture_file *cf)
{
- cf_reset_state(cf);
+ /* close things, if not already closed before */
+ if(cf->state != FILE_CLOSED) {
+
+ cf_callback_invoke(cf_cb_file_closing, cf);
- cleanup_dissection();
+ cf_reset_state(cf);
- cf_callback_invoke(cf_cb_file_closed, cf);
+ cleanup_dissection();
+
+ cf_callback_invoke(cf_cb_file_closed, cf);
+ }
}
cf_read_status_t
@@ -557,13 +563,13 @@ cf_continue_tail(capture_file *cf, int to_read, int *err)
to_read--;
}
- packet_list_thaw();
-
/* XXX - this cheats and looks inside the packet list to find the final
row number. */
if (auto_scroll_live && cf->plist_end != NULL)
packet_list_moveto_end();
+ packet_list_thaw();
+
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to exit Ethereal. Return CF_READ_ABORTED
so that our caller can kill off the capture child process;
@@ -3104,10 +3110,6 @@ cf_save(capture_file *cf, const char *fname, packet_range_t *range, guint save_f
packet_range_process_init(range);
- /* Used to be :
- * if (!save_filtered && !save_marked && !save_manual_range &&
- * !save_marked_range && !save_curr && save_format == cf->cd_t) {
- */
if (packet_range_process_all(range) && save_format == cf->cd_t) {
/* We're not filtering packets, and we're saving it in the format