Commit graph

13298 commits

Author SHA1 Message Date
Berthold Stoeger
c21e998277 Don't create GeneralSettingsObjectWrapper object
Instead use the application-wide instance. Creating a local
object defeats the whole purpose of these objects - nobody
can receive signals in case the settings changed.

No other cases of locally created SettingsObjectWrapper
objects were found.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-14 17:01:34 +01:00
Berthold Stoeger
074ddc0596 Remove function isCloudUrl()
The function isCloudUrl() was only called in one place, parse_file().
But, isCloudUrl() could only return true if the filename was of the
git-repository kind (url[branch]). In such a case, control flow would
never reach the point where isCloudUrl() is called, since
is_git_repository() returns non-NULL and the function returns early.

Therefore, remove this function. Moreover, adapt the affected if-statement
by replacing "str && !strcmp(str, ...)" with the more concise
"same_string(str, ...)".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-14 17:01:05 +01:00
Jan Mulder
375490dfc9 CHANGELOG.md
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 08:23:27 -08:00
Jan Mulder
239974d600 mobile: reset download screen in a sane state
Set download srceen in a sane state after a previous download
session using this screen. The erroneous behavior was very
similar to the one fixed in commit 7fe9bbe295dcf92. For example,
download some dives, quit the screen, go back, and the bottom
buttons are still selectable.

This commit resets some values when leaving the download screen
(ie. not only swiping it away), so that it looks sane at a next
visit.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 08:23:27 -08:00
Jan Mulder
59f86a06ad mobile: reset Retry button to Download
Reset the Retry button on exit of the Download from divecomputer
page. So, it it not reset wehen swiping this page away, or
cancelling a running download, but resetting it on accepting
downloaded dives.

As we do not have real error reporting (from download failures),
this all is a little arbitrary. Another "fix" could be, not
changing the button text at all.

Further notice, this is not specific iOS, but also Android.

Fixes: #895

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 08:23:27 -08:00
Dirk Hohndel
88141fb70d Add CHANGELOG for the last merge
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-13 05:51:39 -08:00
Stefan Fuchs
82170579ad Enable removal of pictures from different dives at the same moment
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13 05:48:20 -08:00
Stefan Fuchs
7bc77947f6 Fine tune the position of pictures in the profile
Start a new column a little bit earlier otherwise it will get difficult
to fit a high number of pictures.
Don't put more than ~16 pictures in one column.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13 05:48:20 -08:00
Stefan Fuchs
003e490dd2 Reenable picture tab when dive trip is selected
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13 05:48:20 -08:00
Stefan Fuchs
5b7e4c57f7 Dive pictures show pictures of all selected dives
In the dive picture tab show pictures of all selected dive.
But at the same moment take care that in the profile only
pictures from displayed_dive are displayed.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13 05:48:20 -08:00
Stefan Fuchs
a11622623a Remove unused divesitepicturemodel from qt-models
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13 05:48:20 -08:00
Jan Mulder
3479c9e197 applying gps fixes: group repetitive code under a macro
See 2182167b53. Keep the dupicated code in sync.

Originally-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 05:07:15 -08:00
Jan Mulder
ee9531f76e Do not prefer gps fixes just for being into dive time
See commit 6f42ab46da. Unfortunately, this code is duplicated
(and an obvious candidate for code cleanup). So replicate the mentioned
commit here. In fact, the mentioned issue #666 talkes about the mobile
app, and the fix was only done for the desktop.

Originally-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 05:07:15 -08:00
Jan Mulder
5707554e98 mobile: do not just create a new dive site
This fixes an annoying bug. When entering an existing divesite
in the mobile app, always a new divesite (with same name) was
created, resulting in multiple sites on the same gps location.

So, be more carefull in checking and creating a new site.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 05:05:49 -08:00
Jan Mulder
3a64d8a481 CHANGELOG.md
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 05:03:36 -08:00
Jan Mulder
9d2c52f692 Add pSCR divemode detection
In libdivecomputer, a new divemode is added (DC_DIVEMODE_SCR) useful
for dive computers that have specfic functionality for semi-closed
rebreathers. At this moment, only the HW computers seem to provide
this.

