From 971333665c1c74f22c3c6cd211f3edc5c0b28e00 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Sun, 24 Dec 2017 14:00:37 +0100 Subject: [PATCH] qt: follow stream: use the new CaptureEvent signal The signals related to capture events were refactored recently. Adjust the follow stream dialogue to use the new CaptureEvent signal instead of the now removed signal CaptureFileClosing. Filter for context==file, event==closing in the signal handler. Change-Id: I2d75b424fbf0a6734b0290aa205dd3d0c1ce053f Reviewed-on: https://code.wireshark.org/review/24980 Reviewed-by: Martin Kaiser Petri-Dish: Martin Kaiser Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ui/qt/follow_stream_dialog.cpp | 16 ++++++++++------ ui/qt/follow_stream_dialog.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index 9fc5d93421..5ea649b5ac 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -145,7 +145,8 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, follow_ this, SLOT(fillHintLabel(int))); connect(ui->teStreamContent, SIGNAL(mouseClickedOnTextCursorPosition(int)), this, SLOT(goToPacketForTextPos(int))); - connect(&cap_file_, SIGNAL(captureFileClosing()), this, SLOT(captureFileClosing())); + connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)), + this, SLOT(captureEvent(CaptureEvent *))); fillHintLabel(-1); } @@ -970,12 +971,15 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index, return true; } -void FollowStreamDialog::captureFileClosing() +void FollowStreamDialog::captureEvent(CaptureEvent *e) { - QString tooltip = tr("File closed."); - ui->streamNumberSpinBox->setToolTip(tooltip); - ui->streamNumberLabel->setToolTip(tooltip); - WiresharkDialog::captureFileClosing(); + if ((e->captureContext() == CaptureEvent::File) && + (e->eventType() == CaptureEvent::Closing)) { + QString tooltip = tr("File closed."); + ui->streamNumberSpinBox->setToolTip(tooltip); + ui->streamNumberLabel->setToolTip(tooltip); + WiresharkDialog::captureFileClosing(); + } } /* diff --git a/ui/qt/follow_stream_dialog.h b/ui/qt/follow_stream_dialog.h index 2c644c7e3a..5e210a0dd6 100644 --- a/ui/qt/follow_stream_dialog.h +++ b/ui/qt/follow_stream_dialog.h @@ -57,7 +57,7 @@ public: bool follow(QString previous_filter = QString(), bool use_stream_index = false, int stream_num = -1); public slots: - void captureFileClosing(); + void captureEvent(CaptureEvent *e); protected: bool eventFilter(QObject *obj, QEvent *event);