From 3c97cc5b6aef9dad9b8a9067b8c3e207a67ab314 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 4 Oct 2013 14:28:49 -0300 Subject: 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 --- qt-ui/divelistview.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'qt-ui/divelistview.cpp') diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 0996130c4..6ed77fb19 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -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); -- cgit v1.2.3-70-g09d2