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>
H&W introduced some changes in dc's data structures with FROG and OSTC3
families (types 0x22 and 0x23 in H&W's terms) that I didn't take into
account as we lacked of .dive files to test.
BTW I previously set the model to "0" as it was not stored in the file
but wasn't relevant for the data parsing in MK2, OSTC and OSTC2N/2C
models.
Thanks to Anton's advice we have got some OSTC3 dives to test, so this
patch takes into account the different data structures for different
families, and try to stablish a model number based on device's serial
number, as libdc does.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Introduce an exit point to cowardly run away from the file if
something goes wrong (undefined dc family, inconsistent family/model
pair, etc), without crashing subsurface.
- Simplifies (user point of view) and makes translatables the error
messages shown in the status bar.
- Modifies ostc_prepare_data() to emit a return code to manage posible
failures.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cylinder 0 is stored on the Logbook table along with other dive metadata
(not in Tank table).
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since mapping cylinders requires use of dive ID, we might as well use
the ID to map the profile also.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This parses the basic metadata of a dive when importing Divinglog
database. (Discarding deleted dives is my best guess as I do not have
that in my sample dive.)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Generic divelog might come with the .sql extension, thus adding that to
the file filter.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
QML on Android doesn't support multiple windows, so dialogs that work on
the desktop are not a good solution on Android. A much more natural way to
present sub windows is a stackView.
In order to do this Preferences needs to be an item and the structure of
the ApplicationWindow needs to change a bit.
This also removes the hard coded sizes and instead tries to design this in
a resolution independent manner.
The diff appears larger than the actual change because of an increase of
indentation for the ApplicationWindow content.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't hard code sizes as devices tend to have much higher pixel density
than desktop computers. Instead make sizes relative to the content.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On Android the app figures out the size by itself.
Also change the name to match our naming scheme (Subsurface mobile for the
QML UI).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This renames the local name for the location as town and adds the concept
of a city as the level 3 admin category. In some regions (e.g. at times in
Italy) the local hamlet name is shown as toponymName but the name of the
actual city is given as adminName3.
With this change "city" will always reflect our best guess: adminName3 if
it exists, otherwise the toponymName. Whereas "town" is always the
toponymName.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise we could get mangled data since the newline isn't printed.
Now a good question would be "why do we have empty values in our data",
but either way, we should write invalid data to the git repository.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show the dive details in editable text boxes. This will make it easier
for the user to edit the displayed information.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
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>
Add a button in the main qml file to show the preferences window. This
window is linked to the QMLManager class, so any changes made will be
saved to the user's settings file.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Marble currently tries to open non-existent files, and the way
it does that causes an annoying warning on the console. The new
Subsurface version of Marble will instead open this invisible
PNG file whenever it can't find the bitmap it is looking for.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This teaches android build.sh and cmake about how to build the qml ui of
subsurface-mobile as a apk.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This teaches the edit divemode about the fact that we can have multiple
dc's with different divemodes. The previous code always just edited the
first dc.
This was reported by Ian Pitt in:
https://groups.google.com/forum/#!category-topic/subsurface-divelog/4Zf47KS4Ifk
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This introduces code to use qt-android-cmake to produce a working apk.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Due to bugs in libgit2, we force linking with libssh2 to add
git-over-ssh support. On android we currency don't want libssh2 due to
its dependency chain, so this makes the libssh2 force linking opt-out.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This teaches the android build script how to do out of tree builds.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The fact that Marble doesn't tell us when it's done flying to the next
point is making this excessively complicated to get right.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>