Commit graph

491 commits

Author SHA1 Message Date
Dirk Hohndel
a065b97472 QML UI: make dives outside of dive trips always visible
Create small visible separation from the dive trip before. And make the dive
trip header a slightly different color so they stand out between dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-29 20:08:15 -05:00
Dirk Hohndel
83c72e7a79 QML UI: make dive list fold dive trips
This makes it MUCH easier to deal with a lot of dives.

Instead of needing a more complicated model we simply use the meta data that
allows us to create the dive trip sections to hide (make invisible + height 0)
all dives that aren't in the selected trip.

I'll admit that this was much easier than I expected it to be.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-29 19:42:34 -05:00
Dirk Hohndel
dd0d88f9d7 QML UI: take device pixel ratio into account when scaling pixmaps on iOS
This way warning icons and tank change icons and other event markers are no
longer ridiculously tiny on retina screens. Oddly this doesn't appear to be
needed on Android, only on iOS.

Fixes #1033

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-28 17:05:29 -05:00
Dirk Hohndel
4670373731 QML UI: tighten credential input screen
This way even on smaller screens both email and password should fit
above the keyboard which makes data entry so much easier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-27 19:10:58 -05:00
Dirk Hohndel
a4977f2a90 QML UI: add some diagnostics to App log
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-26 21:49:20 -07:00
Dirk Hohndel
d4357b3b21 QML UI: allow writing to App log from QML
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-26 21:49:19 -07:00
Dirk Hohndel
7434e4213b QML UI: show keyboard when entering credential screen
If the user goes to the credentials screen, they likely want to edit
something.  So put the focus on the first entry field and show the
keyboard.

We also need to hide the keyboard when the credential screen becomes
invisble so that the keyboard doesn't stay around when the dive list
is shown.

Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-26 21:49:19 -07:00
Dirk Hohndel
d99c931219 QML UI: remove the checkbox for remembering the password
In the context of the mobile app this simply makes no sense. If the user
doesn't select this option, the app doesn't really work. So why have the option
in the first place?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 21:42:20 -07:00
Dirk Hohndel
246422d03f iOS build: fix typos
Can't believe I didn't notice them earlier... I must have stared at these
strings countless times.

Reported-by: Scott Ireland <scott@sdj.ca>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 21:36:42 -07:00
Dirk Hohndel
a9cf089e1c QML UI: remove verbose option from Developer menu
We now log everything that's relevant to the application log that is shown
in the UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 16:37:23 -07:00
Dirk Hohndel
6c9247b56b QML UI: improve About screen
This should actually give a correctly positioned logo.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24 09:44:05 -07:00
Dirk Hohndel
854eb57ef5 QML UI: always convert the cloud user name to lower case
Mixed case user names cause the connection to the cloud storage to fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 23:12:03 -07:00
Dirk Hohndel
fcb93362ac QML UI: reduce application log clutter
We don't need to flood this with the profile scaling data anymore; that's
hopefully fixed for good.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 21:22:55 -07:00
Dirk Hohndel
b16e8e7b4e QML UI: work around missing back button on iOS
Especially when showing the dive details and editing dive details,
having the option to go back in the context menu is nicer on iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 21:15:01 -07:00
Dirk Hohndel
e8f8051efe QML UI: use consistent, darker text color for dive list
We received suggestions from users to darken the text color in the dive
list a bit and this does seem to be a lot more readable. Especially since
people are likely to use this outdoors the higher contrast seems
reasonable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 11:36:11 -07:00
Dirk Hohndel
4f935595d9 QML UI: make return to dive list work when entering credentials
If the user tapped on the "Cloud credentials" menu and wants to go back to the
dive list (by selecting that option from the menu), allow them to do so if they
previously had valid credentials.

This allows them to go back to the dive list even on a device without a back
button like an iOS device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 11:41:09 -07:00
Dirk Hohndel
8dcb6fa25c QML UI: show user manual in browser window
This is so obvious... and I know others asked for this before. Should
definitely have been in the first version...

Fixes #1026

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 11:13:04 -07:00
Dirk Hohndel
087cda05e6 QML UI: font color isn't supported on app log page
So let's remove all that markup.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 08:58:57 -07:00
Dirk Hohndel
3efa20820a QML UI: show cloud access notification when refreshing from menu
If the user requests a refresh we always try to access the cloud and need to
show the notification accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 08:56:29 -07:00
Dirk Hohndel
f1d73606e5 QML UI: don't allow negative gas consumption
If end pressure is higher than start pressure, simply use the same start
and end pressure.

Fixes #1024

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11 13:17:57 -08:00
Dirk Hohndel
5a83226aa8 QML UI: try to clean up UI before showing notification
This way we shouldn't have a drawer or other changes to the UI prevent the
user from seeing / interacting with the notification.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11 10:10:13 -08:00
Dirk Hohndel
8224b87b7a QML UI: don't claim to be accessing the cloud when you are not
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 22:17:23 -08:00
Tomaz Canabrava
fcb308fdf2 Red error messages in QML
[Dirk Hohndel: slightly changed to make it easier for translation plus
               added one missing string that needed to be marked]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 22:14:58 -08:00
Dirk Hohndel
ba89d9bbb1 QML UI: correctly validate the gasmix entered
We parsed it correctly, but then compared the permille values against
percent thresholds. What a stupid bug.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 22:03:00 -08:00
Dirk Hohndel
969ca3d9ea QML UI: if the date entered doesn't match the format, try harder
This implements a bunch of standard date and time formats, hoping that
what the user entered matches one of them.

