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:
Joakim Bygdell 2016-08-29 21:35:06 +02:00 committed by Dirk Hohndel
parent 674d8331f5
commit 4e0200863b
3 changed files with 5 additions and 21 deletions

View file

@ -373,13 +373,7 @@ QString DiveObjectHelper::sumWeight() const
QString DiveObjectHelper::getCylinder() const
{
QString getCylinder;
if (is_cylinder_used(m_dive, 1)){
getCylinder = QObject::tr("Multiple");
}
else {
getCylinder = m_dive->cylinder[0].type.description;
}
QString getCylinder = m_dive->cylinder[0].type.description;
return getCylinder;
}

View file

@ -166,17 +166,10 @@ Kirigami.Page {
// careful when translating, this text is "magic" in DiveDetailsEdit.qml
weight = "cannot edit multiple weight systems"
}
if (diveDetailsListView.currentItem.modelData.dive.getCylinder != "Multiple" ) {
startpressure = diveDetailsListView.currentItem.modelData.dive.startPressure
endpressure = diveDetailsListView.currentItem.modelData.dive.endPressure
gasmix = diveDetailsListView.currentItem.modelData.dive.firstGas
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"
}
startpressure = diveDetailsListView.currentItem.modelData.dive.startPressure
endpressure = diveDetailsListView.currentItem.modelData.dive.endPressure
gasmix = diveDetailsListView.currentItem.modelData.dive.firstGas
cylinderIndex = diveDetailsListView.currentItem.modelData.dive.cylinderList.indexOf(diveDetailsListView.currentItem.modelData.dive.getCylinder)
diveDetailsPage.state = "edit"
}

View file

@ -232,7 +232,6 @@ Item {
}
StyledTextField {
id: txtGasMix
fixed: (text == "cannot edit multiple gases" ? true : false)
Layout.fillWidth: true
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 {
id: txtStartPressure
fixed: (text == "cannot edit multiple cylinders" ? true : false)
Layout.fillWidth: true
}
@ -253,7 +251,6 @@ Item {
}
StyledTextField {
id: txtEndPressure
readOnly: (text == "cannot edit multiple cylinders" ? true : false)
Layout.fillWidth: true
}