Commit graph

192 commits

Author SHA1 Message Date
Dirk Hohndel
972819d77a QML UI: more fine tuning of the magic shift factor
Now it should also work on devices with device pixel ratios of
1.3, 1.33, or 1.4.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16 08:26:40 -07:00
Dirk Hohndel
20f525cedd QML UI: correctly update dive list after editing timestamp
Once we re-inserted the dive in the list we aren't done, quite the
contrary - we now need to make sure that we handle any other changes
and mark the dive list as updated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16 07:43:48 -07:00
Dirk Hohndel
03b2b854bf QML UI: correctly parse manually edited date
We need to set the timeSpec after the QDateTime was parsed,
otherwise it gets converted to localtime again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16 07:43:48 -07:00
Dirk Hohndel
74a5511b39 QML UI: fix broken delete from dive details page
Trying to close the non-existing context drawer caused the function
to abort (and consequently not to delete the dive).

Fixes #309

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-15 13:50:18 -07:00
Dirk Hohndel
cc6c41c846 QML UI: fix GPS list rendering
There was an extra BasicListItem inside the SwipeListItem.
This commit just removes 5 lines, the rest is indentation change.

Fixes #312

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-15 13:33:48 -07:00
Dirk Hohndel
052be692bb QML UI: reset completion fields when adding dive
Otherwise the last value in those fields might still be shown.

Also, set up the cylinder completion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 17:33:11 -07:00
Dirk Hohndel
6a50efd80a QML UI: create completion list for cylinders as well
We already have that for the other three fields where we offer auto
completion (buddy, divemaster, suit).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 17:32:45 -07:00
Dirk Hohndel
e42bf2cfa5 QML UI: fix profile for device pixel ratio of 1.5
I think this is actually a typo - either way, seems to work correctly
now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 16:57:09 -07:00
Dirk Hohndel
c00b14af9a QML UI: better simulation of onPressed in TextField
Prior to Qt Quick Components 2.1 there was no onPressed signal for a
TextField; in order to be able to build against Qt 5.7 (which comes with
Qt Quick Components 2.0) we need to work around the lack of this signal.
This code seems to do a pretty good job at simulating it.

My attempt in commit 73c66e1d7d ("QML UI: make run with Qt 5.7 again")
didn't work so well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 14:04:34 -07:00
Dirk Hohndel
ee4ae49d37 QML UI: don't populate hints texts when adding dive
If we don't have values for the HintsTextEdit fields, don't show any
values.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 13:43:48 -07:00
Dirk Hohndel
525cd4c9e3 QML UI: correctly render dive list when showing delete button
This fixes the visual artifact that Willem reported.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 13:13:06 -07:00
Dirk Hohndel
ee75812b5a QML UI: keep the fontMetric
We reference it elsewhere.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 13:05:01 -07:00
Dirk Hohndel
1246324897 QML UI: don't shrink fonts on narrow displays
Now that wrapping should work correctly, this isn't necessary any more.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 11:17:00 -07:00
Dirk Hohndel
73c66e1d7d QML UI: make run with Qt 5.7 again
onPressed needs to be relative to Keys in Qt 5.7.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 09:50:57 -07:00
Dirk Hohndel
c8bf412720 QML-UI: remove references to download from divecomputer
This needs to be reimplemented.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 09:50:57 -07:00
Dirk Hohndel
540b3548b9 QML UI: add 2cm x 2cm square to theme test page
This should make it easier to spot displays that are completely out of
whack in their scaling.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-13 18:21:50 -07:00
Marco Martin
71191f1294 QML UI: only assign actions in a declarative way
Assigning actions in an imperative way on component complete,
seems to cause a crash on some devices, assign declaratively
the whole list instead, hiding the gps related actions on
iOS as they are not supported on that platform.

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-13 11:05:26 -07:00
Dirk Hohndel
4ea4e8fa81 QML UI: re-layout the details view
This is a different take that seems to deal much better with different
width and font size combinations.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-11 17:24:44 -07:00
Dirk Hohndel
f99aedc626 QML UI: correctly set grid column widths
Spending more time reading the documentation, we need to set the
Layout.maximumWidth, not the width.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-10 10:22:02 -07:00
Marco Martin
8a71196e4e QML UI: fix saving fields using HintsTextEdit
The editText property is not there anymore, we need text

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 19:10:22 -07:00
Marco Martin
89d7dd4348 QML UI: dialog of HintsTextEdit on top
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 19:10:22 -07:00
Dirk Hohndel
01d091fbd5 QML UI: better handling of device pixel ratio
In order to make sure we don't render the initial profiles with the
wrong scale on devices, we need to seed the device pixel ratio with the
device default and then update it once the window has been created.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 11:00:18 -07:00
Dirk Hohndel
e700ea9638 QML UI: more hacks for the magicShiftFactor hack
Since the device pixel ratio can be a fraction we should interpolate the
values. I still don't really understand why this is necessary, so this is
a hack on top of a hack - but for most values I tried this does seem to
give us a reasonably well placed (and well scaled) profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 11:00:18 -07:00
Dirk Hohndel
8c94fa2676 QML UI: ensure actions are set up for Credentials page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-03 10:49:07 -07:00
Marco Martin
e4460be8a6 QML UI: use a scrollable page for StartPage
Fixes scrolling of the cloud credentials and simplifies code

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-03 07:22:56 -07:00
Marco Martin
4113bab17b QML UI: replace combobox with custom text field with hints
Signed-off-by: Marco Martin <notmart@gmail.com>
2017-04-01 09:36:47 +02:00
Marco Martin
751626eec5 QML UI: Fully port dive edit to Kirigami2
Completely adapt to the api changes of OverlaySheet in Kirigami2
in order to achieve the same look and behavior for the dive
edits that had with kirigami1