This commit takes care of proper recognition of this new divemode
when importing data from a dive computer.

Tested on an actual import from an OSTC3 that contained
dives in this new mode.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 05:03:36 -08:00
Jan Mulder
78d1a3ed58 Rename DC_DIVEMODE_CC to DC_DIVEMODE_CCR
This is just code cleanup. Jef renamed the CCR divemode constant
in libdivecomputer, but added a define to be backward compatible as
as well (so this rename did not break our Subsurface build).

Obviously, this breaks the build for people that build against an older
libdivecomputer, but I see no reason to do that.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 05:03:36 -08:00
Dirk Hohndel
c12e14a61d Update to the latest libdc version
This gets us the first merge with the upstream iostream implementation.
This requires a small change for serial_ftdi.c to build.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-12 21:16:19 -08:00
Berthold Stoeger
4ac5b9c965 Simplify mainwindow title logic: remove MainWindowTitleFormat enum
The MainWindow::setTitle() function was passed an enum, which depended
on whether existing_file is set or not. The check can be (and was!) done
directly in setTitle(). Therefore, remove the whole enum.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11 23:10:09 -06:00
Berthold Stoeger
931bcc1966 Remove unused variable in on_actionCloudstorageopen_triggered()
This was an artifact of commit 136110784e

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-12 04:08:58 +01:00
Robert C. Helling
256ae870a6 Write profile images to correct directory in TeX export
Before, we did not look at the path of the filename to export
to but we should write the images there and not in pwd.

Fixes #931

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-11 20:26:22 +01:00
Berthold Stoeger
ae26875a61 Use the copy_string() helper function in set_filename()
copy_string() does the same as the current code, but in one instead
of four lines. Strictly speaking, it does not exactly the same thing
because the empty string ("") case is handled differently. copy_string()
returns NULL instead of a copy of "", which is probably preferred anyway.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11 00:17:39 +01:00
Berthold Stoeger
ea0cbba804 Remove second parameter (bool force) in set_filename()
The last force=false case was removed in commit 96d1cc570e.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11 00:17:39 +01:00
Berthold Stoeger
fa469aa86c Fix broken link in CONTRIBUTING.md
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11 00:14:09 +01:00
Salvador Cuñat
1c2127d232 location service: reduce default thresholds
Current values (1000m, 10 min) may be too long to choose an accurate fix
while automatically applying gpsfixes to dives. They are fine if we are
diving from a static position, but will give wrong positions e.g. while
drift diving.
Reducing the default values to shorter 100m, 5min won't hurt most dives
from shore or static boats, but will make other diving styles get more
accurate gpsfixes.

signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-10 11:38:19 -08:00
Salvador Cuñat
2182167b53 applying gps fixes: group repetitive code under a macro
Title is self explanatory.

[Dirk Hohndel: small edits to remove typo / improve readability]

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-10 11:38:19 -08:00
Salvador Cuñat
6f42ab46da Do not prefer gps fixes just for being into dive time
ATM we were giving preference to a gps fix taken during dive time over
another taken before dive start time (proven both in predefined
SAME_GROUP 6 hours range).
While this logic is right for a static boat or a shore dive - as it
ensures a correct position - will fail for drift dives or dives where
boat changes its position during dive time.

Instead, will choose the gps fix closer to the dive start time.

fixes issue #666

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-10 11:38:19 -08:00
Berthold Stoeger
c3c5256dc4 Remove outdated comment
The removed comment in qt-models/divepicturemodel.h described
todo items which were already implemented.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-10 15:00:53 +01:00
Berthold Stoeger
92ad7865d0 Make thumbnail code threadsafe
The thumbnailing in qt-models/divepicturemodel.cpp was performed
concurrently, but the thumbnailCache was not protected from races.
Resolve this by guarding the thumbnalCache accesses with mutexes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-10 15:00:53 +01:00
Berthold Stoeger
c73828d605 Simplify DivePictureModel
The code of DivePictureModel used a QHash to keep track of thumbnails.
Not only was the code rather complex - it also had the consequence that
pictures are sorted according to the hash function, i.e. seemingly
random.

