Commit graph

316 commits

Author SHA1 Message Date
Jan Mulder
3b9c32a050 UI: preferences-profile screen beautify
Stefan suggested "Maybe it would be nicer to move the 3 fields for the
maximum pressure for N2, He, O2 for MOD to the right in the UI window
exactly below the maximum field for the O2 (where we now have
minimum + maximum)."

And I agree, so this is the change.

At the same time, reset the tab-order to a logical one.

Reported-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-29 13:21:50 +02:00
Jan Mulder
bb31c77597 minimal pO2 threshold: split max threshold into min and max
Nothing really special here. Just a split of the only p02 max threshold into
a min threshold and max threshold, and the adaptation of the UI. Change of
translatable strings included.

ref: https://github.com/Subsurface-divelog/subsurface/issues/259

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-28 11:17:03 -07:00
Jan Mulder
ec7206a475 compile fix
commit 597539ce39 breaks my compile. Fixed here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 22:01:30 -07:00
Jan Mulder
cbe6e8e62b UI: typo fix
Trivial typo fix, suggested in issue #274. Apnea is more common than
Apnoea, and Apnea is also used in the code already, so, more common
and more consistent. Hmm. A lot of text for a one letter fix.

Close of issue suggested #274.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 22:01:04 -07:00
Jan Mulder
588a83e339 Fix issue 280: Facebook without a dive selected
Accessing Facebook stuff without a dive selected (as in an empty logbook)
just SIGSEGVs. Just be more carefull.

After this fix, it is still possible to upload an "empty dive" to FB. Ok,
a little pointless, but a nice picture of the Subsurface logo is uploaded
to FB. Consider it an easter egg :-)

