The same ComboBoxDelegate is used for picking a cylinder model
and picking a gas in the planner waypoint table. In the former
case we want to allow the user to edit the string in the second
we don't.
The difference is not if we are in the planner but which use of
the class. So add a bool allowEdit to the constructor.
Fixes#272
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Wfloat-conversion enabled for C++ part of the code
Fix warnings raised by the flag using lrint
Original issue reported on the mailing list:
The ascent/descent rates are sometimes not what is expected.
E.g. setting the ascent rate to 10m/min results in an actual
ascent rate of 9m/min.
This is due to truncating the ascent rate preference,
then effectively rounding up the time to reach each stop to 2s intervals.
The result being that setting the ascent rate to 10m/min
results in 20s to ascend 3m (9m/min), when it should be exactly 18s.
Reported-by: John Smith <noseygit@hotmail.com>
Reported-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
In preferences->profile:
Move "bar" from text description to entry field (5x)
Move "l/min" from text description to entry field
Add suffix "%" to GF values
Rename VPM-B conservatism
In planner preferences:
Add prefix "+" to VPM-B conservatism
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Warning introduced in e8c918622f:
desktop-widgets\templateedit.ui: Warning: The name 'horizontal
Layout_3' (QHBoxLayout) is already in use, defaulting to 'horizontalLayout_31'.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is needed in the altitude pressure conversion as there
negative altitudes are possible (for diving in the netherlands
or the Dead Sea).
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Add minimum gas calculation to planner output.
Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime.
Connect UI signals and slots for recalculation of diveplan.
Disable minimum gas calculation if there was already a warning before.
If minimum gas result is larger then cylinder start pressure give warning message instead of result.
Add line break before pO2 warnings but only if warnings exist.
Signed-off-by: Joachim Ritter <jritter@bitsenke.de>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Using gcc option "-Wfloat-conversion" is useful to catch
potential conversion errors (where lrint should be used).
rint returns double and still raises the same warning,
this is why this change updates all rint calls to lrint.
In few places, where input type is a float, corresponding
lrinf is used.
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
Bottom pO2 gas option in planner should be always enabled because
also recreational dives can use nitrox and produce "high pO2" warnings.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Going to "Template -> Edit" now has a field to enter the
border width (in pixels as only that makes sense in CSS as a flexible
unit, TMK).
This field modifies the template_options.borderwidth Grantlee
property which is part of the bundled templates already
and allows the users to modify the borders of tables.
The C++ implementation was missing, while the HTML (template)
implementation was already in place. Overlooked during GSoC.
Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This marks the UI as modified and updates the maxdepth of the dive; it
ignores changes to the duration, doesn't modify the profile, so it's
nowhere near ready.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And hide them for now. This doesn't change anything visible, it's just
putting in place the pieces for later use.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
4 file types (that are very rarely used), did showup in the
import-import dive logs menu (e.g. the file filter), but were
missing from file-open logbook file type filter.
Just added them to the file-open part to be more consistent.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
It seems that in the .ui file, keyboard shortcut strings need
the notr="true" attribute to make them appear also in translations.
I found this on http://www.qtcentre.org/threads/62774-Translation-of-Shortcuts
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Enable translation for a few additional internal dive events.
Ensure that all event names in datatrak.c are collected for translation.
Ensure that for gaschange in profile info box the "cyl." string is also translated.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
The cylinder table was constructed very ealy from the contructor of the
planner, so early that the tr() functions are not registered. This fix
instantiates the cylinderModel from the maintab (as it is done
with, for example, the weightsModel) and lets the planner user
this instantiated (and proper translating) cylinderModel.
Fixes: #206
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Remove the default stylesheet ("Courier" 13pt) from the planner output QTextEdit.
Remove the content of the html property of the QTextEdit because we overwrite it when doing setHtml.
After printing copy the original dive notes string displayed_dive.notes back to the QTextEdit
Advantages:
Display is according to font settings.
ctrl - mousewheel for zoom always works.
Drawbacks:
Printing font is same as display font but can be adjusted by zooming before.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
The limits set in diveplanner.ui is intended for the unit set there,
meters. If we move between units we need to update the limits to.
This fixes#201
Signed-off-by: Anton Lundin <glance@acc.umu.se>