Commit graph

10017 commits

Author SHA1 Message Date
Anton Lundin
128fc39274 Use libdivecomputer libc wrappers instead of Qt
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:50:10 -08:00
Anton Lundin
b2da9abae1 Remove unused headers
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:50:06 -08:00
Anton Lundin
e59e067042 Remove workaround for OSTC Sport 10.22 and below
Now with firmware 10.23, the settings behave as they should, and won't
hang the communication.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:50:01 -08:00
Jan Mulder
040ef3a8f2 QML-UI. Improved button style
Pressing of buttons were difficult to see mainly due to small buttons
and small color distance between pressed and un-pressed state. This fix
enlarges the buttons a little, and choses a different color for
the pressed state.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:47:06 -08:00
Jan Mulder
996367ac97 QML-UI. Add Back to Divelist menu item
As asked for on the mailinglisrt, a menu item is added to return
to the Divelist the easy way. In addition to the standard Android
back button.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:44:07 -08:00
Dirk Hohndel
c2eeda44e6 Avoid precision loss on GPS fixes
It appears that the Qt documentation might be incorrect. It claims that
the precision value is digits after the decimal point, but we have seen
examples where the values posted to the server appear to have a total of 6
digits, including the digits ahead of the decimal point.

Upping this to 9 shouldn't hurt if Qt gets fixed, but should work around
the issue reported by a tester.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:41:43 -08:00
Dirk Hohndel
260cd14a2b QML UI: maximize horizontal size of notes when editing
This seems a bit brute force but I couldn't get the width to propagate
correctly any other way.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21 13:09:10 -08:00
Dirk Hohndel
9e9d220c98 QML UI: show dive trip again
This once again displays trips in the dive list and makes the visual a bit more
spaceous.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21 12:42:16 -08:00
Dirk Hohndel
6faf33047e Return a value when getting SAC rate
Obvious "mass edit" error.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21 12:41:40 -08:00
Dirk Hohndel
eef5bf75c3 QML UI: fix map display regression
In commit 6540e95425 ("dive details navigation") the change to access the gps
variable was only partially implemented.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21 12:23:07 -08:00
Dirk Hohndel
f84e823879 QML UI: switch edit back to not being a drawer
With this edit seems to work again. The edit page can be scrolled around on
smaller screens to allow editing every part of it and to allow the user to
press the "save" button.

This is mainly intended to make sure testing can continue - it's unclear if
this will be the final design.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-20 14:07:06 -08:00
Dirk Hohndel
3116bc06fb QML UI: show date and time for dive
We keep losing the time when people move code around. date really is just the
date and doesn't include the time component.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-20 14:06:05 -08:00
Dirk Hohndel
60e0a6e833 QML UI: fix bugs in change detection on dive edit
We were comparing apples to oranges on a few items and therefore more or less
always assumed that a dive had been modified.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-20 13:56:28 -08:00
Miika Turkia
a329d44de0 If set imperial units explicitly on mobile app
If unit_system is set to imperial, we need to set the units explicitly
on mobile application.

Fixes #993

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-20 08:48:23 -08:00
Rick Walsh
85c57c005f QML preferences: use Layout.preferredHeight within GridLayout
It's not recommended to set the height explicitly of an item in a layout. Use
Layout.preferredHeight instead

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-20 07:54:24 -08:00
Rick Walsh
471270437b QML UI: make all buttons more attractive
Commit f3f7930 introduced a more attractive button style to the start page.
This patch turns it into its own type so it can easily be used everywhere.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-20 07:53:49 -08:00
Dirk Hohndel
f3f79309d3 QML UI: make the buttons on the start page more attractive
Those plain rectangular buttons were just too ugly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 22:32:37 -08:00
krisalpha
b42dd941c1 Fix UI issue with location management
The index in the fixpopup function was incorrect which caused the user to
need TWO cursor down presses to move to the second element. I changed the
index value so the user now needs only one key press to traverse up/dowm.

Fixes #954

