mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Correctly handle empty dive list after delete
Things need to be cleared out and disabled. But fixing this bug leaves another issue - while the newly selected dive after a delete acts as if it was selected, it doesn't show up as selected in the dive list. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6ce5704435
commit
dba16202c4
3 changed files with 28 additions and 13 deletions
|
@ -134,6 +134,19 @@ void MainWindow::on_actionSaveAs_triggered()
|
|||
{
|
||||
file_save_as();
|
||||
}
|
||||
|
||||
void MainWindow::cleanUpEmpty()
|
||||
{
|
||||
ui->InfoWidget->clearStats();
|
||||
ui->InfoWidget->clearInfo();
|
||||
ui->InfoWidget->clearEquipment();
|
||||
ui->InfoWidget->updateDiveInfo(-1);
|
||||
ui->ProfileWidget->clear();
|
||||
ui->ListWidget->reload(DiveTripModel::TREE);
|
||||
ui->globe->reload();
|
||||
setTitle(MWTF_DEFAULT);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionClose_triggered()
|
||||
{
|
||||
if (unsaved_changes() && (askSaveChanges() == FALSE))
|
||||
|
@ -146,17 +159,7 @@ void MainWindow::on_actionClose_triggered()
|
|||
/* clear the selection and the statistics */
|
||||
selected_dive = -1;
|
||||
|
||||
//WARNING: Port this to Qt.
|
||||
//process_selected_dives();
|
||||
|
||||
ui->InfoWidget->clearStats();
|
||||
ui->InfoWidget->clearInfo();
|
||||
ui->InfoWidget->clearEquipment();
|
||||
ui->InfoWidget->updateDiveInfo(-1);
|
||||
ui->ProfileWidget->clear();
|
||||
ui->ListWidget->reload(DiveTripModel::TREE);
|
||||
ui->globe->reload();
|
||||
setTitle(MWTF_DEFAULT);
|
||||
cleanUpEmpty();
|
||||
mark_divelist_changed(FALSE);
|
||||
|
||||
clear_events();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue