From 9dbf684c71acaa15c020a14ed52841c5c6dca4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Thu, 14 Nov 2019 10:34:27 +0100 Subject: [PATCH] Qt: Show custom column fields in context menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Show the custom column field name in the column context menu to improve usability when show/hide columns. The column title alone may not be sufficient to separate different columns. Change-Id: I52f249433b8090249af87725fa97eba302692918 Reviewed-on: https://code.wireshark.org/review/35088 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- ui/qt/widgets/packet_list_header.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/qt/widgets/packet_list_header.cpp b/ui/qt/widgets/packet_list_header.cpp index 8981f38643..7d12440fdb 100644 --- a/ui/qt/widgets/packet_list_header.cpp +++ b/ui/qt/widgets/packet_list_header.cpp @@ -204,7 +204,11 @@ void PacketListHeader::contextMenuEvent(QContextMenuEvent *event) contextMenu->addSeparator(); for (int cnt = 0; cnt < prefs.num_cols; cnt++) { - QAction *action = new QAction(get_column_title(cnt), this); + QString title(get_column_title(cnt)); + if (get_column_format(cnt) == COL_CUSTOM) { + title.append(QString("\t(%1)").arg(get_column_custom_fields(cnt))); + } + QAction *action = new QAction(title, this); action->setCheckable(true); action->setChecked(get_column_visible(cnt)); action->setData(QVariant::fromValue(cnt));