Signed-off-by: krishan Chopra <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 13:06:38 -08:00
Rick Walsh
15a014105b QML UI: Don't explicitly set width of GridLayout items
It is not recommended to set the width explicitly of items in a layout. This
caused some issues in DiveDetailsView, which were fixed by commit 1030cb2.
See http://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#details

Set 'Layout.preferredWidth' instead of 'width' for GpsList and Preferences

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 13:06:31 -08:00
Dirk Hohndel
88101e4dd3 QML UI: don't shorten the buttons
I want a prettier visual for those, anyway, but artificially making them
shorter than that text they display seems silly - and causes the text to be
trunkated for no good reason on some devices.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 12:53:32 -08:00
Dirk Hohndel
04e994b575 Subsurface-mobile on Android: change the splash screen methodology
This is based on post by Ben Laud
https://medium.com/@benlaud/complete-guide-to-make-a-splash-screen-for-your-qml-android-application-567ca3bc70af

It creates a theme that uses a splash drawable that Android will show
immediately when the application is launched. And then starts the QML
application with visibility set to false adn only makes it visible (and replace
the splash screen) once initialization is finished.

We still get a little flicker with the switch from splash to start page to dive
list, but over all the experience is hugely improved. And the bug that the
splash screen stays around when starting Subsurface-mobile in landscape also
appears to be fixed.

Fixes #994

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 12:42:58 -08:00
Dirk Hohndel
f466ee61da Don't blindly copy a pointer to the heap
Copying the entry pointer and assuming that it stays valid is of course totally
bogus. This is most likely the reason for the random crashes people have
observed.

