aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2015-09-25 11:05:45 +0200
committerGerald Combs <gerald@wireshark.org>2015-10-27 16:45:19 +0000
commit78978ec63fc09c644131ce2472eec5fcf405b588 (patch)
tree7861ded888e287869703b8d3b8d5689102814079
parent08e44b8b43ad4234a93b8feaa8e8174373188080 (diff)
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>
-rw-r--r--ui/qt/capture_file.cpp3
-rw-r--r--ui/qt/capture_file_properties_dialog.cpp2
-rw-r--r--ui/qt/follow_stream_dialog.cpp2
-rw-r--r--ui/qt/gsm_map_summary_dialog.cpp2
-rw-r--r--ui/qt/iax2_analysis_dialog.cpp2
-rw-r--r--ui/qt/io_graph_dialog.cpp1
-rw-r--r--ui/qt/lte_mac_statistics_dialog.cpp2
-rw-r--r--ui/qt/lte_rlc_statistics_dialog.cpp2
-rw-r--r--ui/qt/mtp3_summary_dialog.cpp2
-rw-r--r--ui/qt/multicast_statistics_dialog.cpp1
-rw-r--r--ui/qt/protocol_hierarchy_dialog.cpp2
-rw-r--r--ui/qt/rtp_analysis_dialog.cpp2
-rw-r--r--ui/qt/rtp_stream_dialog.cpp2
-rw-r--r--ui/qt/sequence_dialog.cpp1
-rw-r--r--ui/qt/tap_parameter_dialog.cpp2
-rw-r--r--ui/qt/traffic_table_dialog.cpp3
-rw-r--r--ui/qt/wireshark_dialog.cpp17
-rw-r--r--ui/qt/wireshark_dialog.h1
-rw-r--r--ui/qt/wlan_statistics_dialog.cpp2
19 files changed, 45 insertions, 6 deletions
diff --git a/ui/qt/capture_file.cpp b/ui/qt/capture_file.cpp
index 92b9677fcf..e7860c4768 100644
--- a/ui/qt/capture_file.cpp
+++ b/ui/qt/capture_file.cpp
@@ -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_;
}
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index 5e52a0f461..50672af9dd 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -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";
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index 72396259ed..a017cbcd2d 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -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)
diff --git a/ui/qt/gsm_map_summary_dialog.cpp b/ui/qt/gsm_map_summary_dialog.cpp
index 8edb1a7133..b813f48772 100644
--- a/ui/qt/gsm_map_summary_dialog.cpp
+++ b/ui/qt/gsm_map_summary_dialog.cpp
@@ -333,6 +333,8 @@ void GsmMapSummaryDialog::updateWidgets()
// }
ui->summaryTextEdit->setHtml(summaryToHtml());
+
+ WiresharkDialog::updateWidgets();
}
extern "C" {
diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp
index f7dc5279a7..cd860c2683 100644
--- a/ui/qt/iax2_analysis_dialog.cpp
+++ b/ui/qt/iax2_analysis_dialog.cpp
@@ -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()
diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp
index 0605cb81ce..86f37f528c 100644
--- a/ui/qt/io_graph_dialog.cpp
+++ b/ui/qt/io_graph_dialog.cpp
@@ -441,6 +441,7 @@ void IOGraphDialog::syncGraphSettings(QTreeWidgetItem *item)
void IOGraphDialog::updateWidgets()
{
+ WiresharkDialog::updateWidgets();
}
void IOGraphDialog::scheduleReplot(bool now)
diff --git a/ui/qt/lte_mac_statistics_dialog.cpp b/ui/qt/lte_mac_statistics_dialog.cpp
index 4e458a784d..7fc0ef635d 100644
--- a/ui/qt/lte_mac_statistics_dialog.cpp
+++ b/ui/qt/lte_mac_statistics_dialog.cpp
@@ -831,6 +831,8 @@ void LteMacStatisticsDialog::captureFileClosing()
{
remove_tap_listener(this);
updateWidgets();
+
+ WiresharkDialog::captureFileClosing();
}
// Stat command + args
diff --git a/ui/qt/lte_rlc_statistics_dialog.cpp b/ui/qt/lte_rlc_statistics_dialog.cpp
index f0c57c9563..da746df072 100644
--- a/ui/qt/lte_rlc_statistics_dialog.cpp
+++ b/ui/qt/lte_rlc_statistics_dialog.cpp
@@ -895,6 +895,8 @@ void LteRlcStatisticsDialog::captureFileClosing()
{
remove_tap_listener(this);
updateWidgets();
+
+ WiresharkDialog::captureFileClosing();
}
// Launch a UL graph for the currently-selected channel.
diff --git a/ui/qt/mtp3_summary_dialog.cpp b/ui/qt/mtp3_summary_dialog.cpp
index 5c33dab078..791318f7a0 100644
--- a/ui/qt/mtp3_summary_dialog.cpp
+++ b/ui/qt/mtp3_summary_dialog.cpp
@@ -293,6 +293,8 @@ QString Mtp3SummaryDialog::summaryToHtml()
void Mtp3SummaryDialog::updateWidgets()
{
ui->summaryTextEdit->setHtml(summaryToHtml());
+
+ WiresharkDialog::updateWidgets();
}
extern "C" {
diff --git a/ui/qt/multicast_statistics_dialog.cpp b/ui/qt/multicast_statistics_dialog.cpp
index 6c06ff6904..b18ee6d5a8 100644
--- a/ui/qt/multicast_statistics_dialog.cpp
+++ b/ui/qt/multicast_statistics_dialog.cpp
@@ -449,6 +449,7 @@ void MulticastStatisticsDialog::captureFileClosing()
remove_tap_listener_mcast_stream(tapinfo_);
updateWidgets();
+ WiresharkDialog::captureFileClosing();
}
// Stat command + args
diff --git a/ui/qt/protocol_hierarchy_dialog.cpp b/ui/qt/protocol_hierarchy_dialog.cpp
index 318d416869..3cd14ea6da 100644
--- a/ui/qt/protocol_hierarchy_dialog.cpp
+++ b/ui/qt/protocol_hierarchy_dialog.cpp
@@ -304,6 +304,8 @@ void ProtocolHierarchyDialog::updateWidgets()
}
hint += "</i></small>";
ui->hintLabel->setText(hint);
+
+ WiresharkDialog::updateWidgets();
}
QList<QVariant> ProtocolHierarchyDialog::protoHierRowData(QTreeWidgetItem *item) const
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index 451e09f659..61e8c5cbff 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -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()
diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp
index eebb8db7e2..80b8171e74 100644
--- a/ui/qt/rtp_stream_dialog.cpp
+++ b/ui/qt/rtp_stream_dialog.cpp
@@ -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
diff --git a/ui/qt/sequence_dialog.cpp b/ui/qt/sequence_dialog.cpp
index d96036b8a9..a580c7a0af 100644
--- a/ui/qt/sequence_dialog.cpp
+++ b/ui/qt/sequence_dialog.cpp
@@ -150,6 +150,7 @@ SequenceDialog::~SequenceDialog()
void SequenceDialog::updateWidgets()
{
+ WiresharkDialog::updateWidgets();
}
void SequenceDialog::showEvent(QShowEvent *)
diff --git a/ui/qt/tap_parameter_dialog.cpp b/ui/qt/tap_parameter_dialog.cpp
index 969c8d9996..5eab869e24 100644
--- a/ui/qt/tap_parameter_dialog.cpp
+++ b/ui/qt/tap_parameter_dialog.cpp
@@ -512,6 +512,8 @@ void TapParameterDialog::updateWidgets()
}
ui->displayFilterLineEdit->setEnabled(edit_enable);
ui->applyFilterButton->setEnabled(apply_enable);
+
+ WiresharkDialog::updateWidgets();
}
void TapParameterDialog::on_applyFilterButton_clicked()
diff --git a/ui/qt/traffic_table_dialog.cpp b/ui/qt/traffic_table_dialog.cpp
index dd75b0c429..abfcb7b00c 100644
--- a/ui/qt/traffic_table_dialog.cpp
+++ b/ui/qt/traffic_table_dialog.cpp
@@ -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
diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp
index ec9baa579f..a8a436bd06 100644
--- a/ui/qt/wireshark_dialog.cpp
+++ b/ui/qt/wireshark_dialog.cpp
@@ -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,10 +142,21 @@ void WiresharkDialog::removeTapListeners()
void WiresharkDialog::captureFileClosing()
{
+ if (file_closed_)
+ return;
+
+ removeTapListeners();
+ updateWidgets();
+}
+
+void WiresharkDialog::captureFileClosed()
+{
+ if (file_closed_)
+ return;
+
removeTapListeners();
- file_closed_ = true;
- setWindowTitleFromSubtitle();
updateWidgets();
+ file_closed_ = true;
}
/*
diff --git a/ui/qt/wireshark_dialog.h b/ui/qt/wireshark_dialog.h
index 754e5302a6..c4f2bc1e30 100644
--- a/ui/qt/wireshark_dialog.h
+++ b/ui/qt/wireshark_dialog.h
@@ -130,6 +130,7 @@ protected slots:
* file_closed_.
*/
virtual void captureFileClosing();
+ virtual void captureFileClosed();
private:
void setWindowTitleFromSubtitle();
diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp
index 8842a8c1ae..3a21c92f8e 100644
--- a/ui/qt/wlan_statistics_dialog.cpp
+++ b/ui/qt/wlan_statistics_dialog.cpp
@@ -639,6 +639,8 @@ void WlanStatisticsDialog::captureFileClosing()
{
remove_tap_listener(this);
updateWidgets();
+
+ WiresharkDialog::captureFileClosing();
}
// Stat command + args