Changeset 6a50efd in subsurface


Ignore:
Timestamp:
Apr 14, 2017, 5:32:45 PM (6 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
052be69
Parents:
e42bf2c
git-author:
Dirk Hohndel <dirk@…> (04/14/17 17:32:32)
git-committer:
Dirk Hohndel <dirk@…> (04/14/17 17:32:45)
Message:

QML UI: create completion list for cylinders as well

We already have that for the other three fields where we offer auto
completion (buddy, divemaster, suit).

Signed-off-by: Dirk Hohndel <dirk@…>

Location:
mobile-widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qmlmanager.cpp

    r01d091fb r6a50efd  
    14851485}
    14861486
     1487QStringList QMLManager::cylinderInit() const
     1488{
     1489        QStringList cylinders;
     1490        struct dive *d;
     1491        int i = 0;
     1492        for_each_dive (i, d) {
     1493                for (int j = 0; j < MAX_CYLINDERS; j++) {
     1494                        if (! same_string(d->cylinder[j].type.description, ""))
     1495                                cylinders << d->cylinder[j].type.description;
     1496                }
     1497        }
     1498        cylinders.removeDuplicates();
     1499        cylinders.sort();
     1500        return cylinders;
     1501}
     1502
    14871503bool QMLManager::showPin() const
    14881504{
  • mobile-widgets/qmlmanager.h

    r01d091fb r6a50efd  
    3434        Q_PROPERTY(QStringList buddyInit READ buddyInit CONSTANT)
    3535        Q_PROPERTY(QStringList divemasterInit READ divemasterInit CONSTANT)
     36        Q_PROPERTY(QStringList cylinderInit READ cylinderInit CONSTANT)
    3637        Q_PROPERTY(bool showPin READ showPin WRITE setShowPin NOTIFY showPinChanged)
    3738
     
    109110        QStringList buddyInit() const;
    110111        QStringList divemasterInit() const;
    111 
     112        QStringList cylinderInit() const;
    112113        bool showPin() const;
    113114        void setShowPin(bool enable);
Note: See TracChangeset for help on using the changeset viewer.