Port most components to QtQuickContrls2, except comboboxes
in the dive edit sheet that will need a new control type

Signed-off-by: Marco Martin <notmart@gmail.com>
2017-04-01 09:35:51 +02:00
Joakim Bygdell
bd0c99dfb7 MOBILE: Display pO2 and Setpoint for CCR dives
For CCR dives we want to display the setpoint and pO2 information,
due to the limited screensize we have to remove the temperature graph or
the view will be to cluttered.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-03-26 21:57:57 -07:00
Jan Mulder
d6003209d6 Subsurface-mobile: do send decimal GPS to Google
Sending nicely readable formatted coordinates to Google Maps does not
result in a correctly positioned map. Google likes unreadable
decimal format.

Little hacky solution. Added a gps_decimal attribute, populate that
with the standard function for format a coordinate to string, but
reset the preferences value temporarly so that it always converts it
to decimal style.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:35:00 -07:00
Jan Mulder
59417342c7 mobile: the infamous enumerate problem
This fix seems to fix the enumerate problem: the problem that on a
seemingly non-determinstic way, all the profiles get enumerated
and rendered, causing freeze of the app, or even crash due
to out of memory.

Only 3 lines of code change, but this fix did not come easy. The
enumerate problem seems some kind of race condition between QML,
Kiragami and most definitely, the Subsurface QML code itself.
The breakthrough in my debugging was the setting of
highlightRangeMode: ListView.StrictlyEnforceRange based on
the QML documentation on snapMode: enumeration.

This fix deserves proper testing in multiple environments. As
could be seen on the developpers mailing list, I was (easily)
able to reproduce the enumerate problem, but Rick was not. So
I definitely do not claim to understand why this fix solves
the issue for me.

And as a sidenote: fixes #263 for me as well.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:27:23 -07:00
Dirk Hohndel
220d25588f QML UI: enable caching of the details view
This way the dive on either side should be cached.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
783f9ee565 QML UI: don't explicitly position view
Instead have the view follow the currentItem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
7ffc619f4c QML UI: make profile drawing less verbose
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
10842b3eb3 QML UI: don't unset the currentIndex in the dive list
It's unclear why this code was added in the first place - removing it
makes the highlight of the selected dive in the dive list work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
dd1d90b529 QML UI: don't clip
At least that's what the QML documentation recommends.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
a2bc3e02f8 QML UI: small cleanups
Remove unused signal handler.
Small whitespace cleanup.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
9389fd0049 QML UI: don't access members of undefined objects
If we don't have a currentItem, don't try to access its members.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
33df10cbaa QML UI: small clarification
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
d87d97a794 Sync unit system to Subsurface-mobile (part 2)
Missed a spot.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11 16:09:06 -08:00
Dirk Hohndel
ae9ab68096 Correctly sync unit system to Subsurface-mobile
We were doing the right thing switching from metric to imperial, but in
order to swtich back you had to restart. Now it works both ways.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11 15:23:42 -08:00
Jeremie Guichard
406e4287eb Change calls to rint into lrint avoiding conversion warnings
Using gcc option "-Wfloat-conversion" is useful to catch
potential conversion errors (where lrint should be used).
rint returns double and still raises the same warning,
this is why this change updates all rint calls to lrint.
In few places, where input type is a float, corresponding
lrinf is used.

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-08 14:04:17 +07:00
Martin Měřinský
869a7fcfcc dive master > divemaster 2017-03-04 12:08:17 -08:00
Martin Měřinský
f007f0329b Remove space before colon. 2017-02-21 07:03:10 -08:00
Joakim Bygdell
0277d5aacc Merge informational_prefs into git_prefs
There is no need to have two variables for the same purpose.

[Dirk Hohndel: changed to keep the two separate functions as otherwise
               we no longer parse existing repos successfully]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05 12:29:51 -08:00
Joakim Bygdell
11dcae436e MOBILE: Read profile settings from git
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-02-05 11:59:47 -08:00
jbygdell
0e57033042 QML UI: Parse multiple buddies when editing a dive
This allows the user to enter multiple buddies as a comma separated list,
the "Multiple Buddies" entry is still a special case as we can only populate
the combobox with a single name for each entry.

fixes #168

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-01-29 14:55:33 -08:00
Dirk Hohndel
b15b3c195c QML UI: allow magic phrase for multiple buddies to be localized
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-22 18:20:03 -08:00
Dirk Hohndel
0196d9a220 QML UI: correctly test if there are multiple buddies
The JS string function search returns the position of the string you
search for and -1 if that string isn't found. Also, search allows
regular expression, indexOf does just a string match. So let's use
that as it is much faster.

See issue #168

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-22 18:18:57 -08:00
Dirk Hohndel
bfaeb22cc5 QML UI: prevent modification of Multible Buddies text
"Multiple Buddies" is magic in that it means "do not change the buddies
set for this dive". Allowing the user to edit that magic phrase defeats
the purpose.

This deals with part of issue #168 - but of course that magic phrase
shouldn't be fixed as English text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-22 18:18:07 -08:00
Dirk Hohndel
fc60f210c4 QML UI: move 'No dives in dive list' down
Otherwise it overlaps with the page title.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-21 17:06:07 -08:00