Qt: setMenusForSelectedPacket when capture file is closed.

Moved setMenusForSelectedPacket() to captureFileClosed() because
capture_file_.capFile() is still valid in captureFileClosing().

Menu items depending on is_ip, is_tcp, is_udp, is_sctp, is_ssl,
is_rtp and is_lte_rlc must be disabled when closing the capture
file because many of the dialogs does crash when launched without
a valid frame selected.

All dialogs should probably have a guard for this to avoid crashes,
but that may be an exercise for an enhancement to add support for the
dialogs to follow the current loaded capture file.

Change-Id: If5837a355d08df76547572a25d46ffa539070de3
Reviewed-on: https://code.wireshark.org/review/11883
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2015-11-16 21:33:17 +01:00
parent c3025544b6
commit 062e5b3118
1 changed files with 2 additions and 2 deletions

View File

@ -698,7 +698,6 @@ void MainWindow::captureFileRetapFinished()
void MainWindow::captureFileClosing() {
setMenusForCaptureFile(true);
setForCapturedPackets(false);
setMenusForSelectedPacket();
setForCaptureInProgress(false);
// Reset expert information indicator
@ -722,6 +721,7 @@ void MainWindow::captureFileClosed() {
main_ui_->statusBar->popFileStatus();
setTitlebarForSelectedTreeRow();
setMenusForSelectedPacket();
setMenusForSelectedTreeRow();
if (!global_capture_opts.multi_files_on)
@ -1127,7 +1127,7 @@ void MainWindow::setMenusForSelectedPacket()
bool enable = false;
QString filter;
if (capture_file_.capFile()->edt) {
if (capture_file_.capFile() && capture_file_.capFile()->edt) {
enable = conv_filter->is_filter_valid(&capture_file_.capFile()->edt->pi);
filter = gchar_free_to_qstring(conv_filter->build_filter_string(&capture_file_.capFile()->edt->pi));
}