Commit graph

10447 commits

Author SHA1 Message Date
Dirk Hohndel
8185d24e61 QML UI: force local saving of password
commit d99c931219 ("QML UI: remove the checkbox for remembering the
password") made the incorrect assumption that this would always be true
by default when it actually was false by default. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-27 19:28:31 -05:00
Dirk Hohndel
4670373731 QML UI: tighten credential input screen
This way even on smaller screens both email and password should fit
above the keyboard which makes data entry so much easier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-27 19:10:58 -05:00
Dirk Hohndel
a4977f2a90 QML UI: add some diagnostics to App log
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-26 21:49:20 -07:00
Dirk Hohndel
d4357b3b21 QML UI: allow writing to App log from QML
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-26 21:49:19 -07:00
Dirk Hohndel
7434e4213b QML UI: show keyboard when entering credential screen
If the user goes to the credentials screen, they likely want to edit
something.  So put the focus on the first entry field and show the
keyboard.

We also need to hide the keyboard when the credential screen becomes
invisble so that the keyboard doesn't stay around when the dive list
is shown.

Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-26 21:49:19 -07:00
Robert C. Helling
e216f91ebc Prevent unintentionally running as root
Some users try to run Subsurface as root for example to get around
permission problems with dive computer devices. This is a bad idea
since config files get touched as root and then cannot be read
as normal user anymore.

This patch allows running as root only with verbose option on. We can
assume if somebody manages to start subsurface as root this happens
from the command line.

For some reason, I couldn't get translation working at this stage.

Windows version is a stub.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-26 20:08:08 -07:00
Dirk Hohndel
d99c931219 QML UI: remove the checkbox for remembering the password
In the context of the mobile app this simply makes no sense. If the user
doesn't select this option, the app doesn't really work. So why have the option
in the first place?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 21:42:20 -07:00
Dirk Hohndel
246422d03f iOS build: fix typos
Can't believe I didn't notice them earlier... I must have stared at these
strings countless times.

Reported-by: Scott Ireland <scott@sdj.ca>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 21:36:42 -07:00
Dirk Hohndel
8f5a662441 QML UI: add the position source reported to the log
I've seen iPads without GPS report that they support satellite positioning.
Seems like a Qt bug to me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 17:48:20 -07:00
Dirk Hohndel
dc1cd40721 Revert "iOS build: enable access to GPS location"
This reverts commit 78a8137963.

These keys don't enable access, they require the device to have GPS support.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 17:28:47 -07:00
Dirk Hohndel
a9cf089e1c QML UI: remove verbose option from Developer menu
We now log everything that's relevant to the application log that is shown
in the UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 16:37:23 -07:00
Tomaz Canabrava
5f9df02ffc Fix tests linkage
I wasn't linking the tests against the qrc library, which made trying to
load the xslt transformation files for the parse test fail.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 16:32:38 -07:00
Dirk Hohndel
f298802b99 QML UI: GPS location service - correctly calculate the delta
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 11:50:51 -07:00
Dirk Hohndel
b1037abdb7 QML UI: GPS location service - only show the fixes we store
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 11:50:46 -07:00
Dirk Hohndel
9a62685f0b Read GPS location service thresholds from settings
We used to faithfully save them, but not restore them at start.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 11:18:20 -07:00
Dirk Hohndel
6c9247b56b QML UI: improve About screen
This should actually give a correctly positioned logo.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 09:44:05 -07:00
Dirk Hohndel
aa4e3ba537 Give more information about the GPS location service
On iOS it seems that I get a fix every second. Even though the
QGeoPositionInfoSource is set up with an update interval of 5 minutes...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 08:49:45 -07:00
Dirk Hohndel
2a65eab745 iOS build: add another Info.plist key to enable positioning
This key is needed so that the iOS app asks the user for permission to use the
GPS position information.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 07:54:48 -07:00
Dirk Hohndel
78a8137963 iOS build: enable access to GPS location
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 05:41:44 -07:00
Dirk Hohndel
f9e68f13f3 iOS build: add missing icon
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 23:31:12 -07:00
Dirk Hohndel
854eb57ef5 QML UI: always convert the cloud user name to lower case
Mixed case user names cause the connection to the cloud storage to fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 23:12:03 -07:00
Dirk Hohndel
fcb93362ac QML UI: reduce application log clutter
We don't need to flood this with the profile scaling data anymore; that's
hopefully fixed for good.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 21:22:55 -07:00
Dirk Hohndel
b16e8e7b4e QML UI: work around missing back button on iOS
Especially when showing the dive details and editing dive details,
having the option to go back in the context menu is nicer on iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 21:15:01 -07:00
Dirk Hohndel
fb157b873a iOS build: fix executable name
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 19:45:07 -07:00
Dirk Hohndel
509b664a29 Another small signed / unsigned warning fix
This is in the Mac support file that wasn't compiled on Linux when I tried to
finish the cleanup.

Now this compiles without warnings on Mac and iOS as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 17:26:46 -07:00
Dirk Hohndel
788d65a527 Make code easier to read (and avoid warning)
The old expression wass correct because if dive_table.dives[j]->number is != 0,
then !dive_table.dives[j]->number is 0 and vice versa. But come on...
The new code seems much more natural and easier to read.
And of course the Apple compilers by default gave a warning because they
suspected a precedence bug with the old code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 17:26:46 -07:00
Dirk Hohndel
41bc8003d5 iOS build: update the README
A lot of this is still black magic, but at least this now documents what I
understand about the process.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 17:26:46 -07:00
Dirk Hohndel
a4a9edcd0f iOS build: create Info.plist with correct version information
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 17:26:46 -07:00
Dirk Hohndel
9028c807b2 Change names of iOS build files
The name subsurface-ios was used in many places and that was just not helpful
to fight against. This should work much better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 17:26:46 -07:00
Dirk Hohndel
32e6cde548 Compare with the right git sha when deciding nothing has changed
The saved_git_id could be updated in is_git_repository() under certain
circumstances, so we need to make sure we compare to the sha that was
current as we entered this function. Since the pointer is just to a static
buffer we need to actually copy it (and then free it later).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 13:25:10 -07:00
Werner Macho
23ea947b5a typo fix
small typo fix for GUI

Signed-off-by: Werner Macho <werner.macho@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 12:16:56 -07:00
Dirk Hohndel
aef6364921 Prevent possible SIGSEGV in test
If the load fails the get_dive(1) could return NULL. Let's catch that as
an error instead of having the test crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 12:12:11 -07:00
Dirk Hohndel
cc0f298980 When clearing dive file data, forget the saved git sha
Otherwise parse_file() thinks that this data has already been loaded and
doesn't re-read it, even though our internal data structures have been
erased - so a subsequent parse_file after clear_dive_file_data() that
opens the same git repository finishes successfully, but leaves the
dive_table empty which is of course incorrect.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 12:09:18 -07:00
Dirk Hohndel
bff3588c25 Undo two more unsigned changes that are no longer needed
With this master should compile without signed / unsigned warning,
hopefully without any more breakage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 10:11:39 -07:00
Dirk Hohndel
0cd0762807 Another attempt to clean up signed / unsigned in profile.c
This time we err on the side of signed variables most of the time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 10:04:30 -07:00
Dirk Hohndel
22c94a3e65 Don't try to force depth to be unsigned
Trying to clean up the signed vs. unsigned issues it becomes clear that
forcing depth to be unsigned causes way too many problems in the code.

So this commit goes the opposite direction; since we clearly aren't
limited INT_MAX vs UINT_MAX, simply make more of the depth related
variables signed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 09:53:44 -07:00
Robert C. Helling
e93c99c8bc When changing units from psi to bar first change value, then max
otherwise the max interferes with the value. Furthermore this increases
the max values a bit.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 09:34:49 -07:00
Dirk Hohndel
0ae5f6faae Revert "Clean up signedness confusion in planner.c"
This reverts commit 59299f0ab3.

Doing this oversimplified "fix" actually breaks the planner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 08:17:17 -07:00
Dirk Hohndel
abb3b03511 Don't start Add or Plan while accessing cloud storage
This avoids a race condition where we get confused about our internal
state.

Fixes #1031

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 17:41:15 -07:00
Robert C. Helling
48007ebc30 Make the reserve gas units aware
In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.

Fixes #1027

[Dirk Hohndel: small modifications, more reasonable step for psi,
               more reasonable maxima]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 16:16:38 -07:00
Dirk Hohndel
e8f8051efe QML UI: use consistent, darker text color for dive list
We received suggestions from users to darken the text color in the dive
list a bit and this does seem to be a lot more readable. Especially since
people are likely to use this outdoors the higher contrast seems
reasonable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 11:36:11 -07:00
Anton Lundin
77e1c2afa9 configure OSTC/OSTC3: Bugfix depth parameter unit
The unit for the depth parameters ain't meters, its 0.1 meters. This
caused the values stored to be out of range.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:46:40 -07:00
Miika Turkia
ee0bdd9043 CSV export
Need to discard dive site notes on csv export..

miika

From ab23245e2acee32410fa680d0eaab098af69b5c2 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Mon, 21 Mar 2016 17:50:28 +0800
Subject: [PATCH] CSV export: discard dive site notes

The new format of divesite management breaks the CSV export as the notes
of divesites are matched.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:45:04 -07:00
Rick Walsh
cbd332fbcc Profile widget: Display gradient factors used in plan
Currently, the gradient factors displayed at the top of the profile are the
gradient factors set in preferences.  This is correct for saved dives, but
when planning dives, the gradient factors displayed at the top of the profile
should be the gradient factors used in the plan.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19 11:31:13 -07:00
Dirk Hohndel
47ba8b38d4 Preferences: fix missing slot problem when creating new account
This is still a left over from the damage done when creating the
preferences objectification.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19 07:52:33 -07:00
Rick Walsh
0e5c8f101c Planner: add segment symbol to output table
Add a symbol to each line of output table indicating whether a segment is an
ascent, descent, constant depth (user entered) or deco stop

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-03-19 10:45:37 +01:00
Jeroen Massar
cfd3d8868b Verify that the Xcode Command Line Tools are installed
Otherwise /usr/include does not exist on a clean-ish install

Signed-off-by: Jeroen Massar <jeroen@massar.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 09:00:50 -07:00
Jeroen Massar
0ddfd3a992 Detect Homebrew Qt5
And preserve that path in CMAKE_PREFIX_PATH and pass it along to cmake

Signed-off-by: Jeroen Massar <jeroen@massar.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 09:00:31 -07:00
Jeroen Massar
4a8619349a Debug reminder: how to get more verbose details out of cmake
Signed-off-by: Jeroen Massar <jeroen@massar.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 08:59:37 -07:00
Dirk Hohndel
ed9e5fe0f3 Don't use CRLF in documentation files
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 07:46:47 -07:00