summaryrefslogtreecommitdiff
path: root/ui/qt
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-05-19 15:05:06 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2017-05-19 21:31:50 +0000
commit6bc71e4d0a205607496c1ecb7a0dc584fe4382e2 (patch)
tree3f7fa64ad3ea8bf103e0226fecade5ccff4c0739 /ui/qt
parent4424a8e86290265f6704ce0a67ebbd2bbd13e8f5 (diff)
downloadwireshark-6bc71e4d0a205607496c1ecb7a0dc584fe4382e2.tar.gz
Qt: Add check for packet bytes
Disable menu items handling packet bytes if not having any. Bug: 13723 Change-Id: I9cdb1185910f865c61a8ee74e3cf3177159bf315 Reviewed-on: https://code.wireshark.org/review/21710 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>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/main_window_slots.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index c957a6e42a..a9db64ffc5 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -1355,6 +1355,7 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) {
bool have_field_info = false;
bool have_subtree = false;
bool can_open_url = false;
+ bool have_packet_bytes = false;
QByteArray field_filter;
int field_id = -1;
@@ -1364,6 +1365,10 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) {
if (fi && fi->tree_type != -1) {
have_subtree = true;
}
+
+ if (fi && fi->ds_tvb) {
+ have_packet_bytes = true;
+ }
}
if (capture_file_.capFile() != NULL && fi != NULL) {
@@ -1413,6 +1418,9 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) {
main_ui_->actionEditCopyValue->setEnabled(can_match_selected);
main_ui_->actionEditCopyAsFilter->setEnabled(can_match_selected);
+ main_ui_->actionContextShowPacketBytes->setEnabled(have_packet_bytes);
+ main_ui_->actionFileExportPacketBytes->setEnabled(have_packet_bytes);
+
main_ui_->actionViewExpandSubtrees->setEnabled(have_subtree);
main_ui_->actionGoGoToLinkedPacket->setEnabled(is_framenum);