mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: switch editing back to comboBox
The HintsTextEdit just doesn't feel natural and intuitive. Edit, fixed rebase issues. Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
parent
a2111a4198
commit
9755650b3c
1 changed files with 34 additions and 18 deletions
|
@ -11,18 +11,18 @@ Item {
|
||||||
property int dive_id
|
property int dive_id
|
||||||
property int number
|
property int number
|
||||||
property alias dateText: txtDate.text
|
property alias dateText: txtDate.text
|
||||||
property alias locationText: txtLocation.text
|
property alias locationText: txtLocation.editText
|
||||||
property alias gpsText: txtGps.text
|
property alias gpsText: txtGps.text
|
||||||
property alias airtempText: txtAirTemp.text
|
property alias airtempText: txtAirTemp.text
|
||||||
property alias watertempText: txtWaterTemp.text
|
property alias watertempText: txtWaterTemp.text
|
||||||
property alias suitIndex: suitBox.currentIndex
|
property alias suitIndex: suitBox.currentIndex
|
||||||
property alias suitText: suitBox.text
|
property alias suitText: suitBox.editText
|
||||||
property alias buddyIndex: buddyBox.currentIndex
|
property alias buddyIndex: buddyBox.currentIndex
|
||||||
property alias buddyText: buddyBox.text
|
property alias buddyText: buddyBox.editText
|
||||||
property alias divemasterIndex: divemasterBox.currentIndex
|
property alias divemasterIndex: divemasterBox.currentIndex
|
||||||
property alias divemasterText: divemasterBox.text
|
property alias divemasterText: divemasterBox.editText
|
||||||
property alias cylinderIndex: cylinderBox.currentIndex
|
property alias cylinderIndex: cylinderBox.currentIndex
|
||||||
property alias cylinderText: cylinderBox.text
|
property alias cylinderText: cylinderBox.editText
|
||||||
property alias notesText: txtNotes.text
|
property alias notesText: txtNotes.text
|
||||||
property alias durationText: txtDuration.text
|
property alias durationText: txtDuration.text
|
||||||
property alias depthText: txtDepth.text
|
property alias depthText: txtDepth.text
|
||||||
|
@ -63,9 +63,14 @@ Item {
|
||||||
diveDetailsPage.state = "view" // run the transition
|
diveDetailsPage.state = "view" // run the transition
|
||||||
// apply the changes to the dive_table
|
// apply the changes to the dive_table
|
||||||
manager.commitChanges(dive_id, detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, detailsEdit.durationText,
|
manager.commitChanges(dive_id, detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, detailsEdit.durationText,
|
||||||
detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, suitBox.text, buddyBox.text,
|
detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText,
|
||||||
divemasterBox.text, detailsEdit.weightText, detailsEdit.notesText, detailsEdit.startpressureText,
|
suitBox.currentText != "" ? suitBox.currentText : suitBox.editText,
|
||||||
detailsEdit.endpressureText, detailsEdit.gasmixText, cylinderBox.text, detailsEdit.rating,
|
buddyBox.currentText != "" ? buddyBox.currentText : buddyBox.editText,
|
||||||
|
divemasterBox.currentText != "" ? divemasterBox.currentText : divemasterBox.editText,
|
||||||
|
detailsEdit.weightText, detailsEdit.notesText, detailsEdit.startpressureText,
|
||||||
|
detailsEdit.endpressureText, detailsEdit.gasmixText,
|
||||||
|
cylinderBox.currentText != "" ? cylinderBox.currentText : cylinderBox.editText,
|
||||||
|
detailsEdit.rating,
|
||||||
detailsEdit.visibility)
|
detailsEdit.visibility)
|
||||||
// trigger the profile to be redrawn
|
// trigger the profile to be redrawn
|
||||||
QMLProfile.diveId = dive_id
|
QMLProfile.diveId = dive_id
|
||||||
|
@ -127,12 +132,15 @@ Item {
|
||||||
text: qsTr("Location:")
|
text: qsTr("Location:")
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
HintsTextEdit {
|
Controls.ComboBox {
|
||||||
id: txtLocation
|
id: txtLocation
|
||||||
model: manager.locationList
|
editable: true
|
||||||
|
flat: true
|
||||||
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
diveDetailsListView.currentItem.modelData.dive.locationList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onEditingFinished: {
|
onAccepted: {
|
||||||
gpsText = manager.getGpsFromSiteName(text)
|
gpsText = manager.getGpsFromSiteName(text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,9 +231,12 @@ Item {
|
||||||
text: qsTr("Suit:")
|
text: qsTr("Suit:")
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
HintsTextEdit {
|
Controls.ComboBox {
|
||||||
id: suitBox
|
id: suitBox
|
||||||
model: manager.suitList
|
editable: true
|
||||||
|
flat: true
|
||||||
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
manager.suitList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
@ -235,9 +246,11 @@ Item {
|
||||||
text: qsTr("Buddy:")
|
text: qsTr("Buddy:")
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
HintsTextEdit {
|
Controls.ComboBox {
|
||||||
id: buddyBox
|
id: buddyBox
|
||||||
model: manager.buddyList
|
editable: true
|
||||||
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
manager.buddyList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
@ -247,9 +260,11 @@ Item {
|
||||||
text: qsTr("Divemaster:")
|
text: qsTr("Divemaster:")
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
HintsTextEdit {
|
Controls.ComboBox {
|
||||||
id: divemasterBox
|
id: divemasterBox
|
||||||
model: manager.divemasterList
|
editable: true
|
||||||
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
manager.divemasterList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
@ -273,8 +288,9 @@ Item {
|
||||||
text: qsTr("Cylinder:")
|
text: qsTr("Cylinder:")
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
}
|
}
|
||||||
HintsTextEdit {
|
Controls.ComboBox {
|
||||||
id: cylinderBox
|
id: cylinderBox
|
||||||
|
editable: true
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
diveDetailsListView.currentItem.modelData.dive.cylinderList : null
|
diveDetailsListView.currentItem.modelData.dive.cylinderList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue