forked from osmocom/wireshark
Qt: Protect against unintentional "no capture file" window status
If capture file was closed and we have some WiresharkDialogs opened, then we still need to know filename of capture file related to specific dialog. Change-Id: I15f0e5176b87713bf747eead64021619d0bdf039 Reviewed-on: https://code.wireshark.org/review/11025 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
parent
08e44b8b43
commit
78978ec63f
|
@ -84,9 +84,8 @@ const QString CaptureFile::fileName()
|
|||
if (isValid()) {
|
||||
QFileInfo cfi(QString::fromUtf8(cap_file_->filename));
|
||||
file_name_ = cfi.baseName();
|
||||
} else {
|
||||
file_name_ = no_capture_file_;
|
||||
}
|
||||
|
||||
return file_name_;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,8 @@ void CaptureFilePropertiesDialog::updateWidgets()
|
|||
|
||||
fillDetails();
|
||||
ui->commentsTextEdit->setText(cf_read_shb_comment(cap_file_.capFile()));
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
static const QString section_tmpl_ = "<p><strong>%1</strong></p>\n";
|
||||
|
|
|
@ -200,6 +200,8 @@ void FollowStreamDialog::updateWidgets(bool follow_in_progress)
|
|||
ui->leFind->setEnabled(enable);
|
||||
ui->bFind->setEnabled(enable);
|
||||
b_filter_out_->setEnabled(enable);
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
void FollowStreamDialog::findText(bool go_back)
|
||||
|
|
|
@ -333,6 +333,8 @@ void GsmMapSummaryDialog::updateWidgets()
|
|||
// }
|
||||
|
||||
ui->summaryTextEdit->setHtml(summaryToHtml());
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
|
|
@ -460,6 +460,8 @@ void Iax2AnalysisDialog::updateWidgets()
|
|||
hint.prepend("<small><i>");
|
||||
hint.append("</i></small>");
|
||||
ui->hintLabel->setText(hint);
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
void Iax2AnalysisDialog::on_actionGoToPacket_triggered()
|
||||
|
|
|
@ -441,6 +441,7 @@ void IOGraphDialog::syncGraphSettings(QTreeWidgetItem *item)
|
|||
|
||||
void IOGraphDialog::updateWidgets()
|
||||
{
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
void IOGraphDialog::scheduleReplot(bool now)
|
||||
|
|
|
@ -831,6 +831,8 @@ void LteMacStatisticsDialog::captureFileClosing()
|
|||
{
|
||||
remove_tap_listener(this);
|
||||
updateWidgets();
|
||||
|
||||
WiresharkDialog::captureFileClosing();
|
||||
}
|
||||
|
||||
// Stat command + args
|
||||
|
|
|
@ -895,6 +895,8 @@ void LteRlcStatisticsDialog::captureFileClosing()
|
|||
{
|
||||
remove_tap_listener(this);
|
||||
updateWidgets();
|
||||
|
||||
WiresharkDialog::captureFileClosing();
|
||||
}
|
||||
|
||||
// Launch a UL graph for the currently-selected channel.
|
||||
|
|
|
@ -293,6 +293,8 @@ QString Mtp3SummaryDialog::summaryToHtml()
|
|||
void Mtp3SummaryDialog::updateWidgets()
|
||||
{
|
||||
ui->summaryTextEdit->setHtml(summaryToHtml());
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
|
|
@ -449,6 +449,7 @@ void MulticastStatisticsDialog::captureFileClosing()
|
|||
remove_tap_listener_mcast_stream(tapinfo_);
|
||||
|
||||
updateWidgets();
|
||||
WiresharkDialog::captureFileClosing();
|
||||
}
|
||||
|
||||
// Stat command + args
|
||||
|
|
|
@ -304,6 +304,8 @@ void ProtocolHierarchyDialog::updateWidgets()
|
|||
}
|
||||
hint += "</i></small>";
|
||||
ui->hintLabel->setText(hint);
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
QList<QVariant> ProtocolHierarchyDialog::protoHierRowData(QTreeWidgetItem *item) const
|
||||
|
|
|
@ -449,6 +449,8 @@ void RtpAnalysisDialog::updateWidgets()
|
|||
hint.prepend("<small><i>");
|
||||
hint.append("</i></small>");
|
||||
ui->hintLabel->setText(hint);
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
void RtpAnalysisDialog::on_actionGoToPacket_triggered()
|
||||
|
|
|
@ -418,6 +418,8 @@ void RtpStreamDialog::updateWidgets()
|
|||
ui->actionCopyAsCsv->setEnabled(has_data);
|
||||
ui->actionCopyAsYaml->setEnabled(has_data);
|
||||
ui->actionAnalyze->setEnabled(selected);
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
QList<QVariant> RtpStreamDialog::streamRowData(int row) const
|
||||
|
|
|
@ -150,6 +150,7 @@ SequenceDialog::~SequenceDialog()
|
|||
|
||||
void SequenceDialog::updateWidgets()
|
||||
{
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
void SequenceDialog::showEvent(QShowEvent *)
|
||||
|
|
|
@ -512,6 +512,8 @@ void TapParameterDialog::updateWidgets()
|
|||
}
|
||||
ui->displayFilterLineEdit->setEnabled(edit_enable);
|
||||
ui->applyFilterButton->setEnabled(apply_enable);
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
void TapParameterDialog::on_applyFilterButton_clicked()
|
||||
|
|
|
@ -86,7 +86,6 @@ TrafficTableDialog::TrafficTableDialog(QWidget &parent, CaptureFile &cf, const c
|
|||
|
||||
connect(ui->trafficTableTabWidget, SIGNAL(currentChanged(int)),
|
||||
this, SLOT(itemSelectionChanged()));
|
||||
connect(&cap_file_, SIGNAL(captureFileClosing()), this, SLOT(captureFileClosing()));
|
||||
}
|
||||
|
||||
TrafficTableDialog::~TrafficTableDialog()
|
||||
|
@ -224,6 +223,8 @@ void TrafficTableDialog::updateWidgets()
|
|||
}
|
||||
ui->trafficTableTabWidget->setCurrentWidget(cur_w);
|
||||
ui->trafficTableTabWidget->setUpdatesEnabled(true);
|
||||
|
||||
WiresharkDialog::updateWidgets();
|
||||
}
|
||||
|
||||
QList<QVariant> TrafficTableDialog::curTreeRowData(int row) const
|
||||
|
|
|
@ -52,7 +52,7 @@ WiresharkDialog::WiresharkDialog(QWidget &, CaptureFile &capture_file) :
|
|||
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(captureFileClosing()));
|
||||
connect(&cap_file_, SIGNAL(captureFileClosed()), this, SLOT(captureFileClosed()));
|
||||
}
|
||||
|
||||
void WiresharkDialog::accept()
|
||||
|
@ -142,12 +142,23 @@ void WiresharkDialog::removeTapListeners()
|
|||
|
||||
void WiresharkDialog::captureFileClosing()
|
||||
{
|
||||
if (file_closed_)
|
||||
return;
|
||||
|
||||
removeTapListeners();
|
||||
file_closed_ = true;
|
||||
setWindowTitleFromSubtitle();
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
void WiresharkDialog::captureFileClosed()
|
||||
{
|
||||
if (file_closed_)
|
||||
return;
|
||||
|
||||
removeTapListeners();
|
||||
updateWidgets();
|
||||
file_closed_ = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Editor modelines
|
||||
*
|
||||
|
|
|
@ -130,6 +130,7 @@ protected slots:
|
|||
* file_closed_.
|
||||
*/
|
||||
virtual void captureFileClosing();
|
||||
virtual void captureFileClosed();
|
||||
|
||||
private:
|
||||
void setWindowTitleFromSubtitle();
|
||||
|
|
|
@ -639,6 +639,8 @@ void WlanStatisticsDialog::captureFileClosing()
|
|||
{
|
||||
remove_tap_listener(this);
|
||||
updateWidgets();
|
||||
|
||||
WiresharkDialog::captureFileClosing();
|
||||
}
|
||||
|
||||
// Stat command + args
|
||||
|
|
Loading…
Reference in New Issue