diff options
-rw-r--r-- | ui/qt/main_window.cpp | 5 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 4e2e637d91..137aae78a8 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -246,6 +246,11 @@ simple_message_box(ESD_TYPE_E type, gboolean *notagain, 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(); } diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 1bd54ce9d1..38a441b1a7 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -178,6 +178,7 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned gchar *err_msg; int err; gboolean name_param; + gboolean ret = true; // was a file name given as function parameter? name_param = !cf_path.isEmpty(); @@ -190,13 +191,15 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned 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)) { @@ -249,7 +252,8 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned string and return (without changing the last containing directory). */ capture_file_.setCapFile(NULL); - return false; + ret = false; + goto finish; } break; } @@ -258,7 +262,10 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned 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) |