summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/file.c b/file.c
index b5920fd569..547f2bf48c 100644
--- a/file.c
+++ b/file.c
@@ -1217,6 +1217,7 @@ read_packet(capture_file *cf, dfilter_t *dfcode, epan_dissect_t *edt,
typedef struct _callback_data_t {
+ gpointer pd_window;
gint64 f_len;
GTimeVal start_time;
progdlg_t *progbar;
@@ -1271,7 +1272,7 @@ merge_callback(merge_event event, int num _U_,
large file, we might take considerably longer than that standard
time in order to get to the next progress bar step). */
if (cb_data->progbar == NULL) {
- cb_data->progbar = delayed_create_progress_dlg(NULL, "Merging", "files",
+ cb_data->progbar = delayed_create_progress_dlg(cb_data->pd_window, "Merging", "files",
FALSE, &cb_data->stop_flag, &cb_data->start_time, 0.0f);
}
@@ -1323,19 +1324,23 @@ merge_callback(merge_event event, int num _U_,
cf_status_t
-cf_merge_files_to_tempfile(char **out_filenamep, int in_file_count,
- char *const *in_filenames, int file_type,
- gboolean do_append)
+cf_merge_files_to_tempfile(gpointer pd_window, char **out_filenamep,
+ int in_file_count, char *const *in_filenames,
+ int file_type, gboolean do_append)
{
int err = 0;
gchar *err_info = NULL;
guint err_fileno;
merge_result status;
merge_progress_callback_t cb;
+ callback_data_t *cb_data = g_new0(callback_data_t, 1);
/* prepare our callback routine */
+ cb_data->pd_window = pd_window;
cb.callback_func = merge_callback;
- cb.data = g_malloc0(sizeof(callback_data_t));
+ cb.data = cb_data;
+
+ cf_callback_invoke(cf_cb_file_merge_started, NULL);
/* merge the files */
status = merge_files_to_tempfile(out_filenamep, "wireshark", file_type,
@@ -1376,6 +1381,8 @@ cf_merge_files_to_tempfile(char **out_filenamep, int in_file_count,
g_free(err_info);
+ cf_callback_invoke(cf_cb_file_merge_finished, NULL);
+
if (status != MERGE_OK) {
/* Callers aren't expected to treat an error or an explicit abort
differently - we put up error dialogs ourselves, so they don't