mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
DiveObjectHelper: check if dive has only one weightsystem
The mobile app should only allow editing the weight entry if there is no second weight defined. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
535a6b9b25
commit
ad7fb80d0a
2 changed files with 7 additions and 0 deletions
|
@ -187,6 +187,11 @@ QStringList DiveObjectHelper::weights() const
|
||||||
return weights;
|
return weights;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DiveObjectHelper::singleWeight() const
|
||||||
|
{
|
||||||
|
return weightsystem_none(&m_dive->weightsystem[1]);
|
||||||
|
}
|
||||||
|
|
||||||
QString DiveObjectHelper::weight(int idx) const
|
QString DiveObjectHelper::weight(int idx) const
|
||||||
{
|
{
|
||||||
if ( (idx < 0) || idx > MAX_WEIGHTSYSTEMS )
|
if ( (idx < 0) || idx > MAX_WEIGHTSYSTEMS )
|
||||||
|
|
|
@ -26,6 +26,7 @@ class DiveObjectHelper : public QObject {
|
||||||
Q_PROPERTY(QString gas READ gas CONSTANT)
|
Q_PROPERTY(QString gas READ gas CONSTANT)
|
||||||
Q_PROPERTY(QString sac READ sac CONSTANT)
|
Q_PROPERTY(QString sac READ sac CONSTANT)
|
||||||
Q_PROPERTY(QStringList weights READ weights CONSTANT)
|
Q_PROPERTY(QStringList weights READ weights CONSTANT)
|
||||||
|
Q_PROPERTY(bool singleWeight READ singleWeight CONSTANT)
|
||||||
Q_PROPERTY(QString suit READ suit CONSTANT)
|
Q_PROPERTY(QString suit READ suit CONSTANT)
|
||||||
Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
|
Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
|
||||||
Q_PROPERTY(QString trip READ trip CONSTANT)
|
Q_PROPERTY(QString trip READ trip CONSTANT)
|
||||||
|
@ -57,6 +58,7 @@ public:
|
||||||
QString sac() const;
|
QString sac() const;
|
||||||
QStringList weights() const;
|
QStringList weights() const;
|
||||||
QString weight(int idx) const;
|
QString weight(int idx) const;
|
||||||
|
bool singleWeight() const;
|
||||||
QString suit() const;
|
QString suit() const;
|
||||||
QStringList cylinders() const;
|
QStringList cylinders() const;
|
||||||
QString cylinder(int idx) const;
|
QString cylinder(int idx) const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue