diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-09 06:48:03 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-09 06:48:03 -0300 |
commit | 64864fea9c5248b61d7f6f01e3d4dab3e100945a (patch) | |
tree | 724a846c09105e539f29c1528fc42be53c48f890 /qt-ui | |
parent | c029cb0a07222b27e3c992da05a1b9181049b555 (diff) | |
download | subsurface-64864fea9c5248b61d7f6f01e3d4dab3e100945a.tar.gz |
Enable the CC SetPoint on the planner, also input bug fix.
Enabled the CC SetPoint settings on the table, changing
it will automatically reflect the canvas. Also fixed a bug
that prevented the 'Air' handling on the diveplanner
table to show the list of options using arrow up and down.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/diveplanner.cpp | 9 | ||||
-rw-r--r-- | qt-ui/modeldelegates.cpp | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index d64485b6c..ed3091ec1 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -888,7 +888,7 @@ QVariant DivePlannerPointsModel::data(const QModelIndex& index, int role) const if(role == Qt::DisplayRole){ divedatapoint p = divepoints.at(index.row()); switch(index.column()){ - case CCSETPOINT: return 0; + case CCSETPOINT: return p.po2; case DEPTH: return p.depth / 1000; case DURATION: return p.time / 60; case GAS: return strForAir(p); @@ -912,7 +912,12 @@ bool DivePlannerPointsModel::setData(const QModelIndex& index, const QVariant& v switch(index.column()){ case DEPTH: p.depth = value.toInt() * 1000; break; case DURATION: p.time = value.toInt() * 60; break; - case CCSETPOINT: /* what do I do here? */ + case CCSETPOINT:{ + int po2 = 0; + QByteArray gasv = value.toByteArray(); + if (validate_po2(gasv.data(), &po2)) + p.po2 = po2; + } break; case GAS: { int o2 = 0; int he = 0; diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index b183e170b..3549625f3 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -108,7 +108,7 @@ void ComboBoxDelegate::testActivation(const QString& s) bool ComboBoxDelegate::eventFilter(QObject* object, QEvent* event) { // Reacts on Key_UP and Key_DOWN to show the QComboBox - list of choices. - if (event->type() == QEvent::KeyPress){ + if (event->type() == QEvent::KeyPress || event->type() == QEvent::ShortcutOverride){ if (object == currCombo.comboEditor){ // the 'LineEdit' part QKeyEvent *ev = static_cast<QKeyEvent*>(event); if(ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down){ |