Fix showing all columns by default on first run.

Some columns are a nice addition, but not a must have,
and thus are hidden-by-default, uncluttering the user interface.

This was discussed with a few designers before writting the code,
and also discussed with dirk on irc.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-10-04 14:28:49 -03:00
parent 30bee57b60
commit 3c97cc5b6a

View file

@ -192,7 +192,16 @@ void DiveListView::reloadHeaderActions()
QString title = QString("%1").arg(model()->headerData(i, Qt::Horizontal).toString());
QString settingName = QString("showColumn%1").arg(i);
QAction *a = new QAction(title, header());
bool shown = s.value(settingName, true).toBool();
bool showHeaderFirstRun = !(
i == DiveTripModel::MAXCNS
|| i == DiveTripModel::NITROX
|| i == DiveTripModel::OTU
|| i == DiveTripModel::TEMPERATURE
|| i == DiveTripModel::TOTALWEIGHT
|| i == DiveTripModel::SUIT
|| i == DiveTripModel::CYLINDER
|| i == DiveTripModel::SAC );
bool shown = s.value(settingName, showHeaderFirstRun).toBool();
a->setCheckable(true);
a->setChecked(shown);
a->setProperty("index", i);