Commit graph

434 commits

Author SHA1 Message Date
Stefan Fuchs
45dd564ee6 Translate string "cancel download" in DC download widget...
and change string "Retry" to "Retry download".

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-23 08:08:10 -07:00
Dirk Hohndel
d82e200d35 Download from divecomputer: reset progress bar fraction
Otherwise when retrying, the progress bar might already be reset, but
its text might still show 100%.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22 13:55:46 -07:00
Dirk Hohndel
82d37e7451 Download from divecomputer: don't show bogus progress text
On some divecomputers we download all the data from the device and
then parse the data afterwards just in memory (at which point the
progress bar has already run all the way to 100%). So don't try to
show the dive number and time in that case.

Fixes #335

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22 13:49:07 -07:00
Dirk Hohndel
0bd02bf1f0 Download from divecomputer: stop timer on error
If we run into an error during the download, stop the timer that
triggers the update to the progressbar.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22 13:46:27 -07:00
Dirk Hohndel
2182f00177 Reduce default verbosity
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22 12:38:59 -07:00
Stefan Fuchs
bea1217f7b Move extra info tab in main window to the very right side again
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-21 11:27:15 -07:00
Stefan Fuchs
02e768a61b After DC import don't do RemoveRows if there is nothing to remove
This fixes an issue where beginRemoveRows is called with argument -1
in DiveImportedModel::setImportedDivesIndexes.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-21 11:26:49 -07:00
Jan Mulder
ff5c04eb97 Do not abort when there is no current dive
Yes, currentdive can be undefined in case of of a new logbook and starting the planner
right away. Do not abort on that.

Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-20 10:57:11 -07:00
Jan Mulder
89b914e47d Preserve dive mode when planning a dive
Data such as cilinders and used gasses are populated fromn the currently
selected dive when starting the planner. It is more logical to use
the dive mode (OC, CCR, pSCR) of the currently selected dive
as well. This commits changes this.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-20 10:57:11 -07:00
Stefan Fuchs
5e67a932cf More strict filter for URL handling in dive notes
Applie a more strict filter to URL handling in dive notes:
The URL needs to have:
- Scheme like "http:" or "mailto:"
- Host name like "www.test.de" or path like "/pathtosomewhere/"

Otherwise strings like "OTU:" or "Runtime:" are treated as URL.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-18 18:13:52 -07:00
Stefan Fuchs
c257144bab Fix a crash in the URL handling for the dive notes
URLs in the dive notes are detected today. A tooltip is displayed and
one can follow the URL by Ctrl-click.

In the function fromCursorTilWhitespace there is an issue with incorrect
return value of Qt (5.7?!) function cursor->movePosition(). This value is
erroneous true in some condition e.g. if the cursor is inside a table at
the very beginning or the very end of a table line and not moving any more.
This can cause the function end up in an infinite loop.

Bugfix adds an additional exit criteria for the loop if the string is
not growing any more.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-18 18:13:52 -07:00
Miika Turkia
c88be99d84 Fix a crash on exit
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-18 18:12:04 -07:00
Jan Mulder
f2d88619c5 Restore FB grayed out when disconnected
See https://github.com/Subsurface-divelog/subsurface/issues/253. The original
behaviour (greyed out when disconnected) is restored. Not sure where and when
got lost, but this simple change fixes it.

Fixes #253

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-16 07:43:23 -07:00
Jan Mulder
b809019c7a Also translate tab headers
After the restyle of the maintab code, the translation of some tab titles went
missing. Corrected here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-14 09:50:38 -07:00
Dirk Hohndel
86a98867f1 Fix build against older Qt versions
While the new syntax is nicer and faster, this isn't supported prior
to Qt 5.6 and we still support 5.5 on older OSs.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-12 20:24:24 -07:00
Tomaz Canabrava
385816be2e Aparently, remove a QXB warning.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:25:53 -07:00
Tomaz Canabrava
2f86cbdc36 Clean up some widgets
Simplify logic of handling the Message that this
dive is being modified.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:25:15 -07:00
Tomaz Canabrava
1fc4fba69f Break down MainTab into smaller classes
Maintab is one of our most complex classes, and it's
something I'm not actually proud of. But it currently
works and the idea of splitting it was in my head for
quite a while.

