summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-25 17:49:26 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-26 13:18:53 -0700
commiteec0b327a3bb5f2d27594693d79a5bc86439c1e2 (patch)
tree3287cc269fd8b4ff547ccc6220a1d69c308eb94c /qt-ui/mainwindow.cpp
parent9b9abd5f2a93b6155df6663b4b1577408e1acc56 (diff)
downloadsubsurface-eec0b327a3bb5f2d27594693d79a5bc86439c1e2.tar.gz
Make the planner show something.
This is working in the wrong way, mostly because I'm setting the plannermodel to ADD state ( and the planner graphic to the correct PLAN state ), but I don't know why - when on PLAN state on the model, things just don't work. 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.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 827401a58..ac02527cb 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -383,18 +383,19 @@ void MainWindow::createFakeDiveForAddAndPlan()
ui.InfoWidget->updateDiveInfo(selected_dive);
}
-
void MainWindow::on_actionDivePlanner_triggered()
{
- if (!plannerStateClean())
+ if(!plannerStateClean())
return;
- int i;
- struct dive *dive;
+ dive_list()->rememberSelection();
+ dive_list()->unselectDives();
- DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
+ DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
DivePlannerPointsModel::instance()->clear();
CylindersModel::instance()->clear();
+ int i;
+ struct dive *dive;
for_each_dive (i, dive) {
if (dive->selected) {
DivePlannerPointsModel::instance()->copyCylindersFrom(dive);
@@ -402,8 +403,16 @@ void MainWindow::on_actionDivePlanner_triggered()
break;
}
}
+ createFakeDiveForAddAndPlan();
+
+ ui.InfoWidget->setCurrentIndex(0);
+ ui.infoPane->setCurrentIndex(MAINTAB);
+
ui.newProfile->setPlanState();
ui.infoPane->setCurrentIndex(PLANNERWIDGET);
+ DivePlannerPointsModel::instance()->clear();
+ DivePlannerPointsModel::instance()->createSimpleDive();
+ ui.ListWidget->reload(DiveTripModel::CURRENT);
}
void MainWindow::on_actionAddDive_triggered()