mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
c4d022356e
commit
dcd8381764
1 changed files with 24 additions and 24 deletions
|
@ -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 ||
|
||||
|
|
Loading…
Add table
Reference in a new issue