Commit graph

10093 commits

Author SHA1 Message Date
Dirk Hohndel
130f4cd7ac Do not run the deco calculations in the mobile app
We don't show the calculated ceilings and calculating them is compute
intensive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 20:45:18 -08:00
Dirk Hohndel
7f70802b90 QML UI: explicitly hide the keyboard when exiting dive edit
If you save or cancel the dive edit, the keyboard should be closed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 10:49:43 -08:00
Dirk Hohndel
48695cda7c QML UI: disable download from divecomputer
This is not hooked up, yet, and would likely only confuse potential
testers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 09:22:54 -08:00
Miika Turkia
24e2f83d67 Allow merging of dives with zero depth/duration
Fixes #1003

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-04 12:38:48 -08:00
Willem Ferguson
545b106d5c Mobile. Modify DownloadFromDiveComputer.qml
1) Create space for sillybutton at bottom of screen
        2) Reformat columns in tableview
        3) General cleanup and simplification of code.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03 10:50:00 -08:00
Miika Turkia
520f505d20 Fix Liquivision import crash
When we detect a redundant DC we free the memory reserved for the model.
Thus we need to malloc that memory here.

Fixes #1002

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03 06:06:23 -08:00
Jan Mulder
ce373db951 Update copyright for 2016
Trival string update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:56 -08:00
Jan Mulder
e80284fcfc Simplify building of Android build from one source tree
Currently, when running the packaging/android/build.sh from a source
tree that has been used for desktop builds, libdivecomputer wants a
make distclean. This is inconvinient, and is caused by building
libdivecomputer in source. Now, configure and build libdivecomputer
in a new subdirectory, allowing to run the android build script
from the same source tree as the desktop (both desktop and mobile)
builds.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:47 -08:00
Jan Mulder
62f7a2a8f0 Build Android mobile app against latest OpenSSL
No reasons not to upgrade to the latest OpenSSL lib. The currently used
1.0.1 branch is ending end of 2016, so a switch to 1.0.2 is useful
anyway.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:44 -08:00
Robert C. Helling
c32f5cc278 Silence compiler warnings
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01 18:01:05 -08:00
Rick Walsh
fdd5ee507c QML UI: Another attempt to shift dive number to top row
Commit 1030cb265a 'QML UI DiveDetailsView: shift
dive number to right of top row' was reverted because it caused mysterious
crashes for some testers, inferred to be related to sizing items in a
gridLayout.

This patch brings the dive number back up to the right of the top row, so the
page width doesn't exceed the screen width. Using text wrapping should prevent
the date text and dive number items from increasing in width, and hopefully
avoids the mysterious crashes.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01 17:52:20 -08:00
Miika Turkia
448abec769 Mark CCR dive's divetype properly
We used to mark CCR dives by having "SP change" event at time 0:00.
As we nowadays mark CCR dives by setting dc->divemode appropriately,
better to convert the old dives to this format as well. This way we do
not have to take the special old format into account on multiple places
in the source.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 13:06:39 -08:00
Dirk Hohndel
cba50ece33 Revert "QML UI DiveDetailsView: shift dive number to right of top row"
This reverts commit 1030cb265a.

Simply trying to find out if this is the cause for the odd crashes one
tester is seeing.
2016-01-31 11:27:13 -08:00
Miika Turkia
d6af28cc90 Attempt to detect time format on CSV import
This attempts to detect the time format when initially importing a CSV
file. Well, only the minutes:seconds notation is detected currently.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:22:47 -08:00
Miika Turkia
d9072cdefd Attempt to detect date format on CSV import
This tries to detect the date format when initially reading a CSV file
for importing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:21:04 -08:00
Dirk Hohndel
16c082112c QML UI: pick new highest dive number when manually adding dive
It's possible that this will create an out of order dive list, but it
seems the most consistent way to do things and to avoid more than one dive
with the same dive number (which could have happened if you add several
dives manually that are not the newest dives in the dive list).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 11:26:16 -08:00
Dirk Hohndel
a1aa83fcfd Minor cleanups
Improve readability of the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 10:17:22 -08:00
Dirk Hohndel
0eae59bcd2 QML UI: introduce "add" state and correctly clean up when canceled
Adding a dive is just like editing it, except that canceling the operation
has different consequences. Instead of trying to figure this out by some
inference on other state, let's just make it explicit and then clean up
after ourselves if the user canceled a manual dive add.

This also switches to use the properties that we defined in order for the
main menu to be able to setup these values. Makes the code easier to read
and is more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 07:50:45 -08:00
Dirk Hohndel
9f7ecbb53e Add helper to remove dive from model
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>
2016-01-29 07:50:38 -08:00
Dirk Hohndel
957f03f2a4 QML UI: remove apparently obsolete code
I couldn't make sense of either the code nor the comment, so I tried what
broke when I removed it. Nothing that I could find. So maybe we don't need
this after all?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 07:40:12 -08:00
Dirk Hohndel
ba4bb56701 QML UI: better way to determine dive details edit width
Instead of passing magic values around, calculate the columnWidth as part
of the SubsurfaceTheme object.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 22:49:46 -08:00
Dirk Hohndel
66b08f53f2 QML UI: make manually added dives more like those added on desktop
By giving them a fake profile we can actually edit the dive profile in the
desktop app.

