aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-20 09:29:05 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-20 15:39:22 -0800
commit51a242a1dbe779671ef99ca84552f11576ad600f (patch)
treeefbd1c159f88ae051f83806068ef269ac5015bf5 /mobile-widgets
parent77352751fa9ef4717ed6409f33297062c873b0b4 (diff)
downloadsubsurface-51a242a1dbe779671ef99ca84552f11576ad600f.tar.gz
mobile UI: add ability to unset the default cylinder
This was requested in a 'bug report' by a user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/Settings.qml7
-rw-r--r--mobile-widgets/qmlmanager.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml
index 1759b8e8a..139adefb4 100644
--- a/mobile-widgets/qml/Settings.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -94,7 +94,12 @@ Kirigami.ScrollablePage {
inputMethodHints: Qt.ImhNoPredictiveText
Layout.fillWidth: true
onActivated: {
- PrefEquipment.default_cylinder = defaultCylinderBox.currentText
+ // the entry for 'no default cylinder' is known to be the top, but its text
+ // is possibly translated so check against the index
+ if (currentIndex === 0)
+ PrefEquipment.default_cylinder = ""
+ else
+ PrefEquipment.default_cylinder = defaultCylinderBox.currentText
}
}
}
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index c29cbe345..8e5005447 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1807,6 +1807,8 @@ QStringList QMLManager::cylinderInit() const
cylinders.removeDuplicates();
cylinders.sort();
+ // now add fist one that indicates that the user wants no default cylinder
+ cylinders.prepend(tr("no default cylinder"));
return cylinders;
}