mobile-widgets: add asc/desc rates to pure interface

Make ascent/descent rates available to QML through the Backend interface.

Remark signals from qPrefDivePlanner is used because the diveplanner model
sets qPrefDivePlanner but does not issue its own signals.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
jan Iversen 2020-01-19 18:44:16 +01:00 committed by Dirk Hohndel
parent d924afdf52
commit 699665ce9e
2 changed files with 37 additions and 0 deletions

View file

@ -36,4 +36,15 @@ void QMLInterface::setup(QQmlContext *ct)
[=] (int value) { emit instance()->volumeChanged(VOLUME(value)); });
connect(qPrefUnits::instance(), &qPrefUnits::weightChanged,
[=] (int value) { emit instance()->weightChanged(WEIGHT(value)); });
connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::ascratelast6mChanged,
instance(), &QMLInterface::ascratelast6mChanged);
connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::ascratestopsChanged,
instance(), &QMLInterface::ascratestopsChanged);
connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::ascrate50Changed,
instance(), &QMLInterface::ascrate50Changed);
connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::ascrate75Changed,
instance(), &QMLInterface::ascrate75Changed);
connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::descrateChanged,
instance(), &QMLInterface::descrateChanged);
}