First cylinder only, show warning if there are more than one cylinder defined.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now it is possible to enter a specific unit that is different from the
unit stored in the preferences. If only numbers are inputed the unit will
be the same as specified by the users preferences.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should have been obvious. Without explicitly asking for only local
git activity, it will connect to the remote.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since some users report hangs when changing credentials it would be useful
to see how far the application got.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise, when switching back and forth between two logins, during the
second switch the dive list is not loaded as the code checks against the
remembered git SHA before rewriting the dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise Qt attempts to be smart and re-uses previously successful
username (email) and password. This is an odd corner case, but it seems
the right thing to do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are several parts of the UI that will do better if they know if the
credentials that we have are incomplete (e.g., no password), invalid
(server rejected them), valid (server accepted them) or potentially valid
(we found a local cache for the email address, so that's likely correct,
but because we are offline we cannot (or have not yet) verify the
passord).
So far this is specific for the mobile UI - it might make sense to try and
use the same backend code and status tracking for desktop and mobile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing the duration of a dive, if only numbers are entered they are
treated as full miuntes.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
First cylinder only, show warning if there are more than one cylinder defined.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need to execute the same sequence of steps both when starting the app
and when switching cloud credentials. This way things will work correctly
when the device is offline and the user wants to switch accounts.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since this variable is specific to the cloud credentials in use, we need
to reset it when we change credentials.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It makes no sense to only do this the very first time we connect to a
cloud storage account. The existing code only happened to work because we
incorrectly tried to maintain the loadFromCloud status across restarts of
the application. So one bug hid another bug.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
What matters is that the cloud storage for a specific email address has
successfully been synced - and we need to remember this across restarts of
the app. This way Subsurface-mobile can work with different accounts, even
if offline.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
But only if there is only one weight system defined in the dive. Otherwise
display a read only text that explains that this cannot be edited.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I tried various things to do this from QML but it just doesn't seem to
work at all. So I gave up and instead added a trivial helper function.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By giving them a fake profile we can actually edit the dive profile in the
desktop app.
Fixes#998Fixes#1000
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now the UI shows "--" as place filler for empty data. That may or
may not change - but while it's there, we should not store that string in
the corresponding string fields of the dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As per Tomaz recomendation the helper functions from 19588ce and e072596
are moved from qmlmanager to DiveObjectsHelper.
[Dirk Hohndel: merged with the latest code]
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we are short on space on the mobile version, lets just show "Multiple" if
a dive has multiple cylinders.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Helper function that retrieved the total weight for a dive to be displayed
on the DiveDetials page.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Helper function that retrieves the cylinder description to be displayed in the
DiveDetails. Only the first cylinder for a dive is retrieved.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We were comparing apples to oranges on a few items and therefore more or less
always assumed that a dive had been modified.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If unit_system is set to imperial, we need to set the units explicitly
on mobile application.
Fixes#993
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While it makes sense to have the concept of "what's in memory" and "what's on
disk" in a desktop application, on a mobile device that seems like the wrong
approach. If the user edits a dive and taps on "save", they reasonably expect
this to be saved to storage (so our local cache of the remote git repository).
And "Upload to cloud" then pushes the data to the cloud server. It may even be
reasonable to do that automagically, but that I'm not so sure about.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise, if the device is offline we would not be able to store changes in
the local cache, completely defeating the purpose.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This only deletes the fix on the mobile device, not on the server.
And it is really really slow. Re-reading the data from the settings just isn't
a smart way to do this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
with the adittion of gpslistmodel/location, the libraries
qt-models had a direct dependency on subsurface-core, and
subsurface-core had a direct dependency on qt-models, this is
bad.
Moving a bit of code around I'v managed to clean this out, and
also to clear a bit of uneeded code (GpsTracker and gpsTracker where
basically the same thing.)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When starting ssrf-mobile, and the local divelist is identical to the
cloud version (so same sha1), a save of local modifications to the
cloud should be possible. This fix enables this by pretending
that a suppressed load from cloud on start is still a valid load
from cloud.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far the user can't interact with these. We should implement an ability to
visualize the GPS fix and to delete it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already keep those units around so the backend HTML exporter can match them.
So it makes perfect sense to also apply them in the mobile app.
Fixes#987
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A couple of members could potentially have been used uninitialized - it's
possible that this was the cause for people overwriting data in cloud storage
with empty dive lists.
See #985
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes two issues. In general, after edits the dive list wasn't updated so
it showed data inconsistent with what the dive details showed (clearly bogus).
Even more annoyingly, when we change the date or time of a dive it could
obviously move around in the dive list. So we need to resort the dive table and
recreate the dive list. For really long dive lists this is possibly overkill,
but in my testing this seemed very quick and much easier than trying to
manually get this right, even in the case where the list wasn't resorted.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>