Remove leftovers from the planner.

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 00:51:05 -03:00 committed by Dirk Hohndel
parent 2359bd3c2c
commit b88e6dc5fa
5 changed files with 15 additions and 57 deletions

View file

@ -43,11 +43,6 @@ QString dpGasToStr(const divedatapoint &p)
static DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance(); static DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent)
{
}
bool intLessThan(int a, int b) bool intLessThan(int a, int b)
{ {
return a <= b; return a <= b;
@ -139,6 +134,7 @@ void DivePlannerPointsModel::removeDeco()
removeSelectedPoints(computedPoints); removeSelectedPoints(computedPoints);
setRecalc(oldrec); setRecalc(oldrec);
} }
#if 0 #if 0
void DivePlannerGraphics::drawProfile() void DivePlannerGraphics::drawProfile()
{ {

View file

@ -119,15 +119,6 @@ slots:
void changeGas(); void changeGas();
}; };
class DivePlannerGraphics : public QGraphicsView {
Q_OBJECT
public:
DivePlannerGraphics(QWidget *parent = 0);
private
slots:
};
#include "ui_diveplanner.h" #include "ui_diveplanner.h"
class DivePlannerWidget : public QWidget { class DivePlannerWidget : public QWidget {

View file

@ -318,14 +318,16 @@ void MainWindow::on_actionDivePlanner_triggered()
break; break;
} }
} }
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE);
ui.infoPane->setCurrentIndex(PLANNERWIDGET); ui.infoPane->setCurrentIndex(PLANNERWIDGET);
} }
void MainWindow::showProfile() void MainWindow::showProfile()
{ {
enableDcShortcuts(); enableDcShortcuts();
ui.stackedWidget->setCurrentIndex(PROFILE); //TODO: I BROKE THIS BY COMMENTING THE LINE BELOW
// and I'm sleepy now, so I think I should not try to fix right away.
// we don't setCurrentIndex anymore, we ->setPlanState() or ->setAddState() on the ProfileView.
//ui.stackedWidget->setCurrentIndex(PROFILE);
ui.infoPane->setCurrentIndex(MAINTAB); ui.infoPane->setCurrentIndex(MAINTAB);
} }
@ -1101,14 +1103,20 @@ void MainWindow::editCurrentDive()
if (defaultDC == "manually added dive") { if (defaultDC == "manually added dive") {
disableDcShortcuts(); disableDcShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner. //TODO: I BROKE THIS BY COMMENTING THE LINE BELOW
// and I'm sleepy now, so I think I should not try to fix right away.
// we don't setCurrentIndex anymore, we ->setPlanState() or ->setAddState() on the ProfileView.
//ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner.
ui.infoPane->setCurrentIndex(MAINTAB); ui.infoPane->setCurrentIndex(MAINTAB);
DivePlannerPointsModel::instance()->loadFromDive(d); DivePlannerPointsModel::instance()->loadFromDive(d);
ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE); ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE);
} else if (defaultDC == "planned dive") { } else if (defaultDC == "planned dive") {
disableDcShortcuts(); disableDcShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner. //TODO: I BROKE THIS BY COMMENTING THE LINE BELOW
// and I'm sleepy now, so I think I should not try to fix right away.
// we don't setCurrentIndex anymore, we ->setPlanState() or ->setAddState() on the ProfileView.
//ui.stackedWidget->setCurrentIndex(PLANNERPROFILE); // Planner.
ui.infoPane->setCurrentIndex(PLANNERWIDGET); ui.infoPane->setCurrentIndex(PLANNERWIDGET);
DivePlannerPointsModel::instance()->loadFromDive(d); DivePlannerPointsModel::instance()->loadFromDive(d);
ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE); ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE);

View file

@ -42,10 +42,6 @@ public:
COLLAPSED, COLLAPSED,
EXPANDED EXPANDED
}; };
enum StackWidgetIndexes {
PROFILE,
PLANNERPROFILE
};
enum InfoWidgetIndexes { enum InfoWidgetIndexes {
MAINTAB, MAINTAB,
PLANNERWIDGET PLANNERWIDGET

View file

@ -85,15 +85,8 @@
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QTabWidget" name="stackedWidget"> <widget class="QWidget" name="ProfileWidget">
<property name="currentIndex"> <layout class="QGridLayout" name="gridLayout">
<number>0</number>
</property>
<widget class="QWidget" name="page_5">
<attribute name="title">
<string>Profile Visualization</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -496,32 +489,6 @@
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget>
<widget class="QWidget" name="page_6">
<attribute name="title">
<string>Old Planner Visualization</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="DivePlannerGraphics" name="divePlanner"/>
</item>
</layout>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QSplitter" name="listGlobeSplitter"> <widget class="QSplitter" name="listGlobeSplitter">