This is the third or fourth tentative of splitting it,
and this time I let the most complex part of it untouched,
the Notes and Equipment tab are way too complex to untangle
right now on my limited time.

A new class 'TabBase' should be used for any new tab that
we may create, and added on the MainTab (see the new lines
on the MainTab constructor).

Also, Extra Info, Information, Photos and Statistics where
ported to this new way helping reduce the number of
lines and functions on the MainTab quite a bit.

Overall this is a step in the right direction for the future.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:23:25 -07:00
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
Dirk Hohndel
d5ecc96ed6 About dialog: hook up Credits button 2017-02-18 16:22:39 -08:00
Dirk Hohndel
53d0eecb94 About dialog: add Credits button
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-18 13:51:40 -08:00
Miika Turkia
4375a87598 Include geolocation info on export XML (divelogs.de)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-02-18 10:48:33 -08:00
Anton Lundin
78059d4010 Update altitude limits on unit change
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>
2017-02-14 07:29:52 -08:00
Dirk Hohndel
08c42813e5 Revert "In statistics, ignore gas use of planned dives"
This reverts commit 1d8662006c.

Mistakenly pushed to master

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-03 07:31:03 -08:00
Robert C. Helling
1d8662006c In statistics, ignore gas use of planned dives
When merged with real dives, those would double count otherwise.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-02-02 12:37:24 -08:00
Joakim Bygdell
b0ec7146a0 Ignore double clicks on the divelist
Fixes #170 on GitHub

Simple catch function for double click events in the divelist,
prevents users from trying to edit the divenumber ithe wrong way.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-01-28 07:20:03 -08:00
Robert C. Helling
dbf1390094 Only set surface pressure when it has a value
When replanning a dive, do not set the surface pressure when it is 0.
Same for salinity.

This closes #161 .

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-18 06:50:01 -08:00
Anton Lundin
4714f50eae Notify Ostc 4 users about new firmwares
This adds support for notifying Ostc 4 users about new firmwares when
they download dives from their computers, gives them the option to
trigger the upgrade flow.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-01-12 14:15:53 -08:00
Anton Lundin
a5232a30b0 Document potential bug source
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-01-12 14:15:53 -08:00
Robert C. Helling
f3cf9525de Images from web currently only works for single pictures
so we should not suggest otherwise by plural form.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-12 14:06:54 -08:00
Robert C. Helling
db17adfb28 Make the URL dialog contain QLineEdit
as otherwise pressing RETURN does unexpected things.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-12 14:06:54 -08:00
Robert C. Helling
0f58510ce0 Provide an error message when downloadig image from web fails.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-11 05:43:14 -08:00
Robert C. Helling
935734100f Rename prefs.deco_mode to prefs.planner_deco_mode
This is to avoid confusion with planner.display_deco_mode.
When accessing the "current deco mode" use the decoMode()
helper function.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-06 20:43:23 -08:00
Dirk Hohndel
b2cc840ebf Facebook integration: change the menu entry to disconnect
This way the menu entry becomes the togglee it appears it was designed to be in
the first place.

This closes #129

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 22:24:48 -08:00
Dirk Hohndel
a63505dde9 Facebook integration: actually call the disconnect callback
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 22:21:47 -08:00
Dirk Hohndel
7e98016832 Facebook integration: whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 22:20:28 -08:00
Dirk Hohndel
c39fbea0ee Facebook integration: keep the connections QMenu around
This way we can change the text, later.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 22:19:08 -08:00
Henrik Brautaset Aronsen
ba23989e6b Update from 2016 to 2017. Happy new year!
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 10:28:25 -08:00
Dirk Hohndel
f9d9e0324d Mac: more generous margins for table columns
Fixes #974
Fixes #873

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 14:23:49 +02:00
Miika Turkia
8766054581 Hooking up av1.xslt for log import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2016-12-31 09:56:08 +02:00
Robert C. Helling
529a4d499b Start transition from QWebKit to QWebEngine
This removes all references to WebKit if cmake option USE_WEBKIT is enabled.
For the user manual it changes it to WebEngine (seems to work for me).

