Commit graph

686 commits

Author SHA1 Message Date
jan Iversen
86ab5a91f7 profile-widget: set printmode but allow events for ssrf-mobile
Reactivate printMode true for ssrf-mobile to avoid font problems,
do not discard events if ssrf-mobile (even though printMode is true)

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 12:04:14 -07:00
jan Iversen
708d69343d mobile: removing print mode from mobile.
print mode was used to limit the functionality of the profile,
when used in ssrf-mobile.

The effect is that DC events are displayed, but not selectable

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:59:08 -07:00
jan Iversen
034f9a6ca2 mobile-widgets: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
3646fa800b iOS: copy libdivecomputer.log to clipboard
Read libdivecomputer.log file and append to clipboard

Remark, subsurface_open is not available in iOS so using
QFile instead.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
4a872f74a4 iOS: updated text in About to reflect logs not log
Both subsurface.log and libdivecomputer.log are on the clipboard.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
997251d43a iOS: store libdivecomputer.log in documents (same dir as app log)
Make location of subsurface.log and libdivecomputer.log consistent

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
571965ec6d mobile: removed setting for libdivecomputer.log
Users need a simple way to report download problems. Asking them
to go into settings, activate logging, and repeat the download
is too much.

libdivecomputer.log will always be generated, but overwritten, with every
download, so the latest log is ready.

The download is very slow due to BT, so there are no impact of having the log
active, neither in terms of size (a concern on small mobiles) or write time.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
4c8ed5a5ae QML UI: allow changing the connection ID
When downloading with bluetooth, changing connection did not work.
The new selection was not passed to the download thread.

Fixes #1274

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
jan Iversen
a181020b19 mobile: add "Copy log to clipboard" button
on iOS it is practically impossible to copy the App log
to e.g. a mail! in iOS 11 the log file is stored within
the subsurface container and you first need to copy (actually
using the clipboard) out from there to the "normal" document
shared space, before it can be used.

At least iOS users (and I believe Android users) are not really
used to work with files, so the process is not easy to document
in an understandable way.

The alternative is to provide a button, which simply puts the
log on the general clipboard, allowing it to be pasted in a
multitud of applications.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 12:43:15 -07:00
Murillo Bernardes
97090aeb47 mobile: fix wrong coords when saving new location
This one place it was not being multiplied by 1000000,
as expected for degrees_t.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-17 07:25:56 -07:00
Dirk Hohndel
ea83b5ed37 Core: remove dive.h from files that don't need it
Of course, quite a few of them indirectly get it through other header
files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14 10:13:39 -07:00
Dirk Hohndel
d577467f97 Core: introduce new subsurface-string header
First small step to shrinking dive.h.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14 10:13:39 -07:00
Murillo Bernardes
6b4e830670 mobile: fix next icon prefix
Icons used directly by Kirigami use /org/kde/kirigami
as prefix. Ex: previous and next icons on header.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-13 13:18:01 -07:00
Murillo Bernardes
944de155d7 iOS: fix "previous" button icon
Icons used directly by Kirigami use /org/kde/kirigami
as prefix. Ex: previous button on the GlobalDrawer.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-13 13:18:01 -07:00
Murillo Bernardes
f4a9571da5 mobile: show selected dive on details view
Call positionViewAtIndex in order to make the selected dive
visible.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-09 06:32:20 +02:00
Berthold Stoeger
920ff15f71 Planner: don't return static data in fake_dc()
fake_dc() used to return a statically allocated dc with statically
allocated samples. This is of course a questionable practice in
the light of multi-threading / resource ownership. Once these
problems were recognized, the parameter "alloc" was added. If set
to true, the function would still return a statically allocated
dc, but heap-allocated samples, which could then be copied in
a different dc.

All in all an ownership nightmare and a recipie for disaster.
The returned static dc was only used as a pointer to the samples
anyway. There are four callers of fake_dc() and they all have access
to a dc-structure without samples. Therefore, change the semantics
of fake_dc() to fill out the passed in dc. If the caller does
not care about the samples, it can simply reset the sample number
to zero after work.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-07 13:11:53 +03:00
Dirk Hohndel
d2d46d848a QML UI: fix incorrect icon references
Not sure why this has worked in the past - it was simply wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 18:57:08 -07:00
Dirk Hohndel
bb03bd862b QML UI: ensure delegate height is not a fraction
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 14:11:31 -07:00
Dirk Hohndel
c1bcba46f0 QML UI: dive list performance: enable caching
We had turned this off since it caused rendering issues, but that
appears to be fixed now - and it should help to get us smoother
rendering of the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 14:11:22 -07:00
Dirk Hohndel
95c9a505c6 QML UI: dive list performance: no background rectangle
This is one of the suggested performance enhancement to reduce redundant
painting.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 14:10:04 -07:00
Dirk Hohndel
2529529ff9 QML UI: make the code easier to read
And maybe this will make it faster as well? Depends on how the binding
is implemented, I guess.
But at least it's less confusing to read now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 09:40:14 -07:00
Dirk Hohndel
f8742a48b2 QML UI: show offline notice when going offline
The logic was backwards and showed the notice when the user switched to
auto sync mode.

Fixes #1204

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 08:12:56 -07:00
Dirk Hohndel
6b9a1f3850 QML UI: change auto cloud sync menu texts
This way the menu items describe what happens when you tap on that menu
item.  That seems more consistent and intuitive.

