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>
This commit is contained in:
Tomaz Canabrava 2014-05-25 15:15:57 -03:00 committed by Dirk Hohndel
parent c4d022356e
commit dcd8381764

View file

@ -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 ||