Similar for the Facebook connection (minus a reference to a cookie jar).
This I could not test at the moment, as I wrote this on a train.

Printing does not work, it is a null operation at the moment. Currently,
large parts of of the printing code are commented out as there is no direct
way to access page elements in WebEngine. It seems this needs to be done
via Javascript (with a callback invoked). There is new functionality in
WebEngine to render a view to a PDF file but this needs more work (and
probably some thoughts towards page breaks).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-12-30 19:43:00 +01:00
Anton Lundin
b511eb104a Document quirks with Ostc 4 versions
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-28 22:40:18 -08:00
Anton Lundin
e5fd59feca Notify all OSTC users about bluetooth prep
Use more general wording about bluetooth preparations, because nowadays
there are more computers than the Ostc Sport which use bluetooth.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-28 22:40:18 -08:00
Anton Lundin
edce764686 Check for firmware updates on new devices to
The list of OSTC devices have grown, and this updates our lists of for
which devices we should check for firmware updates.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-28 22:40:18 -08:00
Dirk Hohndel
754112beb4 Renumber ui: make it obvious which dives get renumbered
Using the menu entry or Ctrl-R is designed to renumber all dives, but
using the context menu renumbers only the selected dives. With this
change it becomes more obvious to the user what's happening.

Fixes #942

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-27 13:10:18 -08:00
Robert C. Helling
41d7942f63 Don't trust event->timestamp()
It seems the timestampt of QMouseEvents are not reliable on Linux. So we
better use currentDateTime to detect a double click.

Fixes #1103

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-26 13:09:01 -08:00
Dirk Hohndel
c8c4f8f0b9 Remove unused variables
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-26 12:52:20 -08:00
Robert C. Helling
fb2ba72e42 Set surface pressure and salinity correctly when replanning
We need to initialize the UI elements accordingly.

Fixes #1094

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-26 12:47:54 -08:00
Robert C. Helling
6504cd8c46 Reenable Facebook Postings
This is what Tomaz said should be done. Thanks!

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-24 06:18:20 +09:00
Willem Ferguson
6aa01372fd Provide phots summary on dive list (Part 2)
Please apply this patch on top of the previous patch with the same title.
1) Provide icons with white margin to look more like photos
2) Optimise code, following Robert's suggestions.
3) Column heading for photos column is now: Photos. This takes up extra
   horizontal space but makes the user interface more understandable.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-24 09:58:46 +09:00
Willem Ferguson
1fa855e1c0 Provide photos summary on dive list
1) Add an extra column to dive list, just left of Locality field.
2) For each dive, give summary of photos as follows:
   i)   no photos: no icon in that column
   ii)  photos taken during dive: show icon of fish
   iii) photos taken before/after dive: show icon of sun
   iv)  photos taken during as well as before/after dive: show
     icon with both fish and sun
3) Provide information for the sort operation to work on
   this column of the dive list.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-24 09:58:16 +09:00