Fixes #998
Fixes #1000

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 22:09:40 -08:00
Dirk Hohndel
ff2f6d4082 QML UI: once again hide "--" as section header
The fix for correctly showing multiple trips with the same location text
inadvertantly broke the detection of empty location text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 21:58:27 -08:00
Dirk Hohndel
6dd3e4c30e QML UI: use the new helper to ensure the right dive is selected after edit
There are two cases where this is important
- when running Manually add dive which may add a dive in the middle of the
  dive list
- when editing the date and time of a dive which may move it around in the
  dive list

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
adaaaaf32b Use our own sort proxy model class
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
af9f07626a Add our own sort proxy class which provides two helper functions
These can then be used from QML to map the index into the model (the sort
model corresponds directly to the indices in QML) to the dive id and back.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
dbe9bad0aa QML UI: add the properties needed to be able to manually add dive
This way the trigger from the main drawer works again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
034ffa229b QML UI: add field to edit the total weight
This isn't hooked up to anything, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
bac39b5482 Better id for yet another QML item
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
c52769a90f QML UI: use unique names for the different ListViews
Having both the dive list (the vertical list) and the sequence of dive
details (the horizontally swipe-able list) named the same caused me
endless confusion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:20:15 -08:00
Dirk Hohndel
106bb07cff QML UI: clear out empty strings from the UI
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>
2016-01-28 14:07:27 -08:00
Dirk Hohndel
30a4fb2274 Avoid uninitialized memory access
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 09:02:20 -08:00
Dirk Hohndel
8813f13bfd QML UI: end edit mode when switching to different page
Fixes #997

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 19:05:13 -08:00
Dirk Hohndel
bda0b01216 QML UI: avoid clearing and rebuilding the dive list model
This causes all profiles to be rendered which is a massive performance
concern.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 15:11:37 -08:00
Dirk Hohndel
e895374e4b QML UI: fix Qt's broken handling of two digit years in dates
Because dives in 1912 are unlikely to be added to my dive log...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 15:07:10 -08:00
Dirk Hohndel
ec0fc9d70b Change the api to update a single dive
Instead of searching for the dive in the list, just make sure we are given
the index.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 11:50:04 -08:00
Dirk Hohndel
6f953d51de QML UI: correctly notify of model change
This may seem weird, but it seems to work to make sure that the model
actually is correctly updated when updating a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 11:32:40 -08:00
Joakim Bygdell
9342dedb26 Move helper function to DiveObjectsHelper
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>
2016-01-27 11:18:44 -08:00
Dirk Hohndel
4abe73ff2a QML UI: on edit only request location if user checks the box
The code inexplicably always checked for a gps location. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 10:16:25 -08:00
Dirk Hohndel
a74175324a QML UI: fix precision of total weight displayed
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 10:16:25 -08:00
Dirk Hohndel
140624918c QML UI: revert dive detail view layout changes
Now the layout flows again and shouldn't cause clipping on the right
(unless the user has excessively long, unbreakable words it seems.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 10:16:25 -08:00
Dirk Hohndel
35e60a7355 QML UI: don't combine multiple trips to the same location into one
The way sectioning of the dive list works is by watching for different strings
in the section.property. In order to be able to tell different trips apart we
combine the address of the dive trip variable with the location (which will
create a new section for a new trip, even if the location text is the same) and
then strip that information out before showing the trip header.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 20:06:30 -08:00
Dirk Hohndel
6a8768ee26 Fix build breakage
Introduced in commit 31462f150dff ("We already have a QNetworkAcessManager
global, use it").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:51:58 -08:00
Tomaz Canabrava
7a682770ef Round placement sizes of TopBar.qml
I was having really ugly fonts here and I actually blamed
QML for that (while I still think it is it's fault), but we
where using pixel fractions. So every time we may hit a pixel
fraction, round that.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:51:50 -08:00
Tomaz Canabrava
1773f5e447 Correct usage of QString on qmlmanager
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:51:45 -08:00
Tomaz Canabrava
6575a0b4b8 We already have a QNetworkAcessManager global, use it
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:51:38 -08:00
Tomaz Canabrava
ccf29679ae Fix usage of QString
1 - Pass QStrings by const-ref
2 - Don't initialize empty strings with "", they are empty
    by default
3 - Don't compare empty strings with "", use .isEmpty()
4 - don't append or prepend " ", use QChar(' ')
5 - don't compare QStrings with "constant string", use
    QLatin1String(" constant string" )

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:51:14 -08:00
Tomaz Canabrava
8b7427c56d Move CloudStorage out of the widgets
Cloud Storage is a non-gui based class, we currently use
two different approaches for cloud storage, one on the desktop
target and other on the mobile target, we should use only one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:50:32 -08:00
Tomaz Canabrava
411f455291 Fix bug on the visibility of the Ruler Graph
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 13:04:39 -08:00
Tomaz Canabrava
7433396333 Fix Ceiling Graph
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 13:04:32 -08:00