diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-04-18 14:02:18 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-04-18 21:02:54 +0000 |
commit | 1015fa04313893ba81bca678534fad7a4630d6c8 (patch) | |
tree | ae8efa94137f1d17818f19971c4a304abdc34f2a /ui/gtk | |
parent | 870b3d2c0f46addafb6a7dab4278de48edc33535 (diff) |
Have a common "capture file close alert box" routine.
Take cf_close_failure_alert_box() and put it into libui, with the name
cfile_close_failure_alert_box(). Use it not only in file.c but also
in ui/export_pdu_ui_utils.c, ui/gtk/file_import_dlg.c, and
ui/qt/import_text_dialog.cpp where the error we get back isn't
necessarily an errno.
Have ui/gtk/file_import_dlg.c and ui/qt/import_text_dialog.cpp also use
cfile_open_failure_alert_box() on open errors.
Change-Id: I987f339a23ea58609390306a319923e7f92d5c07
Reviewed-on: https://code.wireshark.org/review/21203
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/file_import_dlg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/gtk/file_import_dlg.c b/ui/gtk/file_import_dlg.c index 81f4b27234..f13c632181 100644 --- a/ui/gtk/file_import_dlg.c +++ b/ui/gtk/file_import_dlg.c @@ -516,7 +516,9 @@ file_import_open(text_import_info_t *info) shb_hdrs, idb_inf, NULL, &err); capfile_name = g_strdup(tmpname); if (info->wdh == NULL) { - open_failure_alert_box(tmpname ? tmpname : "temporary file", err, TRUE); + cfile_open_failure_alert_box(tmpname ? tmpname : "temporary file", + err, NULL, TRUE, + WTAP_FILE_TYPE_SUBTYPE_PCAPNG); fclose(info->import_text_file); goto end; } @@ -533,7 +535,7 @@ file_import_open(text_import_info_t *info) } if (!wtap_dump_close(info->wdh, &err)) { - write_failure_alert_box(capfile_name, err); + cfile_close_failure_alert_box(capfile_name, err); } if (cf_open(&cfile, capfile_name, WTAP_TYPE_AUTO, TRUE /* temporary file */, &err) != CF_OK) { |