diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-05-25 15:15:57 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-26 13:18:12 -0700 |
commit | dcd83817648ed227a4a3453923e29a662fa2cc67 (patch) | |
tree | 2c7f6d504ce547960d9b45e033ae722cef6adeb3 /qt-ui/mainwindow.cpp | |
parent | c4d022356ea9f128b71633d64dbb5f81a83bf1db (diff) | |
download | subsurface-dcd83817648ed227a4a3453923e29a662fa2cc67.tar.gz |
Planner: Move method down below to easy comparisson with another.
Planner and add states are driving me nuts.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 48 |
1 files 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 || |