aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-11-21 12:23:58 +0100
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2017-11-21 19:25:35 +0100
commitc995069e14cdd7c1132866ac78ad7839faecfa15 (patch)
treea720dd10ba7d3bbc55ea92e68c5664a185376ad5 /tests
parent32a7cde180a342aef13b1ffcbe53a088ab4dc51c (diff)
downloadsubsurface-c995069e14cdd7c1132866ac78ad7839faecfa15.tar.gz
Desktop UI: allow user defined cylinder as default
Currently, it was only possible to use a hard-coded default cylinder in the preferences. At the same time, the user is allowed to add own cylinders to a dive (by just typing in a new name and cylinder properties). These own cylinders could not be selected in the preferences, requiring the user to manually add this every dive. Not sure the reason for all this was intentional, or just an overlooked aspect in the implementation. It appeared that the selection list in the UI was constructed before any logbook was parsed, so at that moment, there are only hard-coded cylinders. The fix is simple. Refresh the UI of the preferences just before it is shown. While opening the logbook, a new list of cylinders, including the own cylinders is constructed, so the UI is refreshed to that. While a simple change, there is a use case that might be considered strange. Open a logbook, choose new logbook, and change the default cylinder preference to an own (from the previously opened logbook). Do not add a dive with the new (own) cylinder and save this logbook. Reopen this new logbook, and see that the default cylinder in the preferences is empty. This is logical, as the list of own possible cylinders is constructed from the (new) logbook, that has no dive with that specific own cylinder. I consider this acceptable behavior, as it can be also be used to copy own cylinders to a new logbook. Fixes: #821 Proposed-by: Davide DB <dbdavide@gmail.com> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions