void MainWindow::on_actionClose_triggered() { if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING || ui.InfoWidget->isEditing()) { QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file.")); return; } if (unsaved_changes() && (askSaveChanges() == false)) return; ui.newProfile->setEmptyState(); /* free the dives and trips */ clear_git_id(); while (dive_table.nr) delete_single_dive(0); dive_list()->clearSelection(); /* clear the selection and the statistics */ selected_dive = -1; if (existing_filename) { free((void *)existing_filename); existing_filename = NULL; } cleanUpEmpty(); mark_divelist_changed(false); clear_events(); }
void MainWindow::closeCurrentFile() { ui.newProfile->setEmptyState(); /* free the dives and trips */ clear_git_id(); while (dive_table.nr) delete_single_dive(0); free((void *)existing_filename); existing_filename = NULL; cleanUpEmpty(); mark_divelist_changed(false); clear_events(); }
// this gets called after we download dives from a divecomputer void MainWindow::refreshDisplay(bool doRecreateDiveList) { getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error); information()->reload(); TankInfoModel::instance()->update(); globe()->reload(); if (doRecreateDiveList) recreateDiveList(); setApplicationState("Default"); dive_list()->setEnabled(true); dive_list()->setFocus(); WSInfoModel::instance()->updateInfo(); if (amount_selected == 0) cleanUpEmpty(); }
void MainWindow::on_actionClose_triggered() { if (unsaved_changes() && (askSaveChanges() == FALSE)) return; /* free the dives and trips */ while (dive_table.nr) delete_single_dive(0); /* clear the selection and the statistics */ selected_dive = -1; cleanUpEmpty(); mark_divelist_changed(FALSE); clear_events(); }
// this gets called after we download dives from a divecomputer void MainWindow::refreshDisplay(bool doRecreateDiveList) { showError(get_error_string()); ui.InfoWidget->reload(); TankInfoModel::instance()->update(); ui.globe->reload(); if (doRecreateDiveList) recreateDiveList(); ui.diveListPane->setCurrentIndex(0); // switch to the dive list #ifdef NO_MARBLE ui.globePane->hide(); #endif ui.globePane->setCurrentIndex(0); ui.ListWidget->setEnabled(true); ui.ListWidget->setFocus(); WSInfoModel::instance()->updateInfo(); if (amount_selected == 0) cleanUpEmpty(); }