See #992

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 10:33:53 -08:00
Sebastian Kügler
e9e843dc3c Close edit drawer when current dive changes
This prevents having the edit drawer opened at a different than the
current dive.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-19 18:41:51 +01:00
Rick Walsh
1030cb265a QML UI DiveDetailsView: shift dive number to right of top row
In dive details view, shifting the dive number to the right of the top row
means it won't be cut short if the dive duration is 1 hr or longer

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 07:16:49 -08:00
Dirk Hohndel
464b88f01f QML UI: yet another attempt to fix the profile scaling
This one appears to work in my testing so far. And reading the code it
seems to make sense. We look at the size that the widget thinks it is. And
we scale the scene to fill that size (including a margin). And then let Qt
and QML deal with the rest of it. Assuming this works it shows that we
have been trying too hard all this time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 12:32:47 -08:00
Dirk Hohndel
38c60e02c7 Fix crash with empty (or very short) dive list
In commit 37c10c8fd6 ("Add dive type to statistics window") not enough
space is reserved for the newly introduced array if the dive list as fewer
than 4 entries.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 11:45:25 -08:00
Dirk Hohndel
040d3cd413 build.sh: fix broken logic to pull mobile components
In commit f28f03afe2 ("build.sh: make it easier to build
Subsurface-mobile") I mistakenly broke the logic that decides to run the
mobilecomponents.sh script.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 11:20:05 -08:00
Miika Turkia
37c10c8fd6 Add dive type to statistics window
This adds dive type based division to the "yearly statistics" window.
Thus people can see the stats from individually from OC, CCR, PSCR and
freedive.

See #949

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18 09:34:54 -08:00
Miika Turkia
b9000208fe Hide the time from trip tab
This hides the start time when viewing trip details.

See #964

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:40 -08:00
Miika Turkia
394ddba013 Mark date field readonly on trip edit
The date comes from the first dive in trip, thus no need to allow
editing (especially since the edited date seems to be discarded in any
case).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:29 -08:00
Dirk Hohndel
f28f03afe2 build.sh: make it easier to build Subsurface-mobile
The script now takes a -mobile argument, or -both and then builds the
mobile version or both versions. To make things more consistent across
different invocations the desktop version is built in the "build"
directory and the mobile version is built in "build-mobile".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:44:00 -08:00
Willem Ferguson
69eeb2bf5b Make default build for desktop.
Make the default build a DesktopExecutable, with an option to set a variable for doing a mobile build.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 08:42:14 -08:00
Dirk Hohndel
df9062bd2e QML UI: next attempt to address the profile scaling
It seems to be much more logical to address the size and scale right
before rendering.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 13:55:42 -08:00
Tomaz Canabrava
ba111ce9a3 Settings QObjectification: implement the unit settings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:56:43 -08:00
Tomaz Canabrava
455f7bd51b Settings QObjectification: unit system
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:56:28 -08:00
Tomaz Canabrava
8e61c36ca7 Settings QObjectification: dive planner preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:56:14 -08:00
Tomaz Canabrava
7b5656a08b Settings QObjectification: add PlannerSettings
We probably want to change that on the prefs struct too.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:51 -08:00
Tomaz Canabrava
93762249fa Settings QObjectification: cloud storage preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:39 -08:00
Tomaz Canabrava
f5c69e3a56 Settings QObjectification: finish network preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:18 -08:00
Tomaz Canabrava
22da63e839 Settings QObjectification: start Proxy QObject config
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:55:02 -08:00
Tomaz Canabrava
cae6960eac Settings QObjectification: some cleanups
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:54:54 -08:00
Tomaz Canabrava
ab35ee69bd Settings QObjectification: geocoding preferences
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:54:30 -08:00
Tomaz Canabrava
5c62a0aac6 Settings QObjectification: minor cleanups
Rename a few methods wrongly named and place them on the correct place on the file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:53:59 -08:00
Tomaz Canabrava
9b37c6dfa1 Settings QObjectification: Facebook settings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15 05:53:28 -08:00
Dirk Hohndel
0dba3c4e4a Don't round up / use minimum duration for profile in Subsurface-mobile
On the desktop we have long had this vision of a minimum length and a
"pleasant" duration of the profile - but on a device this seems to look
like uneven margins. So let's just add space for the labels and not
otherwise mess with the duration.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13 16:47:52 -08:00
Sebastian Kügler
53024ca76d try to fix profile scaling
Different approach here:

- profile gets a bit higher, this was requested on the mailinglist, and
  seems to behave much better with the painted profile, we'd otherwise
  get it magically clipped on the right hand side.
- Make the scaling dpi aware, this fixes scaling for me on the Nexus7, I
  haven't been able to test it properly on other devices, so this needs
  some more testing. The result is visually quite close to what we can
  do, although I'm still getting a somewhat larger margin on the right.
  To get at the devicePixelRatio without too much custom code, I've
  added a property to the QMLProfile to retrieve it from the theme engine.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13 16:27:41 -08:00
Sebastian Kügler
8199c13f42 fix misrendered profiles when fast-flicking
- Apparently, QMLProfile doesn't like being painted without being
  visible, when flicking quickly through the dives I would get empty
  rendered profiles. Setting the cachebuffer to zero fixes it, and saves
  some memory.
  It still has some unfortunate timing, the profile gets rendered
  mid-flick, which leads to a delay in the flicking motion, quite
  annoying. We will have to somehow make sure that new profiles are
  rendered after flicking, not during
- Smallish cleanups

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-13 03:08:34 +01:00
krisalpha
7e9648c5cb Be more precise in our language: call it "mean depth"
As pointed by jwhferguson, I changed "show average depth" to "show
mean depth".

I modified file preferences_graph.ui and changed the text. This bug was
reported on fedora 22. i use ubuntu.layout and justification is nicely
displayed.

The patch also removes a no longer necessary include.

See #922

Signed-off-by: krisalpha <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-12 10:35:28 -08:00
Sebastian Kügler
9fc19039df Better behavior for dive details flicking
- stop at bounds, this is in line with other flickables. I really
  don't like Flickables floppy default behavior to allow dragging and
  scrolling over the bounds.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-12 07:10:52 -08:00
Dirk Hohndel
877efebaac Merge github.com:sebasje/subsurface 2016-01-11 18:15:35 -08:00