mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove hacks regarding multiple gasmixes and cylinders
Enabling cylinder edit in Subsurface-mobile our previous hacks regarding multiple cylinders and gasmixes must be removed. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
674d8331f5
commit
4e0200863b
3 changed files with 5 additions and 21 deletions
|
@ -373,13 +373,7 @@ QString DiveObjectHelper::sumWeight() const
|
||||||
|
|
||||||
QString DiveObjectHelper::getCylinder() const
|
QString DiveObjectHelper::getCylinder() const
|
||||||
{
|
{
|
||||||
QString getCylinder;
|
QString getCylinder = m_dive->cylinder[0].type.description;
|
||||||
if (is_cylinder_used(m_dive, 1)){
|
|
||||||
getCylinder = QObject::tr("Multiple");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
getCylinder = m_dive->cylinder[0].type.description;
|
|
||||||
}
|
|
||||||
return getCylinder;
|
return getCylinder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,17 +166,10 @@ Kirigami.Page {
|
||||||
// careful when translating, this text is "magic" in DiveDetailsEdit.qml
|
// careful when translating, this text is "magic" in DiveDetailsEdit.qml
|
||||||
weight = "cannot edit multiple weight systems"
|
weight = "cannot edit multiple weight systems"
|
||||||
}
|
}
|
||||||
if (diveDetailsListView.currentItem.modelData.dive.getCylinder != "Multiple" ) {
|
startpressure = diveDetailsListView.currentItem.modelData.dive.startPressure
|
||||||
startpressure = diveDetailsListView.currentItem.modelData.dive.startPressure
|
endpressure = diveDetailsListView.currentItem.modelData.dive.endPressure
|
||||||
endpressure = diveDetailsListView.currentItem.modelData.dive.endPressure
|
gasmix = diveDetailsListView.currentItem.modelData.dive.firstGas
|
||||||
gasmix = diveDetailsListView.currentItem.modelData.dive.firstGas
|
cylinderIndex = diveDetailsListView.currentItem.modelData.dive.cylinderList.indexOf(diveDetailsListView.currentItem.modelData.dive.getCylinder)
|
||||||
cylinderIndex = diveDetailsListView.currentItem.modelData.dive.cylinderList.indexOf(diveDetailsListView.currentItem.modelData.dive.getCylinder)
|
|
||||||
} else {
|
|
||||||
// careful when translating, this text is "magic" in DiveDetailsEdit.qml
|
|
||||||
startpressure = "cannot edit multiple cylinders"
|
|
||||||
endpressure = "cannot edit multiple cylinders"
|
|
||||||
gasmix = "cannot edit multiple gases"
|
|
||||||
}
|
|
||||||
|
|
||||||
diveDetailsPage.state = "edit"
|
diveDetailsPage.state = "edit"
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,6 @@ Item {
|
||||||
}
|
}
|
||||||
StyledTextField {
|
StyledTextField {
|
||||||
id: txtGasMix
|
id: txtGasMix
|
||||||
fixed: (text == "cannot edit multiple gases" ? true : false)
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
||||||
}
|
}
|
||||||
|
@ -243,7 +242,6 @@ Item {
|
||||||
}
|
}
|
||||||
StyledTextField {
|
StyledTextField {
|
||||||
id: txtStartPressure
|
id: txtStartPressure
|
||||||
fixed: (text == "cannot edit multiple cylinders" ? true : false)
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +251,6 @@ Item {
|
||||||
}
|
}
|
||||||
StyledTextField {
|
StyledTextField {
|
||||||
id: txtEndPressure
|
id: txtEndPressure
|
||||||
readOnly: (text == "cannot edit multiple cylinders" ? true : false)
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue