void
vsimple_error_message_box(const char *msg_format, va_list ap)
{
+ // We want to quit after reading the capture file, hence
+ // we don't actually open the error dialog.
+ if (global_capture_opts.quit_after_cap)
+ exit(0);
+
SimpleDialog sd(gbl_cur_main_window_, ESD_TYPE_ERROR, ESD_BTN_OK, msg_format, ap);
sd.exec();
}
gchar *err_msg;
int err;
gboolean name_param;
+ gboolean ret = true;
// was a file name given as function parameter?
name_param = !cf_path.isEmpty();
if (open_dlg.open(file_name, type)) {
cf_path = file_name;
} else {
- return false;
+ ret = false;
+ goto finish;
}
}
QString before_what(tr(" before opening another file"));
if (!testCaptureFileClose(before_what)) {
- return false;
+ ret = false;
+ goto finish;
}
if (dfilter_compile(read_filter.toUtf8().constData(), &rfcode, &err_msg)) {
string and return (without changing the last containing
directory). */
capture_file_.setCapFile(NULL);
- return false;
+ ret = false;
+ goto finish;
}
break;
}
main_ui_->statusBar->showExpert();
- return true;
+finish:
+ if (global_capture_opts.quit_after_cap)
+ exit(0);
+ return ret;
}
void MainWindow::filterPackets(QString new_filter, bool force)