Commit graph

53 commits

Author SHA1 Message Date
Dirk Hohndel
a639332edf QML-UI: log the full version at start
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-20 08:02:05 -08:00
Dirk Hohndel
c3ebeadb34 QML-UI: allow toggling verbose mode from the UI
Hidden in the Developer menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-19 18:41:50 -08:00
Dirk Hohndel
41c59c1c8d QML-UI: more log message when retrieving web user id
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>
2015-12-19 16:20:20 -08:00
Dirk Hohndel
b9cd6bf38e QML-UI: actually show the right text for missing cloud credentials
If we have no credentials or invalid credentials, update the text on the start
page accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-19 16:08:10 -08:00
Dirk Hohndel
a26eda9700 QML UI: show better message about dive list at start
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>
2015-12-15 13:33:53 -08:00
Dirk Hohndel
8baae6a3b6 QML-UI: make dive edit almost sort of work
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>
2015-12-07 22:24:56 -08:00
Dirk Hohndel
803f5f9fbf QML-UI: that's not how you compare char pointers...
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>
2015-12-07 22:22:07 -08:00
Dirk Hohndel
091d099368 QML-UI correct cut and paste error
Stupidly the wrong functions were connected to the signals.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-04 20:39:12 -08:00
Dirk Hohndel
fd78f8dc1a QML-UI: re-architect the way we access network resources
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>
2015-12-04 19:51:35 -08:00
Dirk Hohndel
2fc99092fb QML-UI: replace the two ways to log progress with one
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>
2015-12-03 16:01:17 -08:00
Dirk Hohndel
2413f23cd5 QML-UI: open cloud storage once credentials were entered
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>
2015-12-03 14:54:30 -08:00
Dirk Hohndel
a0b83dc2f1 QML UI: different functions for saving Preferences and Cloud Credentials
Tapping Save on those two pages should only update the data that are actually
available on those pages.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03 14:30:30 -08:00
Dirk Hohndel
f17041e1cb QML-UI: refuse to save to cloud unless you loaded from cloud, first
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>
2015-12-02 18:49:02 -08:00
Dirk Hohndel
789c32bf4c QML UI: if load fails, don't continue processing data
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 17:50:47 -08:00
Dirk Hohndel
dcce7358ff QML-UI: make sure errors make it to the log
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>
2015-12-01 09:37:47 -08:00
Dirk Hohndel
da2da116b5 QML UI: add number of loaded dives to log
This way we can see if loading dives succeeded at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-01 09:15:40 -08:00
Dirk Hohndel
f6ae8bf3ea QML UI: don't load dives before the UI has been instantiated
This should deal with a big part of the delay when starting the app.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 10:15:04 -08:00
Dirk Hohndel
2f2e9da2cd Clear the Dive model before repopulating it
Otherwise we could get duplicate dives in the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 10:09:46 -08:00
Dirk Hohndel
b619b39fdd Another missing call to mark_divelist_changed
Thanks again to Lubomir for finding this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18 19:26:07 -08:00
Dirk Hohndel
0b804e5b21 Location service: make message delivery configurable
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>
2015-11-18 18:10:58 -08:00
Dirk Hohndel
74b15922f3 Location service: retrieve the userid using the cloud storage API
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>
2015-11-18 13:14:19 -08:00
Dirk Hohndel
18e52c1da4 QML UI: remove manual setting of web service userid
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>
2015-11-18 13:12:34 -08:00
Dirk Hohndel
76d0763527 Location service: make distance and time threshold configurable
Right now the distance is always in meters, the mobile app doesn't deal
with units at all, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14 09:10:06 -08:00
Dirk Hohndel
24404a401d QML UI: userid is stored in General settings
Not inside the CloudStorage group.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14 09:08:51 -08:00
Dirk Hohndel
7afed04520 Location service: upload GPS fixes to webservice
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>
2015-11-13 17:21:43 -08:00
Dirk Hohndel
577da54454 Location service: add ability to delete all stored GPS fixes
This may need an "are you sure" confirmation dialog...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-13 17:20:45 -08:00
Dirk Hohndel
d65b756c4f QML UI: add preference for webservice user id
This handles the user id for the Subsurface webservice for GPS location
tracking.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-13 17:15:28 -08:00
Dirk Hohndel
6a70793ba8 Location service: report number of recorded GPS fixes
This is mostly for debugging, to make sure that the recording of GPS fixes
works as expected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-13 09:17:13 -08:00
Dirk Hohndel
4b39971978 Location service: apply the saved GPS fixes to dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-12 20:23:00 -08:00
Dirk Hohndel
62f7ec11d7 Location service: store locations in settings
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>
2015-11-11 15:28:10 -08:00
Dirk Hohndel
cd7d6ae6e5 Location service: toggle the service from the main menu
That way we don't track the user's location until explicitly asked to do
so.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 15:28:10 -08:00
Dirk Hohndel
a29e74e2e9 Location service: move location provider into QML manager
Since we want to be able to toggle it from the QML UI that seems like a
better place for it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 12:38:23 -08:00
Dirk Hohndel
e7b2f04bec Location service: consistent way to output information
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>
2015-11-11 12:38:11 -08:00
Grace Karanja
56771159a8 QML UI: Show log correctly
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>
2015-08-31 15:49:09 -07:00
Grace Karanja
89c7e4cd67 QML UI: Show message when loading dives
Show a message at the start of fetching dives, so that the user knows
whats going on.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
ee13c5c282 QML UI: Add QML Log viewer
Add the ability to preview the application log in QML.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
5a7dbf0225 QML UI: Use AddDive instead of clear dive
No need to clear the dives when adding a new one.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:15 -07:00
Grace Karanja
a3bdf49b84 QML UI: Clear divelist model before starting new dive
When user clicks on AddDive, we should clear the model.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:14 -07:00
Grace Karanja
8d03d26480 QML UI: Start Add Dive feature
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>
2015-08-31 15:24:14 -07:00
Dirk Hohndel
32e5a8d29a QML UI: if the cloud credentials are set, open the dive list
There's no point opening to an empty screen and asking the user to do this
via the menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 09:15:04 -07:00
Dirk Hohndel
975ca2e56a QML UI: prevent crash when trying to set message without window
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>
2015-07-27 09:14:06 -07:00
Dirk Hohndel
a05e37188b QML UI: make sure the dive list is empty before loading dives
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>
2015-07-24 13:18:30 -07:00
Grace Karanja
ea11eff279 QML UI: Implement saving of cloud password
If the user ticks the 'Save Password' box, then we save the password
for future use.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-22 09:53:19 +03:00
Grace Karanja
df1a1f7034 QML UI: Implement saving of dives
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>
2015-07-17 19:12:39 +03:00
Dirk Hohndel
15de7f0b71 QML UI: implement a message area to show information to the user
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>
2015-07-12 17:39:13 -07:00
Dirk Hohndel
4491c91b93 Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 17:36:49 -07:00
Grace Karanja
ebcf3e67c5 QML UI: whitespace fix
Fix some whitespace issues in the QMLManager and DiveListModel
classes.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:04:18 -07:00
Grace Karanja
866d67c5e7 QML UI: Load dives from cloud
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>
2015-07-10 06:03:56 -07:00
Grace Karanja
5791f580df QML UI: add cloud credential fields to the QMLManager class
These fields will be used by the QML Ui to save/retrieve the user's
cloud credentials.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:03:20 -07:00
Grace Karanja
e4e6e896c1 Fix bug where dives are shown twice
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>
2015-06-20 14:28:49 -07:00