Commit c4fc625b authored by David Jarvie's avatar David Jarvie
Browse files

Always show Name column in alarm list header context menu

parent d030daf4
Pipeline #45666 canceled with stage
......@@ -134,8 +134,6 @@ void AlarmListView::headerContextMenuRequested(const QPoint& pt)
const bool useName = Preferences::useAlarmName();
for (int col = 0, count = header()->count(); col < count; ++col)
{
if (col == AlarmListModel::NameColumn && !useName)
continue;
const QString title = almodel->headerData(col, Qt::Horizontal, ResourceDataModelBase::ColumnTitleRole).toString();
if (!title.isEmpty())
{
......@@ -143,6 +141,9 @@ void AlarmListView::headerContextMenuRequested(const QPoint& pt)
act->setData(col);
act->setCheckable(true);
act->setChecked(!header()->isSectionHidden(col));
// Always show Name column, but disabled.
// If the alarm name feature is not enabled, this serves as a small
// hint to the user that the name feature exists.
if (col == AlarmListModel::NameColumn)
act->setEnabled(false); // don't allow name column to be hidden if name is used
else if (col == AlarmListModel::TextColumn && !useName)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment