Commit graph

33 commits

Author SHA1 Message Date
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
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
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
14b4c94ded Revert "QML UI: build against latest Kirigami"
This reverts commit a842e44b68.
2017-01-21 14:42:10 -08:00
Dirk Hohndel
6459e455bc Revert "QML UI: steps towards working with Kirigami 2"
This reverts commit 53ce3ce3e3.
2017-01-21 14:42:00 -08:00
Dirk Hohndel
53ce3ce3e3 QML UI: steps towards working with Kirigami 2
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-27 09:22:05 -08:00
Dirk Hohndel
a842e44b68 QML UI: build against latest Kirigami
But of course this doesn't work, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-27 01:47:01 -08:00
Joakim Bygdell
1219dc6931 QML UI: deal with multiple buddies correctly
When editing adive in Subsurface-mobile we can only handle one buddy
due to the limitations of the combobox. To prevent loss of data when editing
a dive with more than one buddy we display "Multiple Buddies" in the buddy
field. This creates a special case where no changes are written to the buddy field
unless the user changes buddy for that dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17 13:46:15 -07:00
Joakim Bygdell
4e0200863b Remove hacks regarding multiple gasmixes and cylinders
Enabling cylinder edit in Subsurface-mobile our previous hacks
regarding multiple cylinders and gasmixes must be removed.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:36:43 -07:00
Joakim Bygdell
674d8331f5 QML UI: Enable cylinder edit
This adds the option to select a cylinder when adding or editing a dive.
Due to limited screen size we restrict the editing to the first cylinder only.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:36:13 -07:00
Dirk Hohndel
22170d3991 QML UI: add debug output for dive edit save button
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-12 14:49:40 -07:00
Joakim Bygdell
a6c8d0028e Make autocomplete work on add dive
This sets the list models for autocompleting suit, buddy and
divemaster.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:01:53 -07:00
Joakim Bygdell
0e4e8edf78 QML UI: add comboboxes to DiveDetailsEdit
This adds autocompleting text input fields for suit, buddy and
divemaster.

[Dirk Hohndel: some whitespace cleanup]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:05:20 -07:00
Robert C. Helling
502be2a0f1 Mark strings in qml files for translation
I did this semi-automatically: I used the script from
the previous patch and then did some manual corrections.

This marks only title: and text: tags, there might be others

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-03 12:59:16 -07:00
Dirk Hohndel
49e2113ae8 Remove hack that's no longer needed
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27 15:05:37 -07:00
Dirk Hohndel
0fcf67ca55 QML UI: make sure drawer is really closed after delete
At least one iPhone user still has the drawer pop open and prevent
them from using the undo function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20 07:42:10 -07:00
Marco Martin
b3d0d9fd4e Don't put margins outside the internal ListView
put the margins only around the fullscreen delegate of the listview,
making the listview go all trough the screen edges.
This because the cutted effect when the list view is half scrolled
looks quite ugly. Making the ListView reach the borders
also moves the scroll indicator at the screen edge
where it conventionally is.

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 10:35:07 -07:00
Dirk Hohndel
ac0c1eb5e1 QML UI: prevent changing pages while showing the edit/add overlay sheet
If you switch back to the dive list by swiping horizontally you stay in
edit/add mode and then can't select a dive on the dive list. This way you
have to discard or save the edit, first.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 10:34:44 -07:00
Dirk Hohndel
a807a5e8cd QML UI: show dive site on map with left action on dive details page
The icon isn't great, though.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 05:14:44 -07:00
Dirk Hohndel
c6dbbe1aac QML UI: adapt for latest Kirigami
In commit 50ebdd020e3c of the Kirigami project the syntax with which
actions are added to pages has changed. This commit tracks that, adds the
new file that was added in Kirigami and also removes the now obsolete
context menus (since we have a working back button on iOS now)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 05:14:44 -07:00
Dirk Hohndel
c111c4bb02 QML UI: add elements to allow editing the GPS coordinates
This isn't hooked up, yet, but provides the UI

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15 13:22:16 -07:00
Dirk Hohndel
9f9853fc44 Hack to work around issue in current Kirigami master
Commit 339411cca69b in Kirigami master tries to reparent the OverlaySheet
to the page that it is related to. Unfortunately the heuristic used there
to find the right object assumes that every page has a contentItem
property, which our DiveDetails page doesn't have.

As a hack to work around this issue (until this is fixed upstream in
Kirigami) we simply create such a property. This commit should be
reverted once Kirigami upstream has been fixed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 10:53:31 -07:00
Dirk Hohndel
6e6cce770b QML UI: keep QML manager and the UI in sync about selected dive
The manager can now directly update the index of the selected dive, and
the UI tells the manager the timestamp of the currently selected dive.
This allows the manager to pick the best possible dive as selected dive
if things change (for example if the dive list gets reloaded because it
changed in cloud storage).

Fixes #1009

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 09:43:33 -07:00
Robert Helling
7bca367c57 Upon undoing a dive deletion select that dive
Before it had the next dive still selected.

Fixes #1053

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11 12:41:41 -07:00
Dirk Hohndel
1004ced285 avoid dereferencing undefined object
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-07 22:57:01 -07:00
Dirk Hohndel
5dab95b364 QML UI: use Kirigami default padding
The issue with needing extra space at the top of the page has been
fixed upstream.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05 15:49:31 -07:00
Dirk Hohndel
7be962bfc2 Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:33:58 -07:00
Renamed from qt-mobile/qml/DiveDetails.qml (Browse further)