Qt: Show custom column fields in context menu

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 <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Stig Bjørlykke 2019-11-14 10:34:27 +01:00 committed by Roland Knall
parent 7da6109f3b
commit 9dbf684c71
1 changed files with 5 additions and 1 deletions

View File

@ -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));