Update the function to create the dive duration string in a way that
it can be used also in info and stats tab and added some more flexibility.
Changed layout for <1h freedives to "0:05:35" (w/o units) or "5:35min"
(with units and :) or "5min 35sec" (with units with space).
Add a new function to create the surface interval string.
Completely remove old function get_time_string() and get_time_string_s().
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Issue #272 lead to the introduction of a new private property of the
ComboBoxDelegate class (editable). This new property was not correctly
set when creating the weight system delegate. This corrects the (trivial)
error, and now allows edit of the weight system name.
Fixes: #392
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Moving the GUI independent Seabear import functionality to Subsurface
core. This will allow Robert to call it directly from download from DC.
Tested with H3 against released and daily versions of Subsurface. The
result differs somewhat, but it is actually fixing 2 bugs:
- Temperature was mis-interpreted previously
- Sample interval for a dive with 1 second interval was parsed
incorrectly
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Tags are handled differently from other fields, we need to call
the special handling after the new dive was added and marked as
the current dive.
Fixes: #369
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we don't have a GPS service userid in the preferences and the GpsLocation class
isn't instantiated, this would cause a crash.
Fixes#367
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Changes to the "Add pictures to dive" function:
- Make Exif handling more tolerant by removing the JPG sanity
check for EOI
- Give info to user if exif.cpp can't identify a Exif date/time
- Restrict file dialog filter for correct picture time by DC photo
to JPG because Exif is only available from JPG
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Connect up all the settings that are the same, and remove those who are
not, and correct those who only are minor differences.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
This is mostly copy-paste from the ostc3 case, but there are some minor
differences. Some minor things have different meaning, and there's a
slightly different command set, but I couldn't figure out a sane way of
joining them.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Giving the string " and " to transiflex seems to fail and/or
it's highly possible that the translators make a mistake by
translating it into "and" or " and" or "and ".
Change the string to "and" and hard code the whitespaces before and after.
Change O2 to O₂ in statistics.
Translate "He" and "O2" in statistics.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
... to make it look more similar. This includes:
- Same spacings between the boxes
- Same way how to use the available space
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
... dialog (part 2)
Show date/time of first/last selected dive instead of displayed_dive.
Thats more useful to identify the right time offset for the images.
Trigger first update of image info already in constructor of the dialog.
Update the results and UI also when the "backwards" radio button is changed.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
For the list of pictures with inappropriate date/time not fitting with
the dive time use a QTextEdit in read only mode with scroll bars
enabled instead of a QLabel.
Also update and translate some strings used there.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
We need to make sure the model is avaliable for the table
until it hits the destructor.
Fixes#347
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
See https://github.com/Subsurface-divelog/subsurface/issues/342. The reason is
that we never get a DC_EVENT_DEVINFO when doing a memory dump. Just do not
offer to update firmware when we are creating a libdc dump.
Full credits of this fix go to Anton.
Fixed-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
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>
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>
This fixes an issue where beginRemoveRows is called with argument -1
in DiveImportedModel::setImportedDivesIndexes.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
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>
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>
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>
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>
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>
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>
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>
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>
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>