This commit replaces the QHash by a simple QList which keeps track
of thumbnails and some meta-data.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-10 15:00:53 +01:00
Berthold Stoeger
a07d3b7bfe Whitespace fixes in qt-models/divepicturemodel.cpp
Note that constructs like QList<QFuture<void>> is incompatible with
pre-C++11 compilers. But the code base is so full of C++11isms that
we may just as well remove asymmetric eye-sores of the kind
"QList<QFuture<void> >".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-10 15:00:53 +01:00
Miika Turkia
2e340d3a61 Include cylinder pressures on export when they exist
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-10 11:29:52 +02:00
Miika Turkia
2b484316e4 Check that cylinder start and end pressures exist
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-10 11:29:52 +02:00
Miika Turkia
38cc8bdc40 Support dctype/divemode on UDDF import
This will grab the divemode information from the first waypoint within
the dive that includes this info and uses it for dctype.

Note that our dive type is not as fine grained as the one in UDDF. The
latter allows one to switch divemode during the dive when we do not.
However, one could argue that i.e. a rebreather dive should be a
rebreather dive even if one switches to bailout gas at some point...

Fixes #922

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-10 11:29:52 +02:00
Dirk Hohndel
5c8ad329f5 Cleanup: remove duplicate alias in qrc
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-08 16:29:49 +01:00
Dirk Hohndel
39ed1b657a Cleanup: remove unused parameter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-08 16:29:49 +01:00
Dirk Hohndel
4ccb70011c Cleanup: mark unused variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-08 16:29:49 +01:00
Dirk Hohndel
03e14fa2c3 Cleanup: constructLocationTags isn't used in Subsurface-mobile
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-08 16:29:49 +01:00
Dirk Hohndel
ef8b2e6bb7 Cleanup: rename file to avoid confusion
Depending on the tooling, both divesite.c and divesite.cpp would compile
into divesite.o.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-08 16:29:49 +01:00
Dirk Hohndel
03b02c9352 Cleanup: mark parameter as potentially unused
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-08 16:29:49 +01:00
Dirk Hohndel
fc3828a78e Update ReleaseNotes and README after release
This also fixes a small oversight in the README.md. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-07 19:44:13 -08:00
Joakim Bygdell
e9bcca9103 Mobile: Enable editing multiple buddies
While the autocomplete function only works for the first entry
adding multiple comma separated buddies can still be done.

Fixes #608

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-12-07 21:43:17 -06:00
Dirk Hohndel
a2a2aec9f0 Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-07 15:15:37 -08:00
Dirk Hohndel
c630d77f7a Update README
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-07 15:15:37 -08:00
Dirk Hohndel
789a7ac027 Small changes to ReleaseNotes format
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-07 15:15:37 -08:00
Lubomir I. Ivanov
43fc5b6f9e ReleaseNotes.txt: apply CHANGELOG.md
- Minor formatting changes
- Added a couple of missing notes
- Make the ReleaseNotes.txt format to indicate the latest
version on top

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-07 15:15:37 -08:00
Robert C. Helling
1c223b09c3 Show BT device names first
Show them left of address (so they are in the user's view) rather
than on the right.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-07 18:15:40 +01:00
Dirk Hohndel
127abec62c Update libdivecomputer
Pull in change to correctly obtain the git SHA when included in a project as
git submodule.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-06 22:59:34 -06:00
Dirk Hohndel
7388a8120a Android build: fix android-build-wrapper.sh
I clearly had forgotten to update the Android specific scripts when
adding the libdivecomputer submodule.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-06 20:47:20 -08:00
Dirk Hohndel
9434c36b7f Android build: build the libdivecomputer submodule
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-06 19:02:58 -08:00