diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-03-22 09:25:34 -0700 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-04-15 09:03:01 +0000 |
commit | d6f69751c00f50e29f6f46d37b673522ded51437 (patch) | |
tree | e30a10fe28078142bd36f68b230c16cea5fe1348 /ui/qt/conversation_colorize_action.cpp | |
parent | ac8e08b6c732b7289c3baeb7dcfb8ffb0b93135a (diff) |
Qt: Make some menu items discoverable (or not).
Enable and disable individual actions instead of their parent menus in
order to keep them discoverable.
Do the opposite for Colorize Conversation items so that we don't make
the user traverse the menu hierarchy unnecessarily.
Change-Id: I81770dbbb2d715a2131eb754fedaaadcc8803da2
Reviewed-on: https://code.wireshark.org/review/14558
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/qt/conversation_colorize_action.cpp')
-rw-r--r-- | ui/qt/conversation_colorize_action.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/qt/conversation_colorize_action.cpp b/ui/qt/conversation_colorize_action.cpp index 63b1d9b001..f3b846efd5 100644 --- a/ui/qt/conversation_colorize_action.cpp +++ b/ui/qt/conversation_colorize_action.cpp @@ -27,6 +27,8 @@ #include "epan/dissector_filters.h" +#include <QMenu> + #include "qt_ui_utils.h" ConversationAction::ConversationAction(QObject *parent, conversation_filter_s *conv_filter) : @@ -49,6 +51,11 @@ void ConversationAction::setPacketInfo(struct _packet_info *pinfo) } } setEnabled(enable); + + // If we're the "New Coloring Rule" item, enable or disable our parent menu. + QMenu *parent_submenu = qobject_cast<QMenu *>(parentWidget()); + if (color_number_ > 0 || !parent_submenu) return; + parent_submenu->setEnabled(enable); } void ConversationAction::setFieldFilter(const QByteArray field_filter) |