Changeset 0e57033 in subsurface


Ignore:
Timestamp:
Jan 29, 2017, 2:55:33 PM (3 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
3b67bc25
Parents:
f5a4838
git-author:
jbygdell <j.bygdell@…> (01/29/17 08:32:13)
git-committer:
Dirk Hohndel <dirk@…> (01/29/17 14:55:33)
Message:

QML UI: Parse multiple buddies when editing a dive

This allows the user to enter multiple buddies as a comma separated list,
the "Multiple Buddies" entry is still a special case as we can only populate
the combobox with a single name for each entry.

fixes #168

Signed-off-by: Joakim Bygdell <j.bygdell@…>

Location:
mobile-widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qml/DiveDetailsEdit.qml

    rb15b3c1 r0e57033  
    178178                        ComboBox {
    179179                                id: buddyBox
    180                                 editable: currentText != qsTr("Multiple Buddies")
     180                                editable: true
    181181                                model: diveDetailsListView.currentItem.modelData.dive.buddyList
    182182                                inputMethodHints: Qt.ImhNoPredictiveText
  • mobile-widgets/qmlmanager.cpp

    rb15b3c1 r0e57033  
    870870        }
    871871        if (myDive->buddy() != buddy) {
    872                 if (myDive->buddy().contains(",")) {
    873                         if (!buddy.contains(tr("Multiple Buddies"))) {
    874                                 diveChanged = true;
    875                                 free(d->buddy);
    876                                 d->buddy = strdup(qPrintable(buddy));
    877                         }
    878                 } else {
     872                if (buddy.contains(",")){
     873                        buddy = buddy.replace(QRegExp("\\s*,\\s*"), ", ");
     874                }
     875                if (!buddy.contains("Multiple Buddies")) {
    879876                        diveChanged = true;
    880877                        free(d->buddy);
Note: See TracChangeset for help on using the changeset viewer.