Dirk Hohndel
c564e06d4e Manual revert of commit 9295b3aa37
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 20:37:35 +09:00
Robert C. Helling
05098f90cd Use fake profile when replanning dives without samples
This can happen when the user asks to replan a dive that
was imported from CSV.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-09 06:25:11 -08:00
Dirk Hohndel
89851d1071 Match ReleaseNotes and version numbering with reality
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-02 05:12:10 -07:00
Robert C. Helling
c25ca184ec Also grey out labels when not relevant for current deco mode
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-02 05:06:20 -07:00
Robert C. Helling
f01033f6a0 Actually turn on the vpmb radio button in VPM-B mode
this fixes a typo.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-02 05:05:55 -07:00
Willem Ferguson
7a863dc4c0 Reorganise Preferences->Graph
Remove one last leading space character that I missed.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 19:26:47 -07:00
Dirk Hohndel
c2735cba8e Fix duplicate labels in ui file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:58:28 -07:00
Tomaz Canabrava
37e3e7e69a Deco mode for plannining is not deco mode for showing
We had (in the wrong place, imo) a new feature that
should differentiate the different deco_modes, you could
plan your dive in buelhman and see it in vpm-b, for instance
but both of them accessed the same pref.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:41:17 -07:00
Tomaz Canabrava
c110b4a238 More preference handling fixes
Remove a few uneeded lines and add more loading code for
the preferences.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:40:43 -07:00
Tomaz Canabrava
f33f2812cf Use default values if value doesn't exist
By using the default value argument we can reduce
this code size to a half.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:39:58 -07:00
Tomaz Canabrava
df2dfa4706 Fix bug where the Font setting was ignored
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:37:52 -07:00
Willem Ferguson
d3e775e690 Updates to Preferences -> Graph
This reorganises the Preferences->Graph tab.
All leading spaces have been removed for labels and text fields.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:35:24 -07:00
Willem Ferguson
22c6568b46 Reorganise Preferences/Graph tab
1) Reorganise existing items in Graph tab so that all gass pressure
items are together and all profile-related items are together.
2) Provide units (mostly bar) for all settings having units.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:34:47 -07:00
Robert C. Helling
c47c3555f6 Warn user about wrong characters in date/time format strings
fixes #1098

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-28 07:30:22 -07:00
Rick Walsh
3566ebd544 Preferences ui: at tabstops to graph ui
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-27 20:36:25 -07:00
Rick Walsh
46f3b0f238 Planner: connect emitDataChanged slot to ascent/descent rate editingFinished
Call the emitDataChanged slot when ascent and descent rate spinboxes lose
focus.  Without this connection, rates are not updated immediately after
editing the value with keyboard numbers and hitting tab or enter.

It is necessary to keep the valueChanged(int) connections, because
editingFinished() is not triggered by changing the value with the arrows.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-27 20:36:02 -07:00
Robert C. Helling
02389c95cb Add country information to TeX export
This is a bit ugly since it does a regexp match on
divesite.notes but what can I do...

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-20 21:19:17 -07:00
Martin Gysel
0ea0272806 TeX export: check site pointer, before accessing it
Print empty string rather than 'null'

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-20 21:18:59 -07:00
Robert C. Helling
9b8a04089d Export to TeX file initialized
This does the basic export as a TeX file including a template.

It still lacks proper location parsing.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-11 22:00:08 -07:00
Robert C. Helling
0d20344c90 Add preference to change deco model
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-11 21:58:41 -07:00
Miika Turkia
abc42cc78d Read all files on TXT import
We need to read the file given as parameter, not the first in list.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-03 07:59:16 -07:00
Robert C. Helling
e388b5ab94 Add icon for heat-map
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-27 21:32:50 -07:00
Dirk Hohndel
f76f3775bb Print out Beta version numbers on About screen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:45:47 -07:00
Rick Walsh
7e09a6c7bc Separate VPM-B conservatism preference for planner and profile
Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for
planning dives and prefs.vpmb_conservatism for profile ceiling display of
saved dives.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:30:11 -07:00
Rick Walsh
7b891904e7 Rename conservatism_level to vpmb_conservatism
Make the variable purpose less ambiguous

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:29:56 -07:00
Miika Turkia
2b14a9c95d Support for comma as field separator for ADP
This adds support for comma as field separator for ADP import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:29:34 -07:00
Dirk Hohndel
131c5a2abe Fix building of Facebook support
No idea when this got broken. Fix seems like a hack as that variable
should get set in the plugin CMakeLists.txt. But it seems to work, so
"whatever".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-22 17:12:00 -07:00
Dirk Hohndel
b972bdb97d Language preference: store the locale name in the settings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20 12:48:30 -07:00
Dirk Hohndel
67a226c00a Language preference: search for the locale instead of the language string
And make sure that you use the language / country delimiter that we use in the
file system

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20 12:48:30 -07:00
Anton Lundin
f9cd09b000 Workaround abuse of the now missing DC_TRANSPORT_BLUETOOTH
The DC_TRANSPORT_BLUETOOTH is quite abused here, and I removed it in our
custom serial code. This works around the issue so subsurface still
compiles.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-18 07:11:34 -07:00
Rick Walsh
6f43c16ea9 Preferences UI: graph tabstop order should match display order
When 'tabbing' through data fields, the order should be the same as the order
displayed on the screen. Getting the order right in the .ui file fixes the
tabstop order without needing to define it explicitly.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17 13:38:12 -07:00
Tomaz Canabrava
0a6f6b4382 Settings update: Fix missing groups and Language initialization
There's one function named uiLanguage() that should return
the current uiLanguage() that subsurface is running, but
it actually sets a whole lot of preferences, I think
that the general idea of that function is okay, but it seems
broken for me.

