summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-14 17:52:03 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-14 17:58:14 +0900
commitdfd17c7a7fd1f5dd85f61a6feef96c616e02cfcb (patch)
tree1a319e3029bd13436ae266f7f1658a8ccd9bb92f /qt-ui/mainwindow.cpp
parent179615f3a9a7a657f9039e124865b2f449ddb703 (diff)
downloadsubsurface-dfd17c7a7fd1f5dd85f61a6feef96c616e02cfcb.tar.gz
Maintain the selection when aborting "dive add"
We remember what was selected before and restore it. Maybe there's a more "Qt way" of doing this, but my implementation appears to work :-) Also remove unconditional debug output that snuck into an earlier commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 527441083..3222d4887 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -65,12 +65,13 @@ MainWindow::MainWindow() : helpView(0)
}
// this gets called after we download dives from a divecomputer
-void MainWindow::refreshDisplay()
+void MainWindow::refreshDisplay(bool recreateDiveList)
{
ui.InfoWidget->reload();
ui.ProfileWidget->refresh();
ui.globe->reload();
- ui.ListWidget->reload(DiveTripModel::CURRENT);
+ if (recreateDiveList)
+ ui.ListWidget->reload(DiveTripModel::CURRENT);
ui.ListWidget->setFocus();
WSInfoModel *wsim = WSInfoModel::instance();
wsim->updateInfo();
@@ -282,8 +283,7 @@ void MainWindow::on_actionAddDive_triggered()
QMessageBox::warning(this, tr("Warning"), "First finish the current edition before trying to do another." );
return;
}
-
- // clear the selection
+ dive_list()->rememberSelection();
dive_list()->unselectDives();
disableDcShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);