Commit graph

270 commits

Author SHA1 Message Date
Dirk Hohndel
bb687f7f8b Remove plasma mobile components, pull from upstream at build time
This prevents us from constantly having to worry about keeping them in sync.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07 10:22:20 -08:00
Dirk Hohndel
9c0cb6cfef QML UI: edit notes in rich text mode
This way we don't show <br> for line breaks.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06 23:03:07 -08:00
Dirk Hohndel
5860913e41 QML UI: use the same units that Subsurface used when saving the data
We already keep those units around so the backend HTML exporter can match them.
So it makes perfect sense to also apply them in the mobile app.

Fixes #987

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06 21:58:02 -08:00
Dirk Hohndel
e5f95daee8 QML UI: reimplement context menu for dive details
With the mobile components fixed we can now simply switch between different
menu content - no need to play games and redefine the actions on the fly. This
also adds a cancel button for editing and cleans up when the user hits cancel.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06 18:21:09 -08:00
Dirk Hohndel
9a28807dd3 Make sure that members are initialied
A couple of members could potentially have been used uninitialized - it's
possible that this was the cause for people overwriting data in cloud storage
with empty dive lists.

See #985

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06 16:58:46 -08:00
Sebastian Kügler
cff0a703e8 sync with mobilecomponents 462b2b4
- Fixes blank pages when keyboard shows up, the margin computation was
  wrong, and apparently we get bogus info about the keyboard geometry.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-07 01:36:15 +01:00
Sebastian Kügler
95bca4b50c sync with mobilecomponents 9d179eb74a227
- Workaround for black squares is merged upstream
- brings back the FAB button, additional
- swipe interaction improvements in the same

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-07 00:39:33 +01:00
Dirk Hohndel
e20005ed36 QML UI: when manually adding a dive clear out all the fields
Otherwise the data from the last dive dispayed (or added) will be shown.

Fixes #983

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05 23:06:46 -08:00
Dirk Hohndel
4db5e840bf QML UI: refresh the dive list after edit
This fixes two issues. In general, after edits the dive list wasn't updated so
it showed data inconsistent with what the dive details showed (clearly bogus).
Even more annoyingly, when we change the date or time of a dive it could
obviously move around in the dive list. So we need to resort the dive table and
recreate the dive list. For really long dive lists this is possibly overkill,
but in my testing this seemed very quick and much easier than trying to
manually get this right, even in the case where the list wasn't resorted.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05 22:59:29 -08:00
Dirk Hohndel
e774c8077b QML UI: allow edit of dive date and time
This is a bit more complicated because we are asking the user to edit the text
field instead of giving them a date and time picker. This is not a great
choice, but let's run with it for now.

One downside is that the user is likely going to edit the date "Oct 29" -> "Oct
25" without adjusting the day of the week. And if we then try to parse that Qt
correctly complains about an invalid date. So we hack around this by removing
the day of the week from both the format and the date entered (which of course
now will break things if the user did, in fact, adjust the day of the week). As
I said, not a great solution.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05 22:53:32 -08:00
Dirk Hohndel
415536aba9 QML UI: in dive details edit, put date on its own line
This way we can support a simple way for the user to edit the date.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05 22:50:31 -08:00
Dirk Hohndel
e401e725cc Add BasicListItem.qml from plasma-mobile
Sebastian forgot to add this file - so I grabbed the latest version from
today, hoping this is the right one.

This is from a85365111 which is the sha he referenced in his patch.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05 21:26:20 -08:00
Sebastian Kügler
5d9881b8e1 adjustments needed for latest mobilecomponents
- flickable is gone, Page now just takes the children items, meaning we
  can remove this assignment
- BasicListItem is factored out, and we now need it in our qrc

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-06 04:44:26 +01:00
Sebastian Kügler
548d6fc956 sync with mobilecomponents a85365111 + patches
This is the latest state of the upstream art from Plasma, plus our
patches to disable the gamma effect on the icon, and the drawer removed.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-06 04:41:41 +01:00
Sebastian Kügler
8664925e20 Allow faster scrolling in the dive list
This increases the rather conservative value for the maximum velocity of
the divelist to scroll at max 5 screens per second, meaning it's about 4
times faster. I've picked this value after a bit of testing, it can
surely be tweaked, but feels nicer already.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-06 03:50:10 +01:00
Dirk Hohndel
a015e5f4cb QML UI: make top bar elements bigger for easier use
Otherwise hitting those menu buttons is HARD.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 21:38:44 -08:00
Dirk Hohndel
3bfa8de2f7 Cloud storage: fix potential crash when avoiding reloading dive list
If we loaded the dive list from cache and then try to figure out if the remote
repository had anything different, we were being super stupid if the SHA was
identical... we had already cleared the dive list by the time we decided that
we didn't need to load things. Granted, the model was still populated (oops),
but the backend data structure was cleared and accesses to it (e.g., when
drawing the profile) would cause things to crash.

The helper function duplicates some code, but trying to not duplicate the code
made things even harder to read.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 17:55:37 -08:00
Dirk Hohndel
72ce77a5ee QML UI: hide action button
So far this just comments out the code that enables the action button. Let's
see feedback from the testers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 13:15:33 -08:00
Dirk Hohndel
c53aa7dbfb QML UI: add context menu button
Right now this is an alternative to the magic action button - but the goal is
to replace it completely.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 13:02:46 -08:00
Dirk Hohndel
7cc851ebad QML UI: add main menu button
Right now this is an alternative to the magic action button - but the goal is
to replace it completely.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 13:02:46 -08:00
Miika Turkia
9cebcb836f Give the user more information on cloud credentials
This gives the user a bit more information about the progress of setting
the cloud credentials. IMO, especially the information that the
credentials are invalid is crucial for the user experience.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 10:00:44 -08:00
Rick Walsh
de46f2b37c QML UI: make profile margin scale proportional to dimensions
The QMLProfile height is specified as ~2/3 (actually 0.66) width in
DiveDetailsView.qml. In order to produce an even margin around the profile,
the scaling factor reduction for height needs to be 3/2 times that for width.

MarginFactor is specified as 0.013 to approximate the margin calculated by
commits ef653b4 and 7e2898d for my Galaxy S6.
MarginFactor	= margin  / width
		= 18 / 1365
		= 0.132

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 10:00:44 -08:00
Dirk Hohndel
e856f816f2 QML UI: use better Google maps link
This still isn't the user experience that I want, but at least now it's not a
static map image anymore but an interactive map.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 22:24:05 -08:00
Dirk Hohndel
fa338a26b8 QML UI: add feature to add current position when editing dive
This isn't quite perfect yet. If it takes too long to get the GPS fix (i.e., if
you save it before you get the fix), this will simply fail and not store a
position. But in normal conditions (you check the box, you edit the data, you
save), especially when outside on a dive boat, this should work fine.

For the other cases we need to implement some kind of callback to still collect
the data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 17:26:26 -08:00
Dirk Hohndel
87fc84a5ee QML UI: allow the user to close the Log
Same context menu idea. The reason for adding this is that the context menu
always acts on the last page in the stack (so I guess the "right-most-one"). So
if you edit a dive and then open the log, you can't save the dive until the
dive edit is the last page which means you have to close the log, first. Not
ideal, but better than nothing and it works well enough. I still think we might
want to go back to a traditional "Save" button...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 16:34:12 -08:00
Dirk Hohndel
fd23a4891c QML UI: consistency in naming
Let's try to call it Subsurface-mobile everywhere.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 09:34:32 -08:00
Dirk Hohndel
37c74b5c2f QML UI: update context menu text
The automagic update gets disabled once we overwrite the text with "Save" at
some point, so instead we appear to have to do this manually.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 09:31:51 -08:00
Dirk Hohndel
a0aa27e864 QML UI: handle editing of depth
Getting closer to being able to really edit / add dives in the mobile UI.
This works for manually added dives - needs a bit more thought for dives
downloaded from dive computers as we don't necessarily want to change the
maxdepth in conflict with the samples.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 00:55:34 -08:00
Dirk Hohndel
2c28b16b26 QML UI: handle editing of duration
I don't think these regular expressions are sufficiently exhaustive - but this
is forward progress.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 00:55:25 -08:00
Dirk Hohndel
7f628404e6 QML UI: refresh UI after editing / adding a dive
This way the properties of the shown list element are updated based on what was
edited. This feels weird and backwards - but it appears to be the way to do
this - you literally update the elemnts in this specific instance of that QML
page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-31 18:16:47 -08:00
Dirk Hohndel
b84308bcfb QML UI: we don't need those semicolons
The code is rather inconsistent when it comes to the use of semicolons in the
JS code. Let's try to not have them...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-31 18:16:47 -08:00
Dirk Hohndel
da5d904d34 QML UI: process air and water temp when edited
This is a little hacky as it changes the units based on user input - a little
crude but works in the typical cases.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-31 18:16:46 -08:00
Rick Walsh
7f22984d18 QML UI: scale profile in two stages
Scale the QML profile in two stages.  Firstly, scale to fit.  Secondly, scale
again to 95% to create a margin around the profile.

