mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Enable parts of planner based on define
In bf205726
DEPTH/Switch at was disabled by commenting out that code.
This puts it back behind ifdefs
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d4a1932276
commit
8bc2ad1473
4 changed files with 25 additions and 12 deletions
|
@ -937,8 +937,9 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg
|
||||||
QTableView *view = ui.cylinderTableWidget->view();
|
QTableView *view = ui.cylinderTableWidget->view();
|
||||||
view->setColumnHidden(CylindersModel::START, true);
|
view->setColumnHidden(CylindersModel::START, true);
|
||||||
view->setColumnHidden(CylindersModel::END, true);
|
view->setColumnHidden(CylindersModel::END, true);
|
||||||
// disabled as pointless outside of the disabled planner
|
#ifdef ENABLE_PLANNER
|
||||||
// view->setColumnHidden(CylindersModel::DEPTH, false);
|
view->setColumnHidden(CylindersModel::DEPTH, false);
|
||||||
|
#endif
|
||||||
view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
||||||
connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
|
connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
|
||||||
connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));
|
connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));
|
||||||
|
|
|
@ -88,8 +88,9 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
|
|
||||||
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
||||||
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
|
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
|
||||||
// disabled as this column is pointless outside the disabled planner
|
#ifdef ENABLE_PLANNER
|
||||||
// ui.cylinders->view()->setColumnHidden(CylindersModel::DEPTH, true);
|
ui.cylinders->view()->setColumnHidden(CylindersModel::DEPTH, true);
|
||||||
|
#endif
|
||||||
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
|
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
|
||||||
completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
|
completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
|
||||||
completers.location = new QCompleter(&locationModel, ui.location);
|
completers.location = new QCompleter(&locationModel, ui.location);
|
||||||
|
|
|
@ -67,7 +67,9 @@ CylindersModel::CylindersModel(QObject *parent) : current(0), rows(0)
|
||||||
{
|
{
|
||||||
// enum {REMOVE, TYPE, SIZE, WORKINGPRESS, START, END, O2, HE, DEPTH};
|
// enum {REMOVE, TYPE, SIZE, WORKINGPRESS, START, END, O2, HE, DEPTH};
|
||||||
setHeaderDataStrings(QStringList() << "" << tr("Type") << tr("Size") << tr("WorkPress") << tr("StartPress") << tr("EndPress") << trUtf8("O" UTF8_SUBSCRIPT_2 "%") << tr("He%")
|
setHeaderDataStrings(QStringList() << "" << tr("Type") << tr("Size") << tr("WorkPress") << tr("StartPress") << tr("EndPress") << trUtf8("O" UTF8_SUBSCRIPT_2 "%") << tr("He%")
|
||||||
// while the planner is disabled, we don't need this column: << tr("Switch at")
|
#ifdef ENABLE_PLANNER
|
||||||
|
<< tr("Switch at")
|
||||||
|
#endif
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,9 +145,11 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
|
||||||
case HE:
|
case HE:
|
||||||
ret = percent_string(cyl->gasmix.he);
|
ret = percent_string(cyl->gasmix.he);
|
||||||
break;
|
break;
|
||||||
// case DEPTH:
|
#ifdef ENABLE_PLANNER
|
||||||
// ret = get_depth_string(cyl->depth, true);
|
case DEPTH:
|
||||||
// break;
|
ret = get_depth_string(cyl->depth, true);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
|
@ -258,9 +262,13 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// case DEPTH:
|
#ifdef ENABLE_PLANNER
|
||||||
// if (CHANGED())
|
case DEPTH:
|
||||||
// cyl->depth = string_to_depth(vString.toUtf8().data());
|
if (CHANGED()) {
|
||||||
|
cyl->depth = string_to_depth(vString.toUtf8().data());
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
dataChanged(index, index);
|
dataChanged(index, index);
|
||||||
if (addDiveMode)
|
if (addDiveMode)
|
||||||
|
|
|
@ -102,7 +102,10 @@ public:
|
||||||
END,
|
END,
|
||||||
O2,
|
O2,
|
||||||
HE,
|
HE,
|
||||||
/* DEPTH, */ COLUMNS
|
#ifdef ENABLE_PLANNER
|
||||||
|
DEPTH,
|
||||||
|
#endif
|
||||||
|
COLUMNS
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit CylindersModel(QObject *parent = 0);
|
explicit CylindersModel(QObject *parent = 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue