aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/protocol_preferences_menu.cpp
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2017-05-04 14:21:27 +0200
committerMichael Mann <mmann78@netscape.net>2017-05-04 21:20:42 +0000
commit8e52cfb891aa5de7b20f5dbd8471609e6c6ca40d (patch)
tree539b05a985f1d6861a15e771267243c844d98db5 /ui/qt/protocol_preferences_menu.cpp
parent8bed61f9fcc83e98b22d4c4b4408c7b6b276e78c (diff)
Qt: Inhibit Disable Protocol when applicable
The packet details context menu allows you, through the Protocol Preferences sub menu to manipulate (disable) the protocol dissection through the Disable <protocol>... option. This opens up the appropriate dialog and select the applicable protocol. This fails for protocols which have their can_toggle flag reset (e.g. the frame protocol). The dialog opens, but the protocol can't be found, hence the top item is selected. Instead disable the menu option for protocols which can't have their enabled state toggled. Change-Id: Ifa83f656a8ab747f379d3ca0114520e5efed4b67 Reviewed-on: https://code.wireshark.org/review/21494 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/protocol_preferences_menu.cpp')
-rw-r--r--ui/qt/protocol_preferences_menu.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/ui/qt/protocol_preferences_menu.cpp b/ui/qt/protocol_preferences_menu.cpp
index f16aded36e..96543c586d 100644
--- a/ui/qt/protocol_preferences_menu.cpp
+++ b/ui/qt/protocol_preferences_menu.cpp
@@ -172,6 +172,7 @@ void ProtocolPreferencesMenu::setModule(const char *module_name)
QAction *disable_action = new QAction(tr("Disable %1" UTF8_HORIZONTAL_ELLIPSIS).arg(short_name), this);
connect(disable_action, SIGNAL(triggered(bool)), this, SLOT(disableProtocolTriggered()));
+ disable_action->setDisabled(!proto_can_toggle_protocol(proto_id));
module_ = prefs_find_module(module_name);
if (!module_ || !prefs_is_registered_protocol(module_name)) {