I guess in the end we need to find decent calendar/clock based widgets to
enter the time and avoid the whole parsing hassle.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 18:36:46 -08:00
Dirk Hohndel
3be6b128fd QML UI: hide some profile scaling debug messages
Simply make things less verbose

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 18:02:36 -08:00
Dirk Hohndel
9d6c755f48 QML UI: keep cloud access notification until done
Instead of having the notification disappear after five seconds, keep it
visible until we are done accessing the cloud. That seems to be more
intuitive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 18:00:44 -08:00
Dirk Hohndel
44deaf6c51 QMLProfile: account for device pixel ratio when transforming the profile
This is turning into the never ending story. The documentation is not helpful,
so this is the result of a ton of trial and error - and I worry that the next
device I try this on will once again break things.

I think the scaling may finally be correct. Take the viewport rectangles
of the profile and the painter, create their ratio, multiply in the device
pixel ratio and the scene size with a little margin added around it.

But the other magic (especially the shifting of the profile on the
painter) makes absolutely no sense to me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:50:56 -08:00
Dirk Hohndel
f798132862 QMLProfile: correctly track the device pixel ratio
And set the font size accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:50:47 -08:00
Dirk Hohndel
7f99d9e9c3 QMLManager: helper function for devivePixelRatio
This allows us to use the single manager object to keep track of the dpr of the
screen and to pass it on if it changes (or when it first becomes known).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:50:42 -08:00
Dirk Hohndel
308b69359d QMLManager: fix order of initialization
Just avoids warnings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:50:35 -08:00
Dirk Hohndel
af2a90b536 QML UI: remove incorrect calculation of devicePixelRatio
That's just bogus.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:50:29 -08:00
Dirk Hohndel
d42b7f55c4 Introduce separate version number for Subsurface-mobile
This is hard coded in version.cmake for now. The intent is to go to 1.0 in
the first release version and to increment from there whenever we create
an update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05 17:00:14 -08:00
Dirk Hohndel
5aa94578f7 QML UI: small modification to About screen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05 17:00:14 -08:00
Dirk Hohndel
a873711cec QML UI: make sure the drawer is closed after going back to dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 15:12:09 -08:00
Dirk Hohndel
80f29bd3f6 QML UI: brute force around Qt 5.6.0 bug
With the current release candidate of Qt 5.6.0 we get into an infinite
recursion of the grid layout engine. This had happened before (prior to the 5.6
beta) and it appeared that setting the maximum width of the columns was
sufficient to fix this. But with the RC even that isn't sufficient, so now we
give up on having QML figure out the best possible column width and hard code
both preferred and maximum width to the same, predefined values. That's a total
shame, but at least now we can build against Qt 5.6 without infinite recursions
and crashes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:36:57 -08:00
Dirk Hohndel
0cad6d206c QML UI: remove commented out / unused code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:35:54 -08:00
Dirk Hohndel
12f36c92e1 QML UI: try to avoid binding loop
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 10:51:52 -08:00
Marco Martin
d24e5b455f use the global showPassiveNotification function
don't create a local PassiveNotification copy,
use the global show/hidePassiveNotification from
ApplicationWindow, now that it works

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 10:44:41 -08:00
Dirk Hohndel
93f9bcd041 QML UI: remove incorrect statement
Not sure what this was even supposed to do...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 06:35:25 -08:00
Dirk Hohndel
6ac4fe7b18 QML UI: show notification for saving dives to cloud as well
Fixes #1014

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 06:33:00 -08:00
Dirk Hohndel
c5153fbc10 QML UI: ensure that cloud notification is always cleared
All error cases need to reset it as well.
And it's easier to reset it right after we come back from parse_file()
instead of trying to track all the exit cases after that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 06:32:12 -08:00
Dirk Hohndel
7133216653 QML UI: show notification when cloud is accessed
And hide the notification either after 5 seconds or once we are done.

This requires an extension to the Kirigami components that isn't upstream,
yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 17:14:47 -08:00
Dirk Hohndel
1f0b716021 QML UI: new property to tell the UI that we are accessing cloud storage
This can then be used to give the user visual feedback (instead of them
just thinking the app is hung).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 17:13:42 -08:00
Dirk Hohndel
605d085573 QML UI: resolve confusion about dive list model ordering
Oops, I forgot to take the sort model on top of the model into account.
Now everything should stay consistent - ListView order when accessed from
QML, but internal order when accessing the underlying array.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 09:02:00 -08:00
Dirk Hohndel
cd713d421b QML UI: update profile when editing duration of manually added dive
We need to make sure that a new fake DC is created after the duration was
changed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 06:28:00 -08:00
Dirk Hohndel
880f1c5644 QML UI: update the correct dive in the model when committing a change
When manually adding a dive and moving it in the dive list (by editing
it's start time) we could create a situation where the dive list
internally was correct, but the dive list model on screen showed an
incorrect dive list with the new dive in two different spots.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 04:52:44 -08:00
Dirk Hohndel
ce83357889 QML UI: after adding a dive, jump to it in the list
Don't do the slow motion scrolling through the list if we previously
showed a different dive in the list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 04:47:51 -08:00
Dirk Hohndel
3b37844708 Add helper functions to identify the position of a dive in the dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 04:46:26 -08:00
Dirk Hohndel
abab031ed2 QML UI: implement undelete
This code is very similar to the undo code in the desktop UI, but
untangling that from the desktop seemed massive overkill; we don't have
lists of dives to delete and undelete here - so this is actually much
simpler and easier to maintain (I hope).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29 15:42:33 -08:00