summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-03 12:50:11 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-03 12:53:33 -0700
commitce5fc7d0ec32f41d9cfe4d97cba6a5a0fe373f2f (patch)
treec8c421c71b600bb1f5b0e03ec032b2b8053ced2f /qt-ui
parent0a19a964e09e31016b39ee2d65f6220b01c49dcb (diff)
downloadsubsurface-ce5fc7d0ec32f41d9cfe4d97cba6a5a0fe373f2f.tar.gz
Select the first dive
This works regardless whether the first dive is in a trip or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index aac829ef1..93ea3d615 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -325,6 +325,12 @@ void MainWindow::readSettings()
ui->ListWidget->resizeColumnToContents(i);
}
ui->ListWidget->collapseAll();
+ ui->ListWidget->expand(sortModel->index(0,0));
+ QModelIndex firstDiveOrTrip = sortModel->index(0,0);
+ if (sortModel->index(0,0, firstDiveOrTrip).isValid())
+ ui->ListWidget->setCurrentIndex(sortModel->index(0,0, firstDiveOrTrip));
+ else
+ ui->ListWidget->setCurrentIndex(firstDiveOrTrip);
settings.endGroup();
}