On macOS the first of the four DC buttons was highlighted for some reason.
Explicitly setting autoDefault to no solved that problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The straight forward code to update the currentIndex of the combobox doesn't
appear to work on macOS (but works fine on Linux). Calling the event loop and
then calling update afterwards seems very unintuitive, but it appears to fix
the issue in my testing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The algorithm tries to keep the order of the buttons the same. So if a dive
computer was used that's already remembered, don't reorder the buttons. But if
a new dive computer is used, add it as the first one and move the others back,
potentially dropping the oldest one.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply create the buttons that can be used as shortcuts to previously used dive
computers. This isn't hooked up at all.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On import of dive media, the timestamp is read from the
metadata to check if the image belongs to the selected dives.
The pictures are then listed in a dialog.
Currently, the metadata is read twice if images are outside
of a dive: once in picture_check_valid() and if it turns
out that the picture is not valid again in picture_get_time()
to display the proper timestamp.
Even though metadata-extraction is reasonably fast, this is
a bit of an embarrassment.
Instead, read the timestamps only once in the constructor of
the dialog and from then on only used these timestamps. Keep
the timestamps in a QVector. Rename the picture_check_valid()
function to picture_check_valid_time() and pass a timestamp
instead of a filename.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The << alternative can reallocate the vector, but we know it's size, so
preallocate.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Unamed namespace behaves the same way as static variables in C source.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A minor change to the UI. The wording of the two items in the dive
list context menu "Load image(s) from file(s)" and "Load
image from web" are updated since we now deal with both images
and videos. So it becomes "Load media from file(s)".... etc.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Nowadays, we edit dives just by starting to enter data for the dive.
There is no need to explicitly ask to start editing the dive, using the
now removed menu option. This was a left-over of a long past history.
This is fallout from PR #1673.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
These also showed up as concerns when creating translation strings.
Adding them thankfully didn't create new strings, but not having them
potentially leads to incorrect runtime behavior.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As described in the referenced issue, we where able to navigate to
nonlogical static pages (like information, statistics. extra data) when
adding a dive. These are output style pages that make no sense on
edit or add. Further, disable access to some pages when entering edit mode.
Notice that the small change in file mainwindow.cpp is simply
because this this not work at all, and became superfluous any
way.
Fixes: #1445
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Add a checkbox that triggers replacement of all English characters by
x's in notes, buddy, dive guide and (while we are at it) suit.
This is ment for people sharing logs for debugging that are concious
about privacy issues. It leaves the lenth of strings in tact as well
as special charcters as those might be needed to track down a particular
parsing problem.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
1) Add a missing <div>
2) More importantly: recognize html content via <div>-tags instead of
<table>-tags.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Fix some broken translations in the dive list filter UI by adding
Q_OBJECT line to the class definitions of filter classes.
Plus simplify some strings given to translation by separating parts
like ": ".
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Suggested-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
It's a mamber of the cloud storage authentication class, used to hold the
proposed new password until the backend has accepted it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Actually remove the Subsurface webservice UI from the source, and
deal with all the fallout.
Notice that a part of the change in subsurfacewebservices.cpp is
a block of code that becomes unused, but might contain some valid
logic to be used later. Very similar code is in core/gpslocation.cpp.
And as I earlier broke something here, the unused code is ifdef-ed for
now.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
The very first part of the full removal of the GPS webservice. This
removes the UI artefacts and a tiny bit fallout. This leaves in place
all the background processing.
Be very careful here as this can break workflow of users that currently
have unapplied GPS coordinates sitting in the webservice, and do upgrade
to the version where this commit goes in. They have no clean UI way any more
to apply those GPS fixes from the desktop.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
get_units() returns a pointer to the units struct in the preferences.
Callers should not modify the preferences via this struct, therefore
make the return value point to const.
This is a small step in constifying the global preferences structure.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
If we don't auto-detect where the Garmin Descent is mounted, the user
can either just type in the correct path, or can use a file diealog to
specify it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
DiveTripModel (the model describing the dive-list) was destroyed
and recreated on every reset of the list. This seems excessive.
Instead - in analogy to most other models - make it a single
global object.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signals can be useful. In this case, a simple function call does
it. Thus, remove the signal. It can be readded later at an more
appropriate place.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In the UI it is possible to remove a dive from a trip twice,
which leads to a crash, because trip is NULL (obviously).
Instead of doing a proper fix (don't show the "remove from
trip" entry in the first place), ignore dives without a
trip, since a rewrite of the undo-code is planned for the
medium future anyway.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This reverts commit 321a920a98.
It appears that the load_xxx functions aren't called, so while the correct
values are stored to the settings, they aren't retrieved. Let's revert while
this gets fixed.
Fixes#1609
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This removes some special-case code for Uemis, replacing it with simply
passing in the device transport information.
This makes device enumeration work for the Garmin Descent (if it is
listed by libdivecomputer as a USB storage device, that is).
I don't actually do any of the libdivecomputer parsing yet, and only
have a stub for the Garmin Descent, but now the directory selection
works with that stub. The actual download obviously does not.
[Dirk Hohndel: removed obsolete FIXME from code]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also show a new firmware notice for a HW OSTC Plus. This appeared
to be broken (as can be verified on the current master from today,
as HW just released version 2.98 of the firmware).
Notice that there is some confusion in both Subsurface and
Libdivecomputer with respect to types of OSTCs. Physcically,
there exist 2 type of OSTC3's. The first edition with
only DC_TRANSPORT_SERIAL (and an USB connector), and a second
version that lacks the connector but supports both BT and BLE.
Confusingly, the second version is marked OSTC3 on the device,
but the user needs to select OSTC Plus (which is basically a 3rd
version of the OSTC3, combined with a successor of the OSTC Sport)
to download dives using BT/BLE.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Currently it is possible to hide all columns by unchecking them
in the context menu that appears by right clicking the header
of the divelist. But once all are hidden the header disappears.
This can cause a situation where the user cannot show any
columns and the only fix for that is to edit the application
configuration.
To avoid this sutuation prevent the last column from being hidden.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Include font metrics as part of the height in DiveListDelegate::sizeHint().
When 22px is hardcoded, this handles small fonts, but for larger
fonts it seem that the bottom of the dive list row text is cut
on Windows.
Keep 22px as the minimum size hint, but for larger fonts
use QFontMetric::height().
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The variables referenced are moved into qPref in earlier commits
so in general all QSettings calls are replaced by qPref*:: calls
Signed-off-by: Jan Iversen <jani@apache.org>
Add class variable tooltip_position to qPrefDisplay
Add class variable lastDir to qPrefDisplay
qPrefDisplay is updated to use new qPrefPrivate functions
Adjust test cases incl. qml tests
qPrefAnimations only has 1 variable, that really is a display variable
Merge the variable into qPrefDisplay, to simplify setup (and avoid loading
extra page in qml).
correct theme to save in correct place, and make it a static
class variable
Signed-off-by: Jan Iversen <jani@apache.org>