Enabling cylinder edit in Subsurface-mobile our previous hacks
regarding multiple cylinders and gasmixes must be removed.

Signed-off-by: Joakim Bygdell <[email protected]>
---
 core/subsurface-qt/DiveObjectHelper.cpp |  8 +-------
 mobile-widgets/qml/DiveDetails.qml      | 15 ++++-----------
 mobile-widgets/qml/DiveDetailsEdit.qml  |  3 ---
 3 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/core/subsurface-qt/DiveObjectHelper.cpp 
b/core/subsurface-qt/DiveObjectHelper.cpp
index 3f4d736..35de666 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -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;
 }
 
diff --git a/mobile-widgets/qml/DiveDetails.qml 
b/mobile-widgets/qml/DiveDetails.qml
index b85b593..7f6ca81 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -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"
        }
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml 
b/mobile-widgets/qml/DiveDetailsEdit.qml
index 093d911..0573c74 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -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
                        }
 
-- 
2.7.4

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to