diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-08-21 15:02:20 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-08-22 01:29:06 +0000 |
commit | 74177d90d32b485adc3fb83c703e712af6e46663 (patch) | |
tree | da9b2b647041179c78aff68f188a41b05ce60444 | |
parent | a66a95c7addef022b3f55255dada4232a46ca4d5 (diff) | |
download | wireshark-74177d90d32b485adc3fb83c703e712af6e46663.tar.gz |
Statistics dialog fixups.
Fix the "retap on show" behavior in TapParameterDialog. It was filling
in the tree when it shouldn't have.
Set the capture stop flag when WiresharkDialog closes.
Change-Id: I5e85f11cab32e8b958deabb58186a855b5fcaa84
Reviewed-on: https://code.wireshark.org/review/10186
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r-- | ui/qt/multicast_statistics_dialog.cpp | 1 | ||||
-rw-r--r-- | ui/qt/tap_parameter_dialog.cpp | 18 | ||||
-rw-r--r-- | ui/qt/tap_parameter_dialog.h | 6 | ||||
-rw-r--r-- | ui/qt/wireshark_dialog.cpp | 4 |
4 files changed, 20 insertions, 9 deletions
diff --git a/ui/qt/multicast_statistics_dialog.cpp b/ui/qt/multicast_statistics_dialog.cpp index dd2f521ddf..bc046f210e 100644 --- a/ui/qt/multicast_statistics_dialog.cpp +++ b/ui/qt/multicast_statistics_dialog.cpp @@ -256,7 +256,6 @@ MulticastStatisticsDialog::MulticastStatisticsDialog(QWidget &parent, CaptureFil register_tap_listener_mcast_stream(tapinfo_); updateWidgets(); - QTimer::singleShot(0, this, SLOT(fillTree())); } MulticastStatisticsDialog::~MulticastStatisticsDialog() diff --git a/ui/qt/tap_parameter_dialog.cpp b/ui/qt/tap_parameter_dialog.cpp index 229ddc01d7..f257eae38c 100644 --- a/ui/qt/tap_parameter_dialog.cpp +++ b/ui/qt/tap_parameter_dialog.cpp @@ -75,8 +75,7 @@ const QString TapParameterDialog::action_name_ = "TapParameterAction"; TapParameterDialog::TapParameterDialog(QWidget &parent, CaptureFile &cf, int help_topic) : WiresharkDialog(parent, cf), ui(new Ui::TapParameterDialog), - help_topic_(help_topic), - retap_on_show_(true) + help_topic_(help_topic) { ui->setupUi(this); @@ -107,14 +106,15 @@ TapParameterDialog::TapParameterDialog(QWidget &parent, CaptureFile &cf, int hel QString filter = ui->displayFilterLineEdit->text(); emit updateFilter(filter, true); } - if (retap_on_show_) { - QTimer::singleShot(0, this, SLOT(fillTree())); - } + show_timer_ = new QTimer(this); + setRetapOnShow(true); } TapParameterDialog::~TapParameterDialog() { delete ui; + show_timer_->stop(); + delete show_timer_; } void TapParameterDialog::registerDialog(const QString title, const char *cfg_abbr, register_stat_group_t group, stat_tap_init_cb tap_init_cb, tpdCreator creator) @@ -190,6 +190,14 @@ void TapParameterDialog::setHint(const QString &hint) ui->hintLabel->show(); } +void TapParameterDialog::setRetapOnShow(bool retap) +{ + show_timer_->stop(); + if (retap) { + show_timer_->singleShot(0, this, SLOT(fillTree())); + } +} + void TapParameterDialog::filterActionTriggered() { FilterAction *fa = qobject_cast<FilterAction *>(QObject::sender()); diff --git a/ui/qt/tap_parameter_dialog.h b/ui/qt/tap_parameter_dialog.h index 5d9354bf5b..d91a44f379 100644 --- a/ui/qt/tap_parameter_dialog.h +++ b/ui/qt/tap_parameter_dialog.h @@ -81,8 +81,8 @@ protected: QString displayFilter(); void setDisplayFilter(const QString &filter); void setHint(const QString &hint); - // Retap packets on showEvent. RPC stats need to disable this. - void setRetapOnShow(bool retap = false) { retap_on_show_ = retap; } + // Retap packets on first display. RPC stats need to disable this. + void setRetapOnShow(bool retap); protected slots: void filterActionTriggered(); @@ -94,7 +94,7 @@ private: QList<QAction *> filter_actions_; int help_topic_; static const QString action_name_; - bool retap_on_show_; + QTimer *show_timer_; virtual const QString filterExpression() { return QString(); } QString itemDataToPlain(QVariant var, int width = 0); diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp index 87403ade60..d816a4b553 100644 --- a/ui/qt/wireshark_dialog.cpp +++ b/ui/qt/wireshark_dialog.cpp @@ -52,6 +52,8 @@ WiresharkDialog::WiresharkDialog(QWidget &, CaptureFile &capture_file) : void WiresharkDialog::accept() { + // Cancel any taps in progress. + cap_file_.setCaptureStopFlag(); // We need to make sure our destructor is called. deleteLater(); QDialog::accept(); @@ -60,6 +62,8 @@ void WiresharkDialog::accept() // XXX Should we do this in WiresharkDialog? void WiresharkDialog::reject() { + // Cancel any taps in progress. + cap_file_.setCaptureStopFlag(); // We need to make sure our destructor is called. deleteLater(); QDialog::reject(); |