The previous method scales to fit a create a margin in one step.  It appears
more elegant, and the margin is calculated more rationally.  Unfortunately on
some devices, including mine, the resulting profile is cropped for no obvious
reason.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-30 07:26:02 -08:00
Rick Walsh
2cce4ec3a4 Mobile CloudCredentials: hide password on entry
Don't use EmailCharactersOnly input method hint for the password. This fixes
the problem of password being displayed on entry, at least on my device.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-30 07:25:31 -08:00
Dirk Hohndel
f3065230a3 QML UI: add information about build time / run time Qt version
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-29 17:29:46 -08:00
Dirk Hohndel
7e2898dfde QML UI: scale profile to allow for some visible separation
That small margin makes things look much better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-29 09:52:27 -08:00
Dirk Hohndel
87f1301f50 QML UI: draw the profile anti aliased
This seems to look much better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-29 09:51:34 -08:00
Dirk Hohndel
ef653b41f5 QML UI: obtain a reasonable margin from QML
This will be used later in the positioning of the profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-29 09:50:47 -08:00
Dirk Hohndel
9df3835035 QML-UI: switch profile widget into print mode
We don't need any of the interactive features. Additionally this allows us to
easily ask for slightly smaller fonts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-29 07:15:52 -08:00
Dirk Hohndel
fcc615a497 QML UI: try to remove two binding loops
Let's face it. I have no idea what I'm doing here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-27 12:28:08 -08:00
Dirk Hohndel
81999e4667 QML UI: add debug output for echoMode
For some users by default the password characters aren't hidden. Maybe the
debugging output will help us understand what's going on.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-27 12:20:36 -08:00
Dirk Hohndel
97c23d6ee5 QML UI: cloud credential input: use text input hints
We shouldn't auto-capitalize and the text should only be email address
characters.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-27 12:19:51 -08:00
Dirk Hohndel
bbcc6fb3c2 QML UI: if remote is same as local cache, don't load / process remote
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-27 10:06:33 -08:00
Dirk Hohndel
739d7d74e7 QML UI: load from cache before trying to sync with the cloud server
This is a simple way to deal with a "no network" situation. But this isn't
ideal, yet, if there is a slow network as the dive list will be reset again
once the sync from the cloud finishes. So there is some more thought needed to
make this work "mostly as expected".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-27 10:06:33 -08:00
Dirk Hohndel
99a5a743c4 QML UI: change the way we extract input data from dive edit
Instead of doing the silly "onEditingFinished" we get the strings from the QML
components at the time we commit the change. Much more logical, much more
straight forward, no issues with the TextArea not having an onEditingFinished
signal.

This still has a few open todos: the temperatures aren't parsed, the edit
screen is missing depth and duration, we can't edit the dive time (and it isn't
passed in on the commit). But it's progress.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 22:57:47 -08:00
Dirk Hohndel
9be42fff81 QML UI: correct text for context drawer when adding dive
This needs to say "Save" to indicate that you are saving the data that was
entered.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 21:56:45 -08:00
Dirk Hohndel
0962b504ce QML UI: get add dive closer to being useful
Now we at least start out with the corret date, time and number. This still
isn't functional as a lot of the data aren't used and the way you save the data
is completely silly, but it's another step in the right direction.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 21:37:18 -08:00
Dirk Hohndel
dce3869339 QML UI: don't crash when committing changes and unable to find the dive
This mainly happens because add dive is completely broken right now, but in
general it seems to be good policy not to blindly dereference this pointer...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 21:24:29 -08:00
Dirk Hohndel
ce2b910cdb Two more helper functions for the QML manager
I'm not sure this is the best way to do this - QML should be able to get to the
model data directly (I hope?). But this seems to work and I need it to make Add
Dive be semi-correct.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 20:02:23 -08:00
Dirk Hohndel
763986b683 QML UI: when adding a dive, start in edit mode
Obviously we don't want to "view" a new dive, we want to "edit" it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 17:06:52 -08:00