summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-11-22 16:19:44 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-11-25 08:13:42 -0800
commit64704d6e5a0865c5acb6ce40cc32ba929f41ba00 (patch)
treee6ab73f73f5c9a479d7ec8b54486ad119794f97f /mobile-widgets
parentba773c811f85e6503f9571cd2ee9f001a438eb8e (diff)
downloadsubsurface-64704d6e5a0865c5acb6ce40cc32ba929f41ba00.tar.gz
mobile: autocomplete location names
Add the capability to select the location name from a list, constructed from the known dive sites in the logbook. Fixes: #546 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/DiveDetails.qml1
-rw-r--r--mobile-widgets/qml/DiveDetailsEdit.qml11
2 files changed, 7 insertions, 5 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index 2287b6348..dc0af53b6 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -24,6 +24,7 @@ Kirigami.Page {
property alias depth: detailsEdit.depthText
property alias duration: detailsEdit.durationText
property alias location: detailsEdit.locationText
+ property alias locationModel: detailsEdit.locationModel
property alias gps: detailsEdit.gpsText
property alias notes: detailsEdit.notesText
property alias suitIndex: detailsEdit.suitIndex
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml
index 431a0e22f..4c4f8e47c 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -35,6 +35,7 @@ Item {
property alias divemasterModel: divemasterBox.model
property alias buddyModel: buddyBox.model
property alias cylinderModel: cylinderBox.model
+ property alias locationModel: txtLocation.model
property int rating
property int visibility
@@ -105,12 +106,12 @@ Item {
text: qsTr("Location:")
font.pointSize: subsurfaceTheme.smallPointSize
}
- Controls.TextField {
- id: txtLocation;
+ HintsTextEdit {
+ id: txtLocation
+ model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
+ diveDetailsListView.currentItem.modelData.dive.locationList : null
+ inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
- onEditingFinished: {
- focus = false
- }
}
Controls.Label {