ctx_menu_.addAction(expand);
connect(expand, SIGNAL(triggered()), this, SLOT(expandTree()));
-
- connect(&cap_file_, SIGNAL(captureFileRetapStarted()),
- this, SLOT(retapStarted()));
- connect(&cap_file_, SIGNAL(captureFileRetapFinished()),
- this, SLOT(retapFinished()));
+ connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
+ this, SLOT(captureEvent(CaptureEvent *)));
setDisplayFilter();
QTimer::singleShot(0, this, SLOT(retapPackets()));
}
cap_file_.retapPackets();
}
-void ExpertInfoDialog::retapStarted()
-{
- ui->limitCheckBox->setEnabled(false);
- ui->groupBySummaryCheckBox->setEnabled(false);
-}
-
-void ExpertInfoDialog::retapFinished()
+void ExpertInfoDialog::captureEvent(CaptureEvent *e)
{
- updateWidgets();
+ if (e->captureContext() == CaptureEvent::Retap)
+ {
+ switch (e->eventType())
+ {
+ case CaptureEvent::Started:
+ ui->limitCheckBox->setEnabled(false);
+ ui->groupBySummaryCheckBox->setEnabled(false);
+ break;
+ case CaptureEvent::Finished:
+ updateWidgets();
+ break;
+ default:
+ break;
+ }
+ }
}
void ExpertInfoDialog::updateWidgets()
private slots:
void retapPackets();
- void retapStarted();
- void retapFinished();
+ void captureEvent(CaptureEvent *e);
void updateWidgets();
this, SLOT(updateWidgets()));
connect(ui->reverseTreeWidget, SIGNAL(itemSelectionChanged()),
this, SLOT(updateWidgets()));
- connect(&cap_file_, SIGNAL(captureFileClosing()),
- this, SLOT(updateWidgets()));
+ connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
+ this, SLOT(captureEvent(CaptureEvent *)));
updateWidgets();
registerTapListener("IAX2", this, NULL, 0, tapReset, tapPacket, tapDraw);
delete rev_tempfile_;
}
+void Iax2AnalysisDialog::captureEvent(CaptureEvent *e)
+{
+ if ((e->captureContext() == CaptureEvent::File) &&
+ (e->eventType() == CaptureEvent::Closing))
+ {
+ updateWidgets();
+ }
+}
+
void Iax2AnalysisDialog::updateWidgets()
{
bool enable_tab = false;
void goToPacket(int packet_num);
protected slots:
+ void captureEvent(CaptureEvent *e);
virtual void updateWidgets();
private slots:
connect(this, SIGNAL(recalcGraphData(capture_file *, bool)), iog, SLOT(recalcGraphData(capture_file *, bool)));
connect(this, SIGNAL(reloadValueUnitFields()), iog, SLOT(reloadValueUnitField()));
- connect(&cap_file_, SIGNAL(captureFileClosing()), iog, SLOT(captureFileClosing()));
+ connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
+ iog, SLOT(captureEvent(CaptureEvent *)));
connect(iog, SIGNAL(requestRetap()), this, SLOT(scheduleRetap()));
connect(iog, SIGNAL(requestRecalc()), this, SLOT(scheduleRecalc()));
connect(iog, SIGNAL(requestReplot()), this, SLOT(scheduleReplot()));
}
}
-void IOGraph::captureFileClosing()
+void IOGraph::captureEvent(CaptureEvent *e)
{
- remove_tap_listener(this);
+ if ((e->captureContext() == CaptureEvent::File) &&
+ (e->eventType() == CaptureEvent::Closing))
+ {
+ remove_tap_listener(this);
+ }
}
void IOGraph::reloadValueUnitField()
public slots:
void recalcGraphData(capture_file *cap_file, bool enable_scaling);
- void captureFileClosing();
+ void captureEvent(CaptureEvent *e);
void reloadValueUnitField();
signals:
connect(this, SIGNAL(updateFilter(QString)),
this, SLOT(updateMulticastParameters()));
- connect(&cap_file_, SIGNAL(captureFileClosing()),
- this, SLOT(captureFileClosing()));
+ connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
+ this, SLOT(captureEvent(CaptureEvent *)));
/* Register the tap listener */
register_tap_listener_mcast_stream(tapinfo_);
updateWidgets();
}
-void MulticastStatisticsDialog::captureFileClosing()
+void MulticastStatisticsDialog::captureEvent(CaptureEvent *e)
{
- /* Remove the stream tap listener */
- remove_tap_listener_mcast_stream(tapinfo_);
+ if ((e->captureContext() == CaptureEvent::File) &&
+ (e->eventType() == CaptureEvent::Closing))
+ {
+ /* Remove the stream tap listener */
+ remove_tap_listener_mcast_stream(tapinfo_);
- updateWidgets();
- WiresharkDialog::captureFileClosing();
+ updateWidgets();
+ WiresharkDialog::captureFileClosing();
+ }
}
// Stat command + args
void updateWidgets();
void updateMulticastParameters();
virtual void fillTree();
- void captureFileClosing();
+ void captureEvent(CaptureEvent *e);
};
#endif // MULTICASTSTATISTICSDIALOG_H
delete rev_tempfile_;
}
+void RtpAnalysisDialog::captureFileClosing()
+{
+ updateWidgets();
+ WiresharkDialog::captureFileClosing();
+}
+
void RtpAnalysisDialog::updateWidgets()
{
bool enable_tab = false;
signals:
void goToPacket(int packet_num);
+protected:
+ virtual void captureFileClosing();
+
protected slots:
virtual void updateWidgets();
connect(save_as_button_, SIGNAL(clicked()), this, SLOT(saveAs()));
connect(ui->buttonBox, SIGNAL(helpRequested()), this, SLOT(helpButton()));
- connect(&cap_file_, SIGNAL(captureFileClosing()), this, SLOT(captureFileClosing()));
setStartAndEnd(0, finfo_->length);
updateFieldBytes(true);
connect(wsApp, SIGNAL(addressResolutionChanged()), this, SLOT(updateWidgets()));
connect(ui->trafficTableTabWidget, SIGNAL(currentChanged(int)),
this, SLOT(currentTabChanged()));
- connect(&cap_file_, SIGNAL(captureFileRetapStarted()),
- this, SLOT(retapStarted()));
- connect(&cap_file_, SIGNAL(captureFileRetapFinished()),
- this, SLOT(retapFinished()));
+ connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
+ this, SLOT(captureEvent(CaptureEvent *)));
}
TrafficTableDialog::~TrafficTableDialog()
cap_file_.retapPackets();
}
-void TrafficTableDialog::retapStarted()
+void TrafficTableDialog::captureEvent(CaptureEvent *e)
{
- ui->displayFilterCheckBox->setEnabled(false);
-}
+ if (e->captureContext() == CaptureEvent::Retap)
+ {
+ switch (e->eventType())
+ {
+ case CaptureEvent::Started:
+ ui->displayFilterCheckBox->setEnabled(false);
+ break;
+ case CaptureEvent::Finished:
+ ui->displayFilterCheckBox->setEnabled(true);
+ break;
+ default:
+ break;
+ }
+ }
-void TrafficTableDialog::retapFinished()
-{
- ui->displayFilterCheckBox->setEnabled(true);
}
void TrafficTableDialog::setTabText(QWidget *tree, const QString &text)
void on_displayFilterCheckBox_toggled(bool checked);
void setTabText(QWidget *tree, const QString &text);
void toggleTable();
- void retapStarted();
- void retapFinished();
+ void captureEvent(CaptureEvent *e);
void copyAsCsv();
void copyAsYaml();
setWindowIcon(wsApp->normalIcon());
setWindowTitleFromSubtitle();
- connect(&cap_file_, SIGNAL(captureFileRetapStarted()), this, SLOT(beginRetapPackets()));
- connect(&cap_file_, SIGNAL(captureFileRetapFinished()), this, SLOT(endRetapPackets()));
- connect(&cap_file_, SIGNAL(captureFileClosing()), this, SLOT(captureFileClosing()));
- connect(&cap_file_, SIGNAL(captureFileClosed()), this, SLOT(captureFileClosed()));
+ connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
+ this, SLOT(captureEvent(CaptureEvent *)));
}
void WiresharkDialog::accept()
return true;
}
+void WiresharkDialog::captureEvent(CaptureEvent *e)
+{
+ switch (e->captureContext())
+ {
+ case CaptureEvent::Retap:
+ switch (e->eventType())
+ {
+ case CaptureEvent::Started:
+ beginRetapPackets();
+ break;
+ case CaptureEvent::Finished:
+ endRetapPackets();
+ break;
+ default:
+ break;
+ }
+ break;
+ case CaptureEvent::File:
+ switch (e->eventType())
+ {
+ case CaptureEvent::Closing:
+ captureFileClosing();
+ break;
+ case CaptureEvent::Closed:
+ captureFileClosed();
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+}
+
void WiresharkDialog::endRetapPackets()
{
retap_depth_--;
// XXX Unlike the entire QWidget API, parent is mandatory here.
explicit WiresharkDialog(QWidget &parent, CaptureFile &capture_file);
-signals:
-
-public slots:
/**
* @brief Mark the start of a code block that retaps packets. If the user
* closes the dialog while tapping, the dialog will not be destroyed until
*/
bool dialogClosed() { return dialog_closed_; }
-protected slots:
/**
* @brief Called when the capture file is about to close. This can be
* used to enable or disable widgets according to the state of
virtual void captureFileClosing();
virtual void captureFileClosed();
+protected slots:
+ void captureEvent(CaptureEvent *e);
+
private:
void setWindowTitleFromSubtitle();