aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-08-10CylindersModel: add tooltips for Deco switch at, Bot MOD and MNDGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-10Unify handling of QDateTime time zone informationGravatar Robert C. Helling
Subsurface uses "local time" which in particular means we never display time zone information to the user. The user (and our file format) only sees times like 5pm or 17:00. A better name than local time (which could mean "local at the dive spot) would be "watch time", the time displayed by the diver's watch when she entered the water. Internally, we store times as time_t, seconds since Jan 1 1970 0:00 UTC. Our convention for conversion between 5pm and time_t as always been to treat 5pm as if it were UTC. Then confusion arose since Qt's QDateTime (which is tied to UI elements like QTimeEdit and similar) is time zone aware and by default assumes the system time zone. So when we set a QDateTime to 5pm and then later convert it to time_t we have to take care about the difference between UTC and the system time zone. This patch unifies our solution to this problem: With it, we set all QDateTime's time zone to UTC. This means we don't have to correct for a time zone anymore when converting to time_t (note, however, the signedness issue: Qt's idea of time_t is broken since it assumes it to be unsigned thus not allowing for dates before 1970. Better use the millisecont variants). We only need to be careful about time zones when using the current time. With this convention, when assigning the current time to a QDateTime, we need to shift for the time zone since its value in UTC should actually be the watch time of the user who is most likely used to the system time zone. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-10Adds Cylinder helper class for cylinder info access in grantlee templatesGravatar Tim Wootton
to allow grantlee to access individual fields of the cylinder_t struct rather than a string representation of the whole cylinder info using a grantlee structure like this one: <table class="table_class"> <tr> <td>Cylinder</td> <td>Start press.</td> <td>End press.</td> <td>Gas mix</td> </tr> {% for cylinderObject in dive.cylinderObjects %} <tr> <td>{{ cylinderObject.description }}</td> <td>{{ cylinderObject.startPressure }}</td> <td>{{ cylinderObject.endPressure }}</td> <td>{{ cylinderObject.gasMix }}</td> </tr> {% endfor %} </table> Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-30Add menu entry to remove the offline stateGravatar Dirk Hohndel
If an attempt to contact the cloud storage fails, Subsurface switches into offline mode. This allows us to go back online again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-30Send the appropriate signal when gitLocalOnly changesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28Fix cylinder pressure for UDDF exportGravatar Miika Turkia
Fixes #1086 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28Shrink the minimum size for preferences windowGravatar Miika Turkia
Let's have the preferences window as small as possible with the current data in it. This should allow people with vertical resolution of 600 to use the preferences window. Fixes #1083 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28Shrink the size of export dialogGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-24Event name heuristics to show better event iconsGravatar Dirk Hohndel
This matches the strings for a couple of generic events from libdivecomputer that should obviously info or violation events, and matches quite a few more from the Uemis downloader (as those are much more specific). Everything else is still shown as a yellow warning triangle. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-24Add new helper for case insensitive string comparisonGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-24Avoid compile time warningGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-24Show different icons based on event severityGravatar Dirk Hohndel
So far this is only supported in the Suunto EON Steel backend, but we should try to add this to others where we have such a distinction (and maybe assign different values to the predefined libdivecomputer events). This also adds three new icons for info, warning, and violation. The warning icon we had already, but I drew a new one from scratch to have it match the violation icon. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Event flags should be checked as bits, not valuesGravatar Linus Torvalds
This becomes obvious with the new severity bits introduced in the Suunto EON Steel parser. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Allow the user to give longer cloud timeout on the command lineGravatar Dirk Hohndel
When stuck in areas with really bad internet 5 seconds may not be enough, but making the timeout longer in general seems the wrong way to go. So keep the default 5 seconds but allow the user to override that with subsurface --cloud-timeout=NN Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Use preferences object to correctly store cloud statusGravatar Dirk Hohndel
There are a lot more places all over Subsurface where this needs to be cleaned up. The converstion of the preferences system has been a complete mess. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Only add non-blank cylinder strings to the cylinder listGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Remove another unused variableGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Remove unnecessary DivePlannerPointsModel functions and variablesGravatar Rick Walsh
Commit b1ed04a means that DivePlannerPointsModel::rememberTanks() and related functions and variables are no longer required Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Fix build (link) on openSUSE builds (maybe due to recent cmake version)Gravatar Guillaume GARDET
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Update OBS spec file to fix buildGravatar Guillaume GARDET
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Documentation: update french translation of user-manual and mobile-manualGravatar Guillaume GARDET
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Relabel cylindermodel "Deco MOD" column to "Deco switch at"Gravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Only add non-blank weights to the weight listGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Remove unused image from mobile user manualGravatar Willem Ferguson
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Let cns and otu return ints rather than QStringsGravatar Tim Wootton
This way they display correctly when accessed from grantlee template Fixes #1085 Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Adds missing visibility to DiveObjectHelper, so it too can be used in print ↵Gravatar Tim Wootton
templates. Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-22Undefine both macrosGravatar Dirk Hohndel
There really is not need to do this, but at least do it symmetrically. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-21Add support for SAMPLE_EVENT_STRING event typeGravatar Linus Torvalds
Instead of having fixed numbers and trying to translate them into strings, a dive computer could just give us the string directly. Like the new EON Steel backend does. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-21Properly pick cylinder use when merging divesGravatar Linus Torvalds
The cylinder use field was not merged when dives were merged. This is normally not noticeable, since hopefully the cylinder use should be the same anyway, but when re-downloading the dives from the EON Steel after updating it to also get cylinder use data, the dive merging threw the data away again since the original dive lacked it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-21Get the cylinder use data from libdivecomputer if providedGravatar Linus Torvalds
This uses the extended tank type information to fill in the cylinder use (OC gas, CC Diluent or CC O2) from libdivecomputer when available. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-21Add proper line ending for unit line in git save formatGravatar Linus Torvalds
The imperial and metric unit formats already had this, but the personalized one missed the newline at the end. It shouldn't really matter, since it's the last line of the file, but it is not right. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-18Show SAC rate when using the rulerGravatar Dirk Hohndel
This way it's really easy to see the SAC rate during a segment of a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-17If cloud storage is offline, show that in title barGravatar Dirk Hohndel
Not sure if "local cache" is the best text, but it's accurate. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-17Stay offline if the cloud server is unreachableGravatar Dirk Hohndel
It makes no sense to keep trying. Maybe we need a UI to force it online again, but for now this works much better when using cloud storage while actually offline. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Fix fix for filtersGravatar Dirk Hohndel
Commit aa1446bed2e4 ("Make filters work again in master") makes filters work again for the desktop app, but breaks building Subsurface-mobile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Prevent using an uninitialized valueGravatar Dirk Hohndel
This could otherwise lead to crashes if you start a plan with a dive selected that has no cylinders. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Remove two unused variablesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Make filters work again in masterGravatar Salvador Cuñat
Since 6cd711a1 filters don't work. This went unnoticed because the commit wasn't applied on v4.5-branch. Partially reverting it makes filters work again. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Planner: update maxdepth and best mixes when profile changed by mouseGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Planner: update cylinder mixes and MND and MOD when prefs are changedGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Fixup: don't capitalise best_HeGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Planner: automate calculation of best mix for max depthGravatar Rick Walsh
Add option to calculate the best mix portion of O2 and He for the dive's max depth if the user enters * in the MOD and MND cylinder fields. Gas portions are automatically recalculated if the max depth of the dive changes. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Validate O2 in best mixGravatar Rick Walsh
We can't have >100% O2 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Be more clear about deco MOD / switch depth and bottom MODGravatar Rick Walsh
The switch depth of a decompression gas is its MOD. By renaming the heading to "Deco MOD", it is more clearly distinguished from the bottom MOD, and it is more obvious how they relate to the Bottom pO2 and Deco pO2 preferences. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Add MOD and MND fields to cylindermodelGravatar Rick Walsh
Adds fields to the planner cylinder model for maximum operating depth (MOD) for a bottom mix gas, and maximum narcotic depth (MND). Fields are read/write, so changing MOD changes %O2 and vice-versa. Changing MND changes %He and vice-versa. When setting MOD directly, the %O2 is truncated (rounded down) to an integer, which re-calculates the MOD, which is sometimes a few metres greater than the input depth. This is desireable behaviour, as the rounding is conservative. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Add function to calculate gas maximum narcotic depthGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Update gas deco MOD when deco pO2 is changedGravatar Rick Walsh
This fix is reasonably straightforward when the divedatapoint structure stores the cylinder rather than gasmix. Fixes #970 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Update TestPlan for divedatapoint storing cylinder id instead of gasmixGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Have divedatapoint store cylinder id instead of gasmixGravatar Rick Walsh
Determining the correct cylinder index from a known gas mix can be complicated, but it is trivial to look up the gasmix from the cylinder_t structure. It makes sense to remember which cylinder is being used. This simplifies handling changing a cylinder's gas mix, either directly by the user, or indirectly in the planner. It also permits tracking of multiple cylinders of the same mix, e.g. independent twins / sidemount. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Treat minified JavaScript as binaryGravatar Anton Lundin
The minified JavaScript is effectively a binary artifact that we carry in the repo. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>