It makes much more sense to have this as a private member of the class instead
of a static in one of the functions.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Same context menu idea. The reason for adding this is that the context menu
always acts on the last page in the stack (so I guess the "right-most-one"). So
if you edit a dive and then open the log, you can't save the dive until the
dive edit is the last page which means you have to close the log, first. Not
ideal, but better than nothing and it works well enough. I still think we might
want to go back to a traditional "Save" button...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The automagic update gets disabled once we overwrite the text with "Save" at
some point, so instead we appear to have to do this manually.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Getting closer to being able to really edit / add dives in the mobile UI.
This works for manually added dives - needs a bit more thought for dives
downloaded from dive computers as we don't necessarily want to change the
maxdepth in conflict with the samples.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way the properties of the shown list element are updated based on what was
edited. This feels weird and backwards - but it appears to be the way to do
this - you literally update the elemnts in this specific instance of that QML
page.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code is rather inconsistent when it comes to the use of semicolons in the
JS code. Let's try to not have them...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a little hacky as it changes the units based on user input - a little
crude but works in the typical cases.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Scale the QML profile in two stages. Firstly, scale to fit. Secondly, scale
again to 95% to create a margin around the profile.
The previous method scales to fit a create a margin in one step. It appears
more elegant, and the margin is calculated more rationally. Unfortunately on
some devices, including mine, the resulting profile is cropped for no obvious
reason.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't use EmailCharactersOnly input method hint for the password. This fixes
the problem of password being displayed on entry, at least on my device.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We call the app Subsurface-mobile most of the time, let's do so for the app
name too
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
../android-mobile/res/drawable-xhdpi/subsurface_mobile_splash.9.png
../android-mobile/res/drawable-xxhdpi/subsurface_mobile_splash.9.png
../android-mobile/res/drawable-xxxhdpi/subsurface_mobile_splash.9.png
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adds 9-patch splash images, so that will not be distorted on different sized
and oriented displays.
Created with guidance from
https://software.intel.com/en-us/xdk/articles/android-splash-screens-using-
nine-patch-png
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We don't need any of the interactive features. Additionally this allows us to
easily ask for slightly smaller fonts.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As the group can be something else than dialout on some systems, mention
this on user manual.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 8c1cc4524d ("Don't reload identical data") I got a little
carried away. Before comparing SHAs we need to make sure that
a) this is a git repository at all
b) we have an actual SHA before we claim to have the data loaded
Reported-by: Paul-Erik Törrönen <poltsi@777-team.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The current code base depends on qtlocation5-dev which is not
in Debian 8 (Jessie). It requires Debian testing (Stretch).
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Found by cppcheck. Minor memory leak if usb_reset fails
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This probably is a serious bug, found by cppcheck.
Original code had paren's in probably the wrong place!
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For some users by default the password characters aren't hidden. Maybe the
debugging output will help us understand what's going on.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we already have the same SHA loaded and no changes have been made to the
dive list then there is no point in loading the dives again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way we can check if the local cache is in sync with the remote without
always triggering a load of the dives from git.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a simple way to deal with a "no network" situation. But this isn't
ideal, yet, if there is a slow network as the dive list will be reset again
once the sync from the cloud finishes. So there is some more thought needed to
make this work "mostly as expected".
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is actually not a change in the QML - it just conditionally compiles out
the code when building Subsurface-mobile.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The timedepthmode specifies the time in seconds when using si units,
otherwise minutes. This patch implements this support.
Fixes#981
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of doing the silly "onEditingFinished" we get the strings from the QML
components at the time we commit the change. Much more logical, much more
straight forward, no issues with the TextArea not having an onEditingFinished
signal.
This still has a few open todos: the temperatures aren't parsed, the edit
screen is missing depth and duration, we can't edit the dive time (and it isn't
passed in on the commit). But it's progress.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now we at least start out with the corret date, time and number. This still
isn't functional as a lot of the data aren't used and the way you save the data
is completely silly, but it's another step in the right direction.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Most likely when you manually add a dive on a device it is just about to happen
or just ended, so starting out with the current time is likely a good guess.
Which makes it the last dive in the dive list, so give it the next sequential
number.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This mainly happens because add dive is completely broken right now, but in
general it seems to be good policy not to blindly dereference this pointer...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I'm not sure this is the best way to do this - QML should be able to get to the
model data directly (I hope?). But this seems to work and I need it to make Add
Dive be semi-correct.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the dive detail view, if a location has an associated GPS location, show the
name of the location underlined so the user knows that tapping on it will open
a browser window with a map picture.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is of course stupid and NOT what we want to do, but one could argue it's
better than nothing (well, not sure, whatever). If we have a GPS location
associated with a dive and you tap on the location name when showing the dive
details, it opens a static image of a satellite map with a marker for the dive
site.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the QML UI needs the GPS information, we need a way to get to it.
I'm not convinced that having it as comma separated string is the best way to
go, but that's what I need for the Google API so that's what I picked for now.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>