At least one tester cannot retrieve their web user id. This should help us
collect more data and figure out why this fails.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now the message should make more sense. First it tells you that it's looking
for dives. Then you get some progress during the git download, and error
messages if things failed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So this has a lot of caveats:
- right now it only works for buddy, divemaster and suit
- you have to actually exit the field with your cursor or the change
doesn't take - that's ridiculous, there must be a far more clever way to
do this
- because I use the onEditingFinished handler I can't do this for the
Notes (so here's another reason why I KNOW that this is the wrong way to
do this)
But it shows in principle how this could be done and once someone who
actually knows what they are doing gets their hands on the code I'm
optimistic that this can be morphed into something much more useful.
It does tie together the changes made in the previous commits so that both
clicking around on the dive list gives the expected results and synching
the data back to the cloud actually works.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Well, at least it doesn't what you think it does. Let's use our little
helper to actually compare the strings.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We really need to verify that the credentials are valid before trying to access
our backend resources. Trying to do so in a clean manner caused quite a bit of
changes to how we retrieve the webservice userid and how we load the dive list
from cloud storage.
So instead of accessing the network resources directly, this adds a handler
function that first checks the validity of the credentials (by using the
rederict handler on the cloud server), and only calls the function that does
the actual work (looks up the web service userid, loads the dives) if that
succeeds.
Right now there is no good user feedback mechanism - this just gets logged on
the log page. But this is a massive improvement if there are issues with
network connectivity or if the user mistyped their credentials.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The logging to the UI didn't work anymore since the message area had been
removed in commit 8646934ba3 ("Simple DiveList as initial Page").
This way all the updates simply land on the Log page.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes for a much more friendly first use experience:
Open Subsurface-mobile, enter your cloud credentials, tap on Save and you see
your dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This prevents people from overwriting a perfectly fine repository with an empty
one. Typically happens when you first enter your cloud credentials and then
don't Load Dives right away.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
get_error_message() clears the error message in the process, so calling it
twice in a row does not do what you might think it does.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of directly using the status output for the QML UI, set up the
function used to display messages to the user as part of the constructor.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should actually not be in the mobile section at all. This needs to be
available on the desktop as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's just not user friendly to have two different user IDs for two
different web services that we provide. Instead in the following commits
we'll add a way to retrieve the location service web service userid with
your cloud storage user id.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this Subsurface-mobile should be able to mostly replace the companion
app. This needs some more testing and fine tuning (for example the minimum
time / distance should be configurable, there should be a location name),
but I think the hard part is done now.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is rather simplistic and will clutter the settings. I'm not convinced
this is the BEST way to do this, but it's a rather straight forward way to
get persistant storage of the location fixes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
qDebug is nice when testing on the desktop, but it has to go to the
message area on an Android device to make things easy.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly show the log messages. The log window will display all
messages emitted by the QML Manager class.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Start working on the add dive feature, to enable the user add a
new dive using the mobile UI.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
If we try to set up a message before the window has been instantiated we
should ignore the message, not crash.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When testing subsurface-mobile on the desktop from an account that had a
default file set up in the Subsurface preferences that file would already
be loaded creating rather confusing output.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This implements saving of some dive details to the cloud service. When the
user closes an open dives, any changed details will be cached, and when they
click on the 'Save Changes' button is pressed, the changes will be saved to
the cloud.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
This is just a quick first stab to do this, but it at least allows us to
share some information with the user.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Load dives from the Subsurface cloud service using the user's saved
credentials. This will display the dives in the same way as loading
them from a local file.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
On the QML page, dives are repeated. Adding process_dives to
QMLManager after calling parse_file solves this.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>