Commit graph

8349 commits

Author SHA1 Message Date
Dirk Hohndel
9d622996ba Merge branch 'tomaz'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 15:33:28 -07:00
Tomaz Canabrava
536469107d Fix selecting the first index
The way a QCompleter works is that it grabs whatever
data it has in the completerRole and sets it back on
the line edit.

I Bypassed the QCompleter delegate to show something
other than the completerRole (so, for instance, if you
write 'B', you could get 'Blue Hole' as the returned text,
but in fact the QCompleter has the 'B' as internal string
(because of the weird - and wrong way in which we are
dealing with completion - trying to complete for something
that's not inside the model yet).

So I hooked up a signal that will listen to the complete's
index, and if it's the first row() it's surely the special
case - then we bypass QCompleter return string and use
our own.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 15:22:00 -07:00
Tomaz Canabrava
cd3f10d5ad Offer an option to just complete the text
Make the kids fight no more.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 14:54:01 -07:00
Dirk Hohndel
4dfb39cc49 Cmake: don't hardcode the make command
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 14:53:15 -07:00
Tomaz Canabrava
9510f40db4 Remove quick edit dive site widget
Voted down by common consent.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 14:44:39 -07:00
Dirk Hohndel
70656cddea Location completer: show candidate sites on the globe
As the user scrolls through the possible completions, show them on the
globe as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 11:53:24 -07:00
Dirk Hohndel
44510f990b Location completer: show taxonomy according to preferences
The user has picked their preferences of which taxonomy data they want to
see. Show them what they asked for.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 11:53:05 -07:00
Dirk Hohndel
8c0d0de2e6 Location completer: give distance if known
If both the displayed dive and the dive site which is shown as a potential
completion have a GPS fix, indicate the distance.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 11:52:17 -07:00
Tomaz Canabrava
49ab30ae8b Change Location Management to make Linus Happy
Do not overwrite a dive site if the name is the same
as any other dive site,  create a new one and duplicate
the information.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 16:06:05 -07:00
Tomaz Canabrava
1a68e7985b Move code that handles location to a sane place
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:44:16 -07:00
Tomaz Canabrava
c658f2878b Select right divesite on click
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:43:03 -07:00
Tomaz Canabrava
ca5606d3e9 Create/retrieve dive_site by name.
When we are working on the location management, we want to get a new
dive_site if the dive_site name changed unless there's no dive_site by
that name, then we create it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:42:35 -07:00
Tomaz Canabrava
3b2a02dffa Get the selected dive site from the list
Hooked up an eventFilter on the QListView that displays our dive sites so
it would filter the keys enter and space, storing the current dive_site
uuid when that happens.

Also it stores the uuid on clicks.

Now we need to get that information when processing acceptedChanges() and
check if the uuid stored there == displayed_dive_site.uuid and also if
text != displayed_dive_site.name, because if the user didn't click on
anything but only wrote stuff on the LineEdit no dive site would be
selected and so uuid == displayed_dive_site.uuid (wich would mean 'no
changes')

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:41:16 -07:00
Dirk Hohndel
e82f8ea565 Geo taxonomy: correctly store / update the categories
Don't throw away data unless new data has been received. And don't store
multiple copies of the same category. And most importantly, never write
past the end of the array.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Claudiu Olteanu
94d3aa04dc Wait until the BT scanning process is done on Android platforms
Block the Save button on Android platforms until the scanning
for remote Bluetooth devices is finished.

The reason we do that is because there is a bug on the
Android platform or on the QtBluetooth library which stops the
downloading process and blocks the devices on the Download mode.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Claudiu Olteanu
c6c706c28a Use SPP's uuid to connect to a device on Android platform
On Android, a Bluetooth connection to a service cannot be
established using a port. Therefore we use the uuid of the
Serial Port Profile service to connect to the remote BT
device.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Salvador Cuñat
521183dc73 OSTCTools - Improve error management (II)
Have just found a .dive file in H&W forum which is not correctly parsed
by libdivecomputer due (I think) to a bug in OSTC3 FW 1.77 (corrected).

If libdc fails to parse a file (whatever is the reason) and the header
hasn't been parsed, strcmp(ptr->key, "Serial") will segfault, so avoid
comparison if there is no ostcdive->dc.extra_data but set the serial
data as we know it from ostctools.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Miika Turkia
2ace3195f4 Divinglog import: stop (deco) time added
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Miika Turkia
2ec9002beb Divinglog import: include NDL information
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Miika Turkia
5dd0b1bad5 Divinglog import: show stop depth / ceiling
This shows the ceiling as stored by Divinglog. (I am not sure if it is
DC reported ceiling, or just a calculated one.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Miika Turkia
20b9c241f0 Divinglog test dive
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Miika Turkia
669a8085d9 Divinglog import: include heartbeat info
Note, that this patch is not tested with real data as I do not have log
that would include heartbeat available.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Dirk Hohndel
ad79476f54 Update Android build script
This now includes OpenSSL so we can actually use cloud storage (which
requires https transport).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:30 -07:00
Dirk Hohndel
f35a271365 Android build: statically link against libssl and libcrypto
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:16 -07:00
Dirk Hohndel
b554ed5ed6 Cloud storage: recognize our server certificate and accept it
On some platforms like Android the installed root certificates are rather
inconsistent. Same goes for older Windows machines. Instead of trying to
figure out how to get the user to install the right root certificates
(just kidding) we explicitly recognize our own server certificate and
allow that to override the validity assessment by the OS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 11:20:18 -07:00
Dirk Hohndel
9e5e12b5e4 Cloud storage: provide more information in debug builds
It makes sense to hide git URLs from the end user in release builds, but
while developing and testing it's better to get more detailed information.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 07:11:55 -07:00
Dirk Hohndel
3478943f2f Fix memory handling for taxonomy data
The way we freed things and cleared out the variables potentially left
dangling data behind and could end up calling free on garbage data,
leading to random crashes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 07:09:55 -07: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
16759715e6 QML UI: explicitly reference the button for size
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 17:38:01 -07:00
Dirk Hohndel
4491c91b93 Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 17:36:49 -07:00
Salvador Cuñat
6b904f9480 OSTCTools - change management of model and dc family
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>
2015-07-12 13:58:17 -07:00
Salvador Cuñat
4e88140b43 OSTCTools - Improve error management
- 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>
2015-07-12 13:58:17 -07:00
Henrik Brautaset Aronsen
2847fb4af5 Use git pull with rebase in build script
Without rebase, the build script would stop because it
couldn't complete a merge.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:17 -07:00
Miika Turkia
c41fd91261 Divinglog import: generate gaschange events
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:17 -07:00
Miika Turkia
7fffe8aba0 Divinglog import: adding pressure samples
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:17 -07:00
Miika Turkia
e53897cd15 Divinglog import: grab information for cylinder 0
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>
2015-07-12 13:58:17 -07:00
Miika Turkia
c91ee860f2 Divinglog import: use dive ID as identifier
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>
2015-07-12 13:58:17 -07:00
Miika Turkia
a52fc86a1c Divinglog import: get cylinder information
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:17 -07:00
Miika Turkia
22b665cc14 Divinglog import: import temperature graph
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:17 -07:00
Miika Turkia
17bc868531 Divinglog import: add workload warning
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:17 -07:00
Miika Turkia
5bc4f974c5 Divinglog import: deco stop ignored event added
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:17 -07:00
Miika Turkia
0011d43711 Divinglog import: ascent warning added
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:16 -07:00
Miika Turkia
c91ecb62af Divinglog import: RBT warning event added
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:16 -07:00
Miika Turkia
495aab8f20 Divinglog import: in deco?
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:16 -07:00
Miika Turkia
90f7a6930a Divinglog import: parse depth from database
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:16 -07:00
Miika Turkia
c87d7d96b5 Divinglog import: import a bit more data from DB
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:16 -07:00
Miika Turkia
e98cbdf020 Divinglog import: basic dive info for DB import
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>
2015-07-12 13:58:16 -07:00
Miika Turkia
b4d5f6fd53 Divinglog import: hook up processing of .sql files
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 13:58:16 -07:00
Miika Turkia
212cc575bf Divinglog import: add .sql extension for import
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>
2015-07-12 13:58:16 -07:00
Dirk Hohndel
164cafe5d3 QML UI: use stackView to show sub windows
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>
2015-07-12 10:59:33 -07:00