From dcd83817648ed227a4a3453923e29a662fa2cc67 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 25 May 2014 15:15:57 -0300 Subject: Planner: Move method down below to easy comparisson with another. Planner and add states are driving me nuts. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 2bfeca64e..801268a08 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -295,30 +295,6 @@ void MainWindow::enableDcShortcuts() ui.actionNextDC->setShortcut(Qt::Key_Right); } -void MainWindow::on_actionDivePlanner_triggered() -{ - int i; - struct dive *dive; - if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING || - ui.InfoWidget->isEditing()) { - QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before trying to plan a dive.")); - return; - } - disableDcShortcuts(); - DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); - DivePlannerPointsModel::instance()->clear(); - CylindersModel::instance()->clear(); - for_each_dive (i, dive) { - if (dive->selected) { - DivePlannerPointsModel::instance()->copyCylindersFrom(dive); - CylindersModel::instance()->copyFromDive(dive); - break; - } - } - ui.newProfile->setPlanState(); - ui.infoPane->setCurrentIndex(PLANNERWIDGET); -} - void MainWindow::showProfile() { enableDcShortcuts(); @@ -379,6 +355,30 @@ void MainWindow::on_actionEditDeviceNames_triggered() DiveComputerManagementDialog::instance()->show(); } +void MainWindow::on_actionDivePlanner_triggered() +{ + int i; + struct dive *dive; + if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING || + ui.InfoWidget->isEditing()) { + QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before trying to plan a dive.")); + return; + } + disableDcShortcuts(); + DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); + DivePlannerPointsModel::instance()->clear(); + CylindersModel::instance()->clear(); + for_each_dive (i, dive) { + if (dive->selected) { + DivePlannerPointsModel::instance()->copyCylindersFrom(dive); + CylindersModel::instance()->copyFromDive(dive); + break; + } + } + ui.newProfile->setPlanState(); + ui.infoPane->setCurrentIndex(PLANNERWIDGET); +} + void MainWindow::on_actionAddDive_triggered() { if (DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING || -- cgit v1.2.3-70-g09d2