Qt: only Show/Export Packet Bytes when field is selected and has_packet_bytes

This will also exclude generated [] and Lua added fields.
This commit is contained in:
Chuck Craft 2021-12-22 22:09:54 -06:00 committed by A Wireshark GitLab Utility
parent b7ba126644
commit 6e9b19dcb0
4 changed files with 2 additions and 6 deletions

View File

@ -2480,7 +2480,6 @@ void WiresharkMainWindow::setMenusForCaptureFile(bool force_disable)
main_ui_->actionFileExportAsPSML->setEnabled(enable);
main_ui_->actionFileExportAsJSON->setEnabled(enable);
main_ui_->actionFileExportPacketBytes->setEnabled(enable);
main_ui_->actionFileExportPDU->setEnabled(enable);
main_ui_->actionFileStripHeaders->setEnabled(enable);
main_ui_->actionFileExportTLSSessionKeys->setEnabled(enable);
@ -2511,7 +2510,6 @@ void WiresharkMainWindow::setMenusForCaptureInProgress(bool capture_in_progress)
main_ui_->actionFileExportAsPSML->setEnabled(capture_in_progress);
main_ui_->actionFileExportAsJSON->setEnabled(capture_in_progress);
main_ui_->actionFileExportPacketBytes->setEnabled(capture_in_progress);
main_ui_->actionFileExportPDU->setEnabled(!capture_in_progress);
main_ui_->actionFileStripHeaders->setEnabled(!capture_in_progress);
main_ui_->actionFileExportTLSSessionKeys->setEnabled(capture_in_progress);

View File

@ -1406,7 +1406,7 @@ void WiresharkMainWindow::setMenusForSelectedTreeRow(FieldInformation *finfo) {
have_subtree = true;
}
if (fi && fi->ds_tvb) {
if (fi && fi->ds_tvb && (fi->length > 0)) {
have_packet_bytes = true;
}
}

View File

@ -2459,7 +2459,6 @@ void LogwolfMainWindow::setMenusForCaptureFile(bool force_disable)
main_ui_->actionFileExportAsPSML->setEnabled(enable);
main_ui_->actionFileExportAsJSON->setEnabled(enable);
main_ui_->actionFileExportPacketBytes->setEnabled(enable);
main_ui_->actionFileExportPDU->setEnabled(enable);
main_ui_->actionFileExportTLSSessionKeys->setEnabled(enable);
@ -2489,7 +2488,6 @@ void LogwolfMainWindow::setMenusForCaptureInProgress(bool capture_in_progress) {
main_ui_->actionFileExportAsPSML->setEnabled(capture_in_progress);
main_ui_->actionFileExportAsJSON->setEnabled(capture_in_progress);
main_ui_->actionFileExportPacketBytes->setEnabled(capture_in_progress);
main_ui_->actionFileExportPDU->setEnabled(!capture_in_progress);
main_ui_->actionFileExportTLSSessionKeys->setEnabled(capture_in_progress);

View File

@ -1355,7 +1355,7 @@ void LogwolfMainWindow::setMenusForSelectedTreeRow(FieldInformation *finfo) {
have_subtree = true;
}
if (fi && fi->ds_tvb) {
if (fi && fi->ds_tvb && (fi->length > 0)) {
have_packet_bytes = true;
}
}