diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-08-14 09:12:21 -0400 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-11 16:22:27 -0700 |
commit | 3c6cdfd8c02e215f98986cbb74b33f58e47fe632 (patch) | |
tree | 206a1eb2bb427df36abe4b08160673dde9bf667b /desktop-widgets/mainwindow.cpp | |
parent | b16be29595f09daa422c2c07075d3b8b60e7fad9 (diff) | |
download | subsurface-3c6cdfd8c02e215f98986cbb74b33f58e47fe632.tar.gz |
Dive list: propagate current-item to frontend
The command-objects select a current item, but this selection
was not propagated to the front-end. The current item is the
base for keyboard-navigation through the dive-list and therefore
should be set correctly.
It took some experimentation to get the flags right:
QItemSelectionModel::Current
Hopefully, these are the correct flags across all supported
Qt versions!
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 72b4e4720..625c094c1 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -530,10 +530,16 @@ void MainWindow::configureToolbar() { void MainWindow::selectionChanged() { - graphics()->plotDive(nullptr, false, true); - information()->updateDiveInfo(); - configureToolbar(); - MapWidget::instance()->reload(); + if (!current_dive) { + information()->clearTabs(); + information()->updateDiveInfo(true); + graphics()->setEmptyState(); + } else { + graphics()->plotDive(nullptr, false, true); + information()->updateDiveInfo(); + configureToolbar(); + MapWidget::instance()->reload(); + } } void MainWindow::on_actionNew_triggered() |