still, I used it to load the correct language from the preferences
since it's what this function is currently doing right now.

Also, a lot of missing groups where added.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 22:37:15 -07:00
Dirk Hohndel
1bf76dd3db Settings update: Fix broken UpdateManger logic
In commit b76c1846bb ("Settings update: Simplify Update Manager")
the logic for when to show the UpdateManger question to the user got
broken. Unintuitively, a boolean setting actually has three possible
values. True, False, and Unset. This patch fixes things to work as
designed again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 12:29:08 -07:00
Tomaz Canabrava
9b2404fcb4 Settings update: Move loadPreferences out of qt-helper.cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
8f178301d8 Settings update: Use the Settings to store the plannersettings
Instead of settings things manually in the code. (btw,
if we use lambdas the code can be quite smaller)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
ad7524fda1 Organize the connect calls per object.
Just to make it easy on the eyes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
f8f87b7294 Settings update: Move preferences sync / initialization
Move Preferences sync / initialization out of the planner
widget prerferences to the ObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
12eccda523 Settings update: Fix Facebook Widget to use the SettingsObjectWrapper
Fix facebook widget to use the SettingsObjectWrapper instead
of figthing our complementary Settings each call.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
83236f7e9e Settings update: Some code cleanup
The only block of code that I removed here is because the
QSettings preferences that is being read is the exact one
that we populate on the prefs.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
a1b22797ca Settings update: Remove uneeded includes
and comment out questionable code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
db8e8957ab Settings update: Add "Dive Computer" settings to SettingsObjectWrapper
For some reason, the dive computer settings weren't in the
settings prefs. This moves it, makes the boilerplate on Settings
ObjectWrapper and make things compile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
b76c1846bb Settings update: Simplify Update Manager
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
4f2057cd30 Settings update: Fix "Units"
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
b5e98ec993 Settings update: Fix "Network" and "CloudStorage"
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
81d5d82b7b Settings update: Clean up save user id local
So, prefs.save_userid_local is being set outside of
a preferences set (it's set to true and false while
loading the files via xml or git) and because of that
I had to bypass a few method calls.

When something triggers a preferences change, the
application will be notified that the preferences
changed, thing that I couldn't do while reading the
xml or git because that should be local-only.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
048379cc2b Settings update: Fix "Language" settings
Save the language settings using the SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
bc95138f96 Settings update: Use internal prefs structure to read preferences
Don't use a QSettings to read properties, it's really
easy to mispell something. Just use the internal prefs structure.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
906d62ac7a Settings update: Fix settings in PreferencesGraph class
Use the SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:36 -07:00
Tomaz Canabrava
93c19b18a7 Settings update: Fix "geocoding"
Use the SettingsObjectWrapper to access "geocoding"

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:46:38 -07:00
Tomaz Canabrava
8f05afcda3 Settings update: Fix "General Settings", "Display", and "Animation"
First commit in the series that will unify the way to use,
save, and update settings in the core. This fixes the usage of
"General Settings", "Display", and "Animation" to use the
SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:46:32 -07:00