diff options
Diffstat (limited to 'ui/qt/main_window_slots.cpp')
-rw-r--r-- | ui/qt/main_window_slots.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 5b6dd9760a..5400a31252 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -328,8 +328,7 @@ void MainWindow::startCapture() { guint i; /* did the user ever select a capture interface before? */ - if(global_capture_opts.num_selected == 0 && - ((prefs.capture_device == NULL) || (*prefs.capture_device != '\0'))) { + if(global_capture_opts.num_selected == 0) { QString msg = QString("No interface selected"); main_ui_->statusBar->pushTemporaryStatus(msg); return; @@ -349,6 +348,7 @@ void MainWindow::startCapture() { this capture. */ collect_ifaces(&global_capture_opts); + cfile.window = this; if (capture_start(&global_capture_opts)) { /* The capture succeeded, which means the capture filter syntax is valid; add this capture filter to the recent capture filter list. */ @@ -358,6 +358,8 @@ void MainWindow::startCapture() { // cfilter_combo_add_recent(interface_opts.cfilter); } } + } else { + cfile.window = NULL; } } @@ -617,6 +619,15 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) { } } +void MainWindow::interfaceSelectionChanged() +{ + if (global_capture_opts.num_selected > 0) { + main_ui_->actionStartCapture->setEnabled(true); + } else { + main_ui_->actionStartCapture->setEnabled(false); + } +} + // File Menu @@ -970,12 +981,8 @@ void MainWindow::on_actionStartCapture_triggered() main_ui_->mainStack->setCurrentWidget(packet_splitter_); if (global_capture_opts.num_selected == 0) { - QMessageBox::critical( - this, - tr("No Interface Selected"), - tr("You didn't specify an interface on which to capture packets."), - QMessageBox::Ok - ); + QString err_msg = tr("No Interface Selected"); + main_ui_->statusBar->pushTemporaryStatus(err_msg); return; } |