summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveDetailsEdit.qml
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2016-08-30 16:24:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-09-04 07:36:13 -0700
commit674d8331f5c15a8c3095afd1deca2b087fd82464 (patch)
treedefca414c3ca03c51b8dd65840b1d5ba6dedf963 /mobile-widgets/qml/DiveDetailsEdit.qml
parent7b3665827a3fdf6717be5419b41641d8e2d95c93 (diff)
downloadsubsurface-674d8331f5c15a8c3095afd1deca2b087fd82464.tar.gz
QML UI: Enable cylinder edit
This adds the option to select a cylinder when adding or editing a dive. Due to limited screen size we restrict the editing to the first cylinder only. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DiveDetailsEdit.qml')
-rw-r--r--mobile-widgets/qml/DiveDetailsEdit.qml24
1 files changed, 21 insertions, 3 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml
index ad62997df..b3907c616 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -18,6 +18,7 @@ Item {
property alias suitIndex: suitBox.currentIndex
property alias buddyIndex: buddyBox.currentIndex
property alias divemasterIndex: divemasterBox.currentIndex
+ property alias cylinderIndex: cylinderBox.currentIndex
property alias notesText: txtNotes.text
property alias durationText: txtDuration.text
property alias depthText: txtDepth.text
@@ -29,13 +30,14 @@ Item {
property alias suitModel: suitBox.model
property alias divemasterModel: divemasterBox.model
property alias buddyModel: buddyBox.model
+ property alias cylinderModel: cylinderBox.model
function saveData() {
// apply the changes to the dive_table
manager.commitChanges(dive_id, detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, detailsEdit.durationText,
- detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, suitBox.editText,
- buddyBox.editText, divemasterBox.editText, detailsEdit.weightText, detailsEdit.notesText,
- detailsEdit.startpressureText, detailsEdit.endpressureText, detailsEdit.gasmixText)
+ detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, suitBox.editText, buddyBox.editText,
+ divemasterBox.editText, detailsEdit.weightText, detailsEdit.notesText, detailsEdit.startpressureText,
+ detailsEdit.endpressureText, detailsEdit.gasmixText, cylinderBox.editText)
// trigger the profile to be redrawn
QMLProfile.diveId = dive_id
@@ -53,6 +55,7 @@ Item {
diveDetailsListView.currentItem.modelData.suit = suitBox.currentText
diveDetailsListView.currentItem.modelData.buddy = buddyBox.currentText
diveDetailsListView.currentItem.modelData.divemaster = divemasterBox.currentText
+ diveDetailsListView.currentItem.modelData.cylinder = cylinderBox.currentText
diveDetailsListView.currentItem.modelData.notes = detailsEdit.notesText
diveDetailsPage.state = "view"
Qt.inputMethod.hide()
@@ -210,6 +213,21 @@ Item {
Kirigami.Label {
Layout.alignment: Qt.AlignRight
+ text: qsTr("Cylinder:")
+ }
+ ComboBox {
+ id: cylinderBox
+ editable: true
+ model: diveDetailsListView.currentItem.modelData.dive.cylinderList
+ inputMethodHints: Qt.ImhNoPredictiveText
+ Layout.fillWidth: true
+ style: ComboBoxStyle {
+ dropDownButtonWidth: 0
+ }
+ }
+
+ Kirigami.Label {
+ Layout.alignment: Qt.AlignRight
text: qsTr("Gas mix:")
}
StyledTextField {