Commit graph

8514 commits

Author SHA1 Message Date
Dirk Hohndel
829e816e2b Location edit: correctly position globe if create dive options are active
This way when the user looks through the list of completion options the
globe behaves in a consistent way, i.e., if the current dive site has a
GPS fix and the user activates one of the two options to create a dive
site with that GPS information, the globe show the right area (and the
globe zooms out if the current dive site doesn't have a GPS fix).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 12:50:56 -07:00
Dirk Hohndel
076f86202a Change API signature to act on dive_site, not uuid
This way in the future we can pass in a pointer to a dive site that isn't
linked in our dive site list yet (i.e., while we are editing).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 12:41:04 -07:00
Dirk Hohndel
f98ace681a Dive site edit: add second "create" line without completion
We now have TWO special entries. One with just what the user has typed and
one with the first completion of that text. This way both Henrik and Linus
can get what they want. I'm not sure I love this, but it's easy to revert
if the consensus is that this is too confusing. But it's much easier to
discuss this if people can actually play with it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 12:22:56 -07:00
Dirk Hohndel
4ec27b1751 KMessageWidget: hide messages regardless whether it's visible
Even if the message isn't visible hide it, don't just return.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 10:55:55 -07:00
Dirk Hohndel
45392615cd Dive edit: handle dive sites more sanely while editing
While we edit things, displayed_dive_site is the authoratative source of
data that should be displayed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 10:43:37 -07:00
Dirk Hohndel
0f906dad6f Don't reset editMode when refreshing the display
Just because we want to update the latest information on the Notes tab
doesn't mean we are done editing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 10:42:56 -07:00
Dirk Hohndel
9a5ac0d3ac Just call the member function
This code was embarrassingly indirect. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 09:52:24 -07:00
Dirk Hohndel
22c83af6ad Dive site handling: make sure the data in displayed_dive is updated
After an edit when the dive is redisplayed we are not copying the data
from current dive back over displayed dive (as the reasonable assumption
is that we just edited the displayed dive and copied the information into
the current dive)- so make sure that after the dive site handling the
displayed dive does in fact have the correct dive site information.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 06:40:16 -07:00
Dirk Hohndel
88015f402b Geo taxonomy: special case for looking up data of the displayed dive site
While we are editing a dive the displayed dive site may revert back to the
special uuid of 0. This means the user modified the existing site so the
displayed dive site is now different from the dive site referenced in the
current dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15 21:28:17 -07:00
Dirk Hohndel
874d3c4799 Dive site handling: special case for auto generated dives
When we download GPS data from the webservice we can end up with dive
sites that are simply a place holder for the the GPS fix. If we replace
the name of one of those sites we should just delete the site (assuming it
isn't used in another dive, which is unlikely but theoretically possible).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15 21:27:49 -07:00
Dirk Hohndel
1dbb6071bd Add helper function that checks if a dive site is in use
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15 21:25:26 -07:00
Dirk Hohndel
542e04266d Dive site handling: correctly handle the different scenarios
- do not create dive sites unless the user has accepted the changes
- all modification are tracked in the displayed_dive_site
- when the user accepts the changes, the real dive site list (and the
  selected dives) are updated according to what is in the
  displayed_dive_site

This adds quite verbose debugging messages and disables a section of code
that has a special case for data created by the Subsurface web service.
This code needs some re-thinking and should eventually go away.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15 15:44:15 -07:00
Dirk Hohndel
eb9f07c789 Android build script: minor adjustments
When retrying a clean build several libraries failed to build and I
finally tracked this down to the cross build tools not finding their
sysroot.

Also, on my main build server I have an older cmake version and one of the
tools claims to require cmake 3 but I see no actual incompatibility, so
I'm patching out that check.

Hackish? Yes. But it seems to work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15 10:37:57 -07:00
Dirk Hohndel
a5b378bdf4 Better text for dive site completions
Also make the explanation text slightly smaller.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15 10:37:25 -07:00
Dirk Hohndel
14016f83ff Better text for fake completion entry
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-15 10:37:09 -07:00
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