This way we can have attachment of fairly arbitrary size (which should
be extremely useful for long libdivecomputer logs). This isn't quite as
intuitive as what we did before - the user needs to pick an email app to
share with), but that doesn't seem too bad - and also... this way they
can share logfiles via Dropbox or analyze them in other apps).
If the file share fails for some reason, we fall back to the old method
with passing the combined logs as body to the support message.
As an implementation detail this keeps the correct path for the app log file around
(this was stupidly overwritten before).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The first location we should try is one that allows us to share files.
In theory this should work on every device, but we do have a few
fall-backs, just in case.
This also moves the Android specific include to the top which seems much
more standard.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In general, replace "dive master" by "dive guide".
However, do not change written dive logs for now. On reading,
accept both versions.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
With -Wextra, gcc/g++ complains that compound initialization
of weightsystem_t misses the auto_filled parameter. Add it.
For C++ code we might think about writing a constructor. However,
we use two versions: with and without copied string.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
And while doing that, have all the cases where we already include
qthelper.h simply use a define in that header file - but keep the two
other instances of the define where the C++ source don't need qthelper.h
otherwise.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt 6 will drop support for QRegExp.
Use QRegularExpression instead.
The exactMatch in getVersion() was rather bogus, given the pattern.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 105b60389c ("mobile: remove GpsLocation reference from qmlmanager") I
was a bit careless with the code removal and unintentionally also removed the
initialization of the progress callback. With this change the updates from the
download process are once again shown on screen in the mobile app.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This tries to make our fingerprinting code work better, by avoiding
using the "deviceid" field that has always been unreliable because we've
calculated it multiple different ways, and even for the same version of
subsurface, it ends up changing in the middle (ie we calculate one value
initially, then re-calculate it when we have a proper serial number
string).
So instead, the fingerprinting code will look up and save the
fingerprint file using purely "stable" information that is available
early during the download:
- the device model name (which is a string with vendor and product name
separated by a space)
- the DC_EVENT_DEVINFO 32-bit 'serial' number (which is not necessarily
a real serial number at all, but hopefully at least a unique number
for the particular product)
but because the model name is not necessarily a good filename (think
slashes and other possibly invalid characters), we hash that model name
and use the resulting hex number in the fingerprint file name.
This way the fingerprint file is unambiguous at load and save time, and
depends purely on libdivecomputer data.
But because we also need to verify that we have the actual _dive_
associated with that fingerprint, we also need to save the final
deviceid and diveid when saving the fingerprint file, so that when we
load it again we can look up the dive and verify that we have it before
we use the fingerprint data.
To do that, the fingerprint file itself contains not just the
fingerprint data from libdivecomputer, but the last 8 bytes of the file
are the (subsurface) deviceid and the diveid of the dive that is
associated with the fingerprint.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Only used in context of acquiring GPS locations with the mobile app, which
we no longer do.
Keep the DiveAndLocation structure around as that's needed by the
ApplyGpsFixes command.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Given the nonsense that Google and Apple makes us go through in order to
support this feature, it's time to cut our losses and walk away.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When viewing dives on mobile the notes field does not support rich
text. User formatting, output from the planning feature, etc will
render html as plain text.
Adding qml tag to support rich text
Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
Prior to this change, we had two different cylinder lists as models for
drop down boxes - one that prepends the "no default cylinder" entry
(which we need for setting up no default cylinder to be used in the
app), and another one that only includes actual cylinders.
The problem occured if a dive is created before the first time we edit
an existing dive: in this case we are applying indices across the two
models, but the indices are of course off by one; this results in
actually picking the wrong cylinder. So each time we try to edit a dive,
we end up with the previous cylinder in the list.
This commit simplifies the code by having only one place where we create
list of cylinder names (which is then used as the model for the combo
box). It also uses more logical names for the two 'flavors' of this list
to make it clear which one is supposed to be used (the regular list when
editing or adding dives, the one with the "no default cylinder" entry
prependet for the Settings page).
Reported-by: Brian Fransen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When strings in dive details wrap, the line spacing is too tight
in some circumstances. While not perfect, this change improves
the situation somewhat.
See #3263
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already showed the tags, but we didn't allow the user to edit them.
This tries hard not to create inconsistent or illogical tags by trimming
white space and being careful with how the tags are added.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the mobile version we should always allow a little more wait time for
the cloud server - there just seem to be more issues with response times
on mobile devices, especially when in places with poor data reception
(which isn't uncommon for dive sites).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Thus, the membuffer data is automatically freed when going
out of scope - one thing less to worry about.
This fixes one use-after-free bug in uploadDiveLogsDE.cpp
and one extremely questionable practice in divetooltipitem.cpp:
The membuffer was a shared instance across all instances
of the DiveToolTipItem.
Remves unnecessary #include directives in files that didn't
even use membuffer.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Since we no longer show the noisy git updates to the user, it has become
harder for them to know whether a sync to the cloud was successful.
Since a manual sync will never show the new 'what did you change and
here's how you undo it' notification, it seems easy enough to simply
show a status update.
This adds a passive notification with no action button after the user
either uses the main menu or pulling down on the dive list in order to
trigger a manual sync.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The goal is to enable a user experiencing crashes when applying GPS data
to their dive log to make all necessary data available to the
developers. Hopefully the clipboard is large enough to hold all the
data.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply force it to use the default font, which is bound to the
application font, which we SHOULD be updating when changing the regular
font size for the app, anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Sometimes (and it's unclear why that happens) after rotation the stats
widget is blank. Setting the first variable back to itself appears
enough to ensure that the statistics view is redrawn. Try to do that
programatically after a short delay.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The statistics themselves still are in a light theme, but at least the
rest of the UI now works in both regular and dark themes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we have a button on the notification to trigger an action, we need to
make sure there's space for that button.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is fun... with just a tiny bit of 'magic text parsing' we can allow
the backend code to add a button to the notification that will open the
context menu that will make it super obvious to the user how they can
undo an operation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we save after every operation in the mobile app, this allows us to
tell the user what we actually saved - and we can remind the user that
they can undo/redo the last operation.
The code gets more complicated because in the case that the operation
that triggered this change was an undo, we need to show the redo text to
describe what we are saving, and must point the user to the redo
operation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This isn't really useful for normal users and with the new 'multiple
notifications stay visible' feature in Kirigami it creates a really
weird and distracting user experience.
We should show the user a summart of what we did instead.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 24eac8df87 ("mobile: remove overwriting of line special case
in ui-notification") the code doing the line replacement was removed,
but the comment above that code wasn't updated.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to get the undo stack information into the commit message, we
need to actually call Command::init() to set up the callback.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Having this as the right action button (same one used for 'cancel' in
the edit screen) made it too likely to inadvertantly delete a dive. And
outside of testing, wanting to delete a dive really shouldn't be all
that common an operation. So remove the function from the action button
and place it into the context menu instead, right next to the undo
action so the user also is aware that there is an undo option.
Suggested-by: Peter Zaal <peter.zaal@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The filler element was placed incorrectly (in a position already used)
and worse the logic for its sizing was wrong.
This gets rid of a warning and creates the intended layout.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>