diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-12-10 21:07:26 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-12-10 21:07:26 +0000 |
commit | 1c9b5dfad3b9943bd3ea46b5e59952641e32656b (patch) | |
tree | d361e2faf02175cabb2f9ee11c932374cddb04d0 /ui/qt/proto_tree.cpp | |
parent | b007fccec3b81b52c109c8d04f890aa0b5d0a226 (diff) |
Add "Decode As" to the packet list and protocol tree context menus.
Automatically add a new item if "Decode As" is triggered from the
context menus.
svn path=/trunk/; revision=53915
Diffstat (limited to 'ui/qt/proto_tree.cpp')
-rw-r--r-- | ui/qt/proto_tree.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp index f47f41c2a5..6a44abd897 100644 --- a/ui/qt/proto_tree.cpp +++ b/ui/qt/proto_tree.cpp @@ -157,7 +157,8 @@ proto_tree_draw_node(proto_node *node, gpointer data) } ProtoTree::ProtoTree(QWidget *parent) : - QTreeWidget(parent) + QTreeWidget(parent), + decode_as_(NULL) { QMenu *submenu, *subsubmenu; @@ -232,7 +233,8 @@ ProtoTree::ProtoTree(QWidget *parent) : // " <menuitem name='ProtocolHelp' action='/ProtocolHelp'/>\n" // " <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n" ctx_menu_.addSeparator(); -// " <menuitem name='DecodeAs' action='/DecodeAs'/>\n" + decode_as_ = window()->findChild<QAction *>("actionAnalyzeDecodeAs"); + ctx_menu_.addAction(decode_as_); // " <menuitem name='DisableProtocol' action='/DisableProtocol'/>\n" // " <menuitem name='ResolveName' action='/ResolveName'/>\n" // " <menuitem name='GotoCorrespondingPacket' action='/GotoCorrespondingPacket'/>\n" @@ -252,7 +254,9 @@ void ProtoTree::clear() { void ProtoTree::contextMenuEvent(QContextMenuEvent *event) { + decode_as_->setData(qVariantFromValue(true)); ctx_menu_.exec(event->globalPos()); + decode_as_->setData(QVariant()); } void ProtoTree::fillProtocolTree(proto_tree *protocol_tree) { |