Fixes: #280

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 21:58:29 -07:00
Jan Mulder
ae7913599c QStyleOptionViewItemV4 is deprecated as of Qt 5.7
Trivial change to silence compiler waring about QStyleOptionViewItemV4 being deprecated.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 21:55:24 -07:00
Robert C. Helling
99351b7b73 Allow cylinder names to be edited
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>
2017-03-26 21:53:57 -07:00
Jeremie Guichard
597539ce39 Fix double to int truncation in C++ code
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>
2017-03-24 09:39:25 -07:00
Stefan Fuchs
2e2ccc1c52 Prefix and suffix changes in preferences and planner preferences
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>
2017-03-18 08:34:04 -07:00
Martin Měřinský
6305361d14 Settings Graph is about dive Profile. 2017-03-13 10:28:06 -07:00
Martin Měřinský
25dcee139e Settings Defaults > General
These are more general options, than default values.
2017-03-13 10:28:06 -07:00
Martin Měřinský
3d89914633 Use GFLow, GFHigh (not GFlow, GF Low, GF low). 2017-03-13 10:28:06 -07:00
Martin Měřinský
71d48142ac Planner uses "Conservatism level", do the same for Settings. 2017-03-13 10:28:06 -07:00
Martin Měřinský
2b5a2352ea Remove unused DateWidget with its icon. 2017-03-13 10:25:51 -07:00
Lubomir I. Ivanov
e43e98686c templateedit.ui: give the layout for "Border width" unique name
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>
2017-03-12 09:19:03 -07:00
Dirk Hohndel
b8af3733ec Silence warning about unused parameter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11 08:51:46 -08:00
Dirk Hohndel
08284275e7 Merge branch 'master' of https://github.com/dje29/subsurface 2017-03-11 08:41:41 -08:00
Martin Měřinský
f7cbe24779 O2 > O₂ 2017-03-11 08:10:10 -08:00
Martin Měřinský
95d5771513 We use 'setpoint' in UI. Use it also for documentation and comments. No semantic change. 2017-03-11 08:09:07 -08:00
Martin Měřinský
dcf2542215 Use abbreviations with dots. 2017-03-11 08:09:07 -08:00
Martin Měřinský
bdb83fd9b5 Use 'Temp.' for abbreviations. 2017-03-11 08:09:07 -08:00
Stefan Fuchs
fa7d3b6ecb Add tooltip for add cylinder button in planner
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11 08:07:35 -08:00
Robert C. Helling
295b1b78d8 Make depth conversion work for negative depths
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>
2017-03-11 08:03:25 -08:00
Stefan Fuchs
8a4d3876d6 Disable minimum gas calculation for recreational mode
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11 08:01:35 -08:00
Stefan Fuchs
7f8c3592ce Minimum gas calculation - Calculations and UI parameters
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>
2017-03-11 08:01:35 -08:00
Jeremie Guichard
406e4287eb Change calls to rint into lrint avoiding conversion warnings
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>
2017-03-08 14:04:17 +07:00
Martin Měřinský
9c2619ea3b For About UI window layout, use SetFixedSize.
Window is resized according to its content.
There is no need for user to resize this window.
2017-03-07 21:45:05 -08:00
Stefan Fuchs
e34e2693ea Enable bottom pO2 option also for recreational dives in planner
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>
2017-03-07 16:21:28 -08:00
Lubomir I. Ivanov
e8c918622f Printing: support the "Border width" setting for templates
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>
2017-03-06 20:08:39 -08:00
Martin Měřinský
831fe3d7f9 fix: User survey UI.
Enable window resize (Lay Out in a Grid).
Center first label and it's text.
2017-03-06 06:40:00 -08:00
Dirk Hohndel
d36f056bde Get initial depth/duration correct when manually adding dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
b60b7c108e Enable manual setting of duration
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
03eef5b0c2 Implement manual setting of depth
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
74b542ee60 Initial response to entering duration or depth
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>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
ba570c9eea For manually added dives, show depth and duration
So far this is purely informational, you can't edit this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
05b53d6204 Add depth and duration fields to maintab
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>
2017-03-04 12:16:49 -08:00
Martin Měřinský
59d18a00db divecomputer > dive computer 2017-03-04 12:08:17 -08:00
Martin Měřinský
67bba5d1c2 cu ft > cuft 2017-03-04 12:08:17 -08:00
Martin Měřinský
46e956aede ppO2 > pO₂ 2017-03-04 12:08:17 -08:00
Stefan Fuchs
7eda24d6b1 Correct "set-point" -> "setpoint" and window title setpoint change
Change 2x "set-point" to "setpoint".
Correct window title for "Add setpoint change" window.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-04 12:04:20 -08:00
Jan Mulder
0f56a1e4bf Add 4 file types op file-open logbook menu filter, consistency
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>
2017-02-25 09:18:53 -08:00
Jan Mulder
7165cb473a Correct file list in file-open filter box
Some missing ;; caused the filter on filetypes in open-open logbook to be garbled.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-02-25 09:18:53 -08:00
Dirk Hohndel
5b8bde8e1e Bring back style sheet HTML for planner output
This is a partial revert of commit 4f2a7dc972 ("Remove default
stylesheet from planner output").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-24 01:06:09 -08:00
Robert C. Helling
0b770b1379 Menu keyboard shortcuts in translations
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>
2017-02-23 03:13:00 -08:00
Stefan Fuchs
b39b641a05 Translate names of additional dive events and nicer format info box text
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>
2017-02-21 13:11:19 -08:00
Jan Mulder
5c89115efe Fixes cylinder table headers not translated
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>
2017-02-21 07:28:15 -08:00
Martin Měřinský
74b1f7ac5e facebook > Facebook 2017-02-21 07:03:10 -08:00
Martin Měřinský
e7467a43eb Remove space from the beginning of the line. 2017-02-21 07:03:10 -08:00
Martin Měřinský
f5a1a3e00a missing dot 2017-02-21 07:03:10 -08:00
Stefan Fuchs
4f2a7dc972 Remove default stylesheet from planner output
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>
2017-02-20 09:42:29 -08:00