See #1204

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 08:08:24 -07:00
Dirk Hohndel
e10b252153 QML UI: suppress warnings when showing GPS fixes
Kirigami gets unhappy if a SwipeListItem isn't named listItem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 18:27:02 -07:00
Dirk Hohndel
dcc308e929 QML UI: recalculate derived information after editing dive
For example, when changing the cylinder, the SAC rate wasn't updated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 10:05:41 -07:00
Dirk Hohndel
026e90df3d QML UI: don't show a vertical scrollbar in dive list
With the folding trips it just looks confusing as it changes size.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 08:16:59 -07:00
Dirk Hohndel
a47bcbb3e7 QML: remove unused property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 08:16:59 -07:00
Dirk Hohndel
8508fa5be8 QML UI: always show dives that aren't in a trip
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 21:04:56 -07:00
Dirk Hohndel
cc319ad8b1 QML UI: allow collapsing the open trip
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 20:32:40 -07:00
Dirk Hohndel
a454b4fd19 QML UI: animate trip folding
This looks much nicer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 17:39:40 -07:00
Dirk Hohndel
4923aecc9d QML UI: bring back folding trips
In older versions of Kirigami this caused all kinds of problems so we
eventually gave up on it in commit 13c49276d1 (Revert "QML UI: make
dive list fold dive trips").

Now this seems to work much better, so let's bring back trip folding!

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 17:39:40 -07:00
Dirk Hohndel
e107abba23 Debug location saving
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 13:37:44 -07:00
Dirk Hohndel
1d95cc4cbf QML UI: if we don't have a current position, update it later
Once we get a new fix we asynchronously update the text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 13:37:44 -07:00
Dirk Hohndel
0df43252be iOS: log messages
So far we only wrote messages to subsurface.log on Android (since we couldn't
figure out how to make that file user accessible on iOS). Now that that's
fixed, we also need to actually write to the file in the first place.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-13 17:07:43 -07:00
Dirk Hohndel
27b921fb1d iOS: make logfile accessible to user
By creating it in the Documents path and setting the two magic keys,
iOS will make the log file available to the user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-13 17:07:43 -07:00
Dirk Hohndel
114904a48f iOS: always create subsurface.log file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-13 17:07:43 -07:00
Dirk Hohndel
e5162f81d6 Fix typo
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-09 09:34:52 -07:00
Lubomir I. Ivanov
167db8fc18 mapwidget-mobile: initialize the map to [0,0]
Instead of showing the map zoomed over London by default,
initialize the center at [0,0] and show the whole globe.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-04-02 13:47:43 -07:00
Lubomir I. Ivanov
48c032bb8e mapwidget-mobile: do not animate the first selection
centerOnLocationHard() is added in MapPage.qml so that
on `firstRun` the map is hard panned to the desired location
without animation.

This affects the selection of a new "Dive details" -> "Map it" or
when opening a GPS location in the map.

The idea behind this change is to avoid starting the map animation
from an arbitrary location such as [0,0] or London. Also, to not
start the map zoomed out completely and then zoom in on a selected
dive.

For this change to work, add the helper getCoordinatesForUUID()
to qmlmapwidgethelper.cpp/.h and use it to obtain the
QGeoCoordinates for a dive site UUID.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-04-02 13:47:43 -07:00
Joakim Bygdell
01e4ec47be QML UI: Fix checkbox color
The background color in our own checkbox should match the page background.
Also includes some whitespace cleanup.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:03:06 -07:00
Joakim Bygdell
ab99703b02 QML UI: drop focus when selecting a location
Make sure to drop focus both for typing and when selecting
an entry from the list.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:01:14 -07:00
Joakim Bygdell
94e0ec8dc9 Mobile: change location combobox id
Change the id of the location combobox to math the naming scheme
of the other comboboxes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:01:14 -07:00
Joakim Bygdell
07fb1db3ad Mobile: Fix location combobox
In the initial move to comboboxes the correct location model
was not used. This uses the correct model and makes it behave
like the other comboboxes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:01:14 -07:00
Joakim Bygdell
93ba8f1a05 Mobile: for multiple buddies pick index of first
When a dive has multiple buddies, pick the index of the first
to prevent the user from hanving to scroll through the entire
list when editing.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:01:14 -07:00
Joakim Bygdell
6badba2bae QML UI: drop focus on edit
Drop focus on editable comboboxes when pressing enter.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:01:14 -07:00
Joakim Bygdell
477d1a3533 Moblie: remove comparison when saving
Removing the comparison of currentText vs editText when saving buddies
fixes the issue of data loss when dive has more than one buddy.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:01:14 -07:00
Dirk Hohndel
7feb9a3b6e QML UI: drop focus when ComboBox element is picked
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-19 12:01:14 -07:00
Dirk Hohndel
9145ea209f QML UI: cylinders aren't editable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-19 12:01:14 -07:00
Joakim Bygdell
9755650b3c QML UI: switch editing back to comboBox
The HintsTextEdit just doesn't feel natural and intuitive.

Edit, fixed rebase issues.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19 12:01:14 -07:00
Berthold Stoeger
d1572a8d95 Cleanup: introduce copy_qstring() function
strdup(qPrintable(s)) and copy_string(qPrintable(s)) were such common
occurrences that they seem worthy of a short helper-function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-14 13:55:36 +02:00