This is a no-brainer removal of the VALID_EMAIL state used in QMLManager.
All current usage of this state is "if state is VALID or VALID_EMAIL",
so there is no distinction between the two states.
It is even a little different. The comment suggests "when we can open
a local cloud storage, tied to a cloud account (so explicitly not
the no-cloud status), we have at least a valid email". While this
is formally true, this implies that there is also a cloud account
on the cloud server (ie. the cloud account is in a VERIFIED state).
In other words: currently, there can't exist a valid local storage
that is tied to a valid email adress, without valid cloud account
on the server.
Notice that this touches the discussion on GitHub for commit
e76f527fe5 (pull request #520). Can we implement the creation
of a valid cloud account without data link to the cloud server?
Currently, we need the server to confirm the email address (for
example for uniqueness reasons on server side). Obviously, we could
hack our way out of this, but we have a perfect solution already
in place. Create a no-cloud account, and transfer that later to
a true and valid cloud account.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
When we want to go the NOCLOUD credential state, do not go the
incorrect INCOMPLETE state.
This is the first in a series of unraveling the preference parameter
prefs.cloud_verification_status and the data that is carried around
in the QMLManager::credentialStatus_t.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Prevent button press events from showing on the profile
graph when we import divesoft DLF files.
Reported-by: Marc Arndt
Signed-off-by: Marc Arndt <marc@marcarndt.com>
Print out partial derivatives of stop times with respect to
variation of depth and duratin of last manual segment.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This allows to go to much smaller granularity without severe
performance penalty. It should also increase performance for
long decompression times.
Currently this leads to missing cached tissue factors, the caching
has to be adopted to this.
Also, for the time being this breaks the bottom gas breaks feature.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
...rather than use a global variable and a macro.
This should be a no-op in preparation to allow planning
several versions of a dive.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
These two variables are calculated later in the function and the
same two lines of code are there again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Different flavors of Linux put this in different subdirectories. Just
have cmake find the plugin for us.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on a script that Lubomir worked on and sent to the mailing
list.
Suggested-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this change, when running Subsurface from the build directory, it
should find a googlemaps plugin that was installed into the
install_root.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The default location which is used when the
PluginParemeter "googlemaps.cachefolder" is not specified
should be ~/.cache/googlemaps on Linux or
/user/<name>/appdata/local/cache/googlemaps on Windows.
This patch moves the cache to the default system location
where we store the printing templates, cloudstorage and the
default user XML file.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The googlemaps plugin is about to support tile language
via the PluginParameter 'googlemaps.maps.language'.
To be able to pass the subsurface UI language (obtained
from the uiLanguage() helper) the Plugin has to be created
dynamically, only *after* the MapWidgetHelper is created.
MapWidgetHelper::pluginObject() now provides a QString which
contains the Plugin object and also include the uiLanguage
ISO value.
This string is used in mapwidget.qml as:
map.plugin = Qt.createQmlObject(pluginObject, rootItem)
This creates the Plugin object dynamically with the proper
UI language string, but also requires a couple of small changes:
- move the declaration of map.mapType after the
Qt.createQmlObject() call
- assign map.activeMapType after map.mapType has a value
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Reportedly the case 2 corresponds to Perdix, so it might be that both
Petrel and Perdix use same model number (or the model is mistaken
before).
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Instead of the (usually incorrect) text about insufficient privileges,
just mention a generic error and suggest that the user creates a
libdivecomputer log file.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Jef made the OSTC interface be a generic 'dc_device_timesync()' and so
the old OSTC-specific code doesn't exist any more.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simplify and fix prestation of weights. Due to the attempt to round
only the grams part (by just adding 50 to it, and truncating
afterwards) a weird effect was introduced. For example, a value
0.98 was presented as 0.10. Just replay the old logic, and see
what happens. Rewrote the logic to a simpler and better one.
fixes: #532
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
There is something with ndl / tts / temp in the Liberty DLF files. If
that bit is set, the values are bogus. There is something more to it
here which I haven't figured out.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
We always step forward 16 bytes, so make it a for loop so a continue
won't throw us into a eternal loop.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Looking for already existing locations with
m_mapLocationModel->getMapLocationForUuid() will not cover dive
sites which are too close to each other and are skipped when
creating MapLocations. See reloadMapLocations() and the usage of
MIN_DISTANCE_BETWEEN_DIVE_SITES_M.
Constructing a new QGeoCoordinate for the already retrieved
dive site (ds) coordinates ensures that we are traversing
*all* dive sites at the backend and not only those visible on the map.
Fixes the issue where not all dives in the DiveList are selected,
even if a dive clearly happened on a location currently visible in
the map viewport (map -> context menu -> select visible dive
locations).
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The QML Map has a couple of methods - toCoordinate(someQPointF) and
fromCoordinate(someQGeoCoordinate). Ideally, if one passes a point to
toCoordinate() and then attempts to convert the resulted coordinates
back to the point, the same point in the Map view port with minimal error
should be retrieved. That's not always the case - e.g. near
47.400200 -123.142066, which means that the methods are not exactly
*reliable* and there might be Map class bugs at hand.
The new zoom-in and zoom-out improvements try to work around the above:
- for both centerOnRectangle() and centerOnCoordinate(), if no good
zoom-out level is found (newZoomOut), the zoom-out is set to the default
value of defaultZoomOut. In practice, this prevents the case where the map
does not zoom-out at all when going from one place to another
- centerOnRectangle() now uses rectangle diagonals to estimate a fit,
instead of checking if 2 points (top-left and bottom-right) are visible
in the viewport. The usage of fromCoordinate() was giving bad results
in this case and comparing distances (diagonals) is more reliable
but more expensive on the CPU.
Due to the inconsistencies of toCoordinate() and fromCoordinate()
the dynamic zoom-in and zoom-out are still not ideal, but the current
implementation is somewhat usable with decent accuracy.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Include the gasname, get rid of more spaces in front of units,
update the template to use new gas fields.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This way, the user can adopt those once and for all for all
her dives. This includes the space between number and unit symbol.
Signed-off-by: Robert C. Helling <helling@atdotde.de>