Commit graph

481 commits

Author SHA1 Message Date
Dirk Hohndel
0b0e56edeb After freeing the samples, clear the pointer
Otherwise we might end up trying to free them a second time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20 07:39:25 -08:00
Dirk Hohndel
5fc16910c2 QML UI: fix recreation of profile after dive edit
We only need to deal with this if the dive changed. And in that case, if
we calculate a new fake DC, we need to clear out the meandepth as
otherwise the algorithm will try to match both max and mean depth. Since
the user potentially changed the max depth that could have very odd
consequences.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20 07:33:05 -08:00
Dirk Hohndel
97d6a1e779 QML UI: no longer change unit preferences when parsing edits
When the user explicitly sets the units when editing or adding dives, we
used to change the display preferences. This was changed for some but not
all fields in commit 6252d0cd3b ("While parsing weight and pressure we
should not change the users settings")

Now we do this consistently for all inputs.

Also, when editing the depth of a manually added dive, we now throw away
the samples (as those are certain to be inconsistent).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-15 07:54:35 -08:00
Dirk Hohndel
bbbd479914 QML UI: better text when no profile is shown for a dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-15 07:27:00 -08:00
Dirk Hohndel
a3189a9b3e QML UI: don't show an odd profile for zero duration dive
A dive with zero duration creates an odd profile that is 2min 30seconds
long and looks just weird. Instead, simply show a text that there is on
profile shown for such a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-14 16:27:41 -08:00
Dirk Hohndel
58f014728c Remove debug output
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-14 16:08:50 -08:00
Dirk Hohndel
c97ed010c7 QML UI: back key on dive list exits the app
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-14 12:17:24 -08:00
Dirk Hohndel
f2c8aed07b QML UI: when canceling a dive add, go back to dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 23:54:40 -08:00
Dirk Hohndel
3413dfc3aa QML UI: simplify and correct top bar layout
Now things are centered and reasonably well spaced

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 23:44:59 -08:00
Dirk Hohndel
e4d27f27f0 QML UI: remove disabled parts of the top bar
I guess we are going with the Plasma Mobile influenced design after all

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 23:29:42 -08:00
Dirk Hohndel
464d468b75 QML UI: better margins for start page
This way it doesn't look like it's stuck in the corner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 23:28:06 -08:00
Dirk Hohndel
55eb4160da Fix incorrect reference to endEditMode()
Not sure how that slipped through the cracks.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 21:53:01 -08:00
Dirk Hohndel
da5be2249d QML UI: use action button for save in GPS preferences
For consistency

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 21:50:31 -08:00
Dirk Hohndel
23b877a869 QML UI: don't change dive while editing
If the user taps on a dive in the dive list while a dive is being edited
or added, ignore that tap.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 21:28:32 -08:00
Dirk Hohndel
0ce1dd80cc QML UI: change the dive add/edit action button to be save
Remove the button on the page and instead use the action button to save
and the back key to cancel.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 21:25:10 -08:00
Dirk Hohndel
5952b09b51 QML UI: use action button and Android back button to save / go back
This is more consistent with the rest of our UI

To make this work you once again need changes to the mobile components
that aren't upstream, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 21:10:51 -08:00
Joakim Bygdell
ae116c5bc8 QML UI: enable edit of gasmix
First cylinder only, show warning if there are more than one cylinder defined.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 10:04:05 -08:00
Joakim Bygdell
6252d0cd3b While parsing weight and pressure we should not change the users settings.
Now it is possible to enter a specific unit that is different from the
unit stored in the preferences. If only numbers are inputed the unit will
be the same as specified by the users preferences.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 10:03:50 -08:00
Dirk Hohndel
a91d4164b4 QML UI: remove the redundant context menus that just close the page
Android users are well used to using the back key for this. I kept the
code in place as things may end up completely different on IOS or other
mobile platforms.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 22:26:47 -08:00
Dirk Hohndel
692719f230 QML UI: when saving edits, really only save them locally
This should have been obvious. Without explicitly asking for only local
git activity, it will connect to the remote.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 22:14:17 -08:00
Dirk Hohndel
e5e5ab7480 QML UI: don't even try to connect if email or password are empty
This way the user gets better messages on the screen.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 22:06:38 -08:00
Dirk Hohndel
afb57bf741 Add missing import
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 17:26:26 -08:00
Dirk Hohndel
1f5cf4b42d QML UI: more progress update on start page
Again, to help track down where things hang.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 12:17:47 -08:00
Dirk Hohndel
45b0554a67 QML UI: add context menu to Theme Test
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 12:17:43 -08:00
Dirk Hohndel
d9d1b58e6a QML UI: experimentally enable context menu on each page
This is necessary to allow all user interaction when removing action
buttons from the top bar.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 09:56:27 -08:00
Dirk Hohndel
a738174a45 QML UI: experimentally turn off all the top bar buttons
This allows us to shrink the top bar quite a bit and have a little more
screen real estate. In order to maintain functionality we need to reenable
the context menu on some screens.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 09:56:20 -08:00
Dirk Hohndel
093c5fa5ff QML UI: more progress information on the start page
Since some users report hangs when changing credentials it would be useful
to see how far the application got.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12 06:54:52 -08:00
Dirk Hohndel
f925711185 QML UI: clear up more data when changing credentials
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 22:46:35 -08:00
Dirk Hohndel
d877e13e0a QML UI: even with valid credentials, don't show empty dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 22:46:00 -08:00
Dirk Hohndel
dbc96b1db3 QML-UI: allow dive list to be pulled up above Action Button
This way you can fully interact with it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 12:43:32 -08:00
Dirk Hohndel
e189433a5d QML UI: calculate correct height for the cloud credentials
It still complains about a binding loop but I don't quite understand why
and how...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 10:04:44 -08:00
Dirk Hohndel
9bebef59d8 QML UI: remove unnecessary outer item from start page
This changes nothing except for removing the item and reindenting the
code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 10:04:44 -08:00
Dirk Hohndel
5f8591e845 QML UI: try to get correct height for start page
Still not quite correct.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 10:04:44 -08:00
Dirk Hohndel
d719ef3a70 QML UI: make the start page scrollable
This doesn't quite work yet as the start page appears to miscalculate its
height (the cloud credentials page appears to be missing).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 10:04:44 -08:00
Dirk Hohndel
672b11d804 QML UI: redesign the About page
Make things centered, lay them out correctly, make sure the image fits.

This includes the re-indentation of the previous commit - but the changes
are so massive that it seemed pointless to do this as its own commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 10:04:44 -08:00
Dirk Hohndel
839cda7e4c QML UI: close About page on back key
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 10:04:44 -08:00
Dirk Hohndel
f0a24240f1 QML UI: cloud credentials: put the two buttons side by side
That looks better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-11 10:04:44 -08:00
Dirk Hohndel
36b089dc8c QML UI: close all other pages when switching cloud credentials
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 21:47:09 -08:00
Dirk Hohndel
5e3b2741ac Invalidate the remembered git SHA when changing credentials
Otherwise, when switching back and forth between two logins, during the
second switch the dive list is not loaded as the code checks against the
remembered git SHA before rewriting the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 21:24:10 -08:00
Dirk Hohndel
06628e03c5 QML UI: disable some menu entries without valid credentials
This requires a patch to the mobile components that isn't upstream, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 21:08:44 -08:00
Dirk Hohndel
9d131807d7 Reset the authentication cache when trying new credentials
Otherwise Qt attempts to be smart and re-uses previously successful
username (email) and password. This is an odd corner case, but it seems
the right thing to do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 21:08:20 -08:00
Dirk Hohndel
38f7fd6fbe QML UI: allow changing credentials
With the integration of the credentials into the start page the logic for
this has changed.
Since the code for start page and dive list is actually on the same page,
using opacity to switch between the two sub pages (depending on whether we
have valid credentials and dives to show), the old way of changing
credentials no longer worked.
With theis patch the user once again can change their credentials (and
change their mind and go back to the dive list).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 21:05:23 -08:00
Dirk Hohndel
e26e50f2e4 Better tracking of the status of the credentials
There are several parts of the UI that will do better if they know if the
credentials that we have are incomplete (e.g., no password), invalid
(server rejected them), valid (server accepted them) or potentially valid
(we found a local cache for the email address, so that's likely correct,
but because we are offline we cannot (or have not yet) verify the
passord).

So far this is specific for the mobile UI - it might make sense to try and
use the same backend code and status tracking for desktop and mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 21:00:43 -08:00
Dirk Hohndel
b7e353b7f6 QML UI: more accurate messages on the start page
Now the text shown better reflects what's going on, especially when the
credentials are invalid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 21:00:21 -08:00
Dirk Hohndel
6829d10086 Indentation fix after the last commit
For the ThemeTest we could simply drop the item, for the GPS preferences
and the DowbloadFromDiveComputer page everything got indented by one
level.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 20:59:34 -08:00
Dirk Hohndel
ab36a3dad1 QML UI: make back key work for all pages
Reported by a beta tester for the GPS preferences, but affects a couple
more. We need to make sure that any page on the page stack is actually a
MobileComponents.Page, other wise the Android back key doesn't close the
page.

This commit changes GPS preferences, the theme test, and the currently
disabled download from divecomputer. it contains only the actual change
(wrap the current content in a page). The reindentation is a separate
commit for readability.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 20:58:11 -08:00
Dirk Hohndel
82a982b903 QML UI: redo the start page
It now explains the relationship between Subsurface-mobile and the desktop
application and allows the user to enter the cloud credentials right
there.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 20:57:11 -08:00
Dirk Hohndel
ffd449cf21 QML UI: make cloud credentials usable as a component on a page
Instead of using this on its own page, it makes more sense to use it as
part of the start page directly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 20:56:38 -08:00
Rick Walsh
70a122a63e QML UI: make flicking between dives faster
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 15:16:18 -08:00
Miika Turkia
c41bdcfbe3 Adding about page to Subsurface-mobile
This isn't pretty, but having the version string available on a place
that people are likely to find does make sense when going public with
the Subsurface-mobile. Especially when we do a public release, I assume
the developer menu with App log might not be readily available for
people to identify their installed version.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 15:16:12 -08:00
Miika Turkia
3bdaf00546 Support function to print version string
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10 15:16:09 -08:00
Joakim Bygdell
8566523b43 QML UI: dive edit, treat numeric input of duration as full minutes
When editing the duration of a dive, if only numbers are entered they are
treated as full miuntes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 13:05:21 -08:00
Henrik Brautaset Aronsen
0eebfb284e QML UI: Fix lingering edit mode
A dive would linger in edit mode when following these steps:

start mobile. show theme info. click on dive in dive list.
click edit. click back in topbar, again click back in the topbar.
click on dive in dive list, still in edit mode.

Not anymore. Also enable back button when viewing a dive.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 13:05:05 -08:00
Henrik Brautaset Aronsen
37438e28d2 QML UI: Remove unused onClicked event for back button
I don't know how this got here.  Probably having fun
with copy and paste.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 12:31:41 -08:00
Henrik Brautaset Aronsen
98dfc5c770 QML UI: Back buttons for app log and theme info
The app log and theme info had context menus
with a single close item. No need for that.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 12:11:38 -08:00
Joakim Bygdell
8c9883cfcf QML UI: enable edit of cylinder pressures
First cylinder only, show warning if there are more than one cylinder defined.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 12:11:09 -08:00
Dirk Hohndel
87f62dfaa8 QML UI: load from cache first when changing cloud credentials
We need to execute the same sequence of steps both when starting the app
and when switching cloud credentials. This way things will work correctly
when the device is offline and the user wants to switch accounts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 07:53:22 -08:00
Dirk Hohndel
0cc9ad0619 QML UI: draw edit/back button next to context menu button if it's shown
Without this they were all anchored to parent.right and would be rendered
on top of each other.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 06:34:14 -08:00
Dirk Hohndel
0f6b8a8f6f QML UI: DiveDetailsView - calculate better width and set everywhere
Even setting things up in the first row isn't enough. Every field in the
grid needs an explicit width. How dumb is that.

To make this more manageable calculate the correct widths at the beginning
and then just reference those properties.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 13:25:29 -08:00
Dirk Hohndel
3e46361518 QML UI: DiveDetailsView - set fixed column widths
In order for wrapping to work, the Text and TextEdit elements need to have
a defined width. Normally the GridLayout is supposed to be able to figure
out optimal widths for the different colums if you tell it which ones
should stretch, but that has repeatedly caused infinite loops and crashes
in the layout engine.

For now, in order to get both wrapping (and therefore no clipping of the
content) and avoid crashes, we hard code the width of the four columns by
setting Layout.maxWidth for each element in the first row of the grid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 12:44:01 -08:00
Dirk Hohndel
c6a844fbad QML UI: DiveDetailsView - reorder the grid
Let's put the three likely rather narrow items above each other in the
right column and the others (especially the three that could run long:
suit, buddy, dive master) in the left one.

Also, make the individual entries more consistent in which attributes are
set in which order - easier to read.

Finally, make sure that all grid elements enable wrapping.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 12:43:28 -08:00
Dirk Hohndel
10ca667403 Sync load from cloud status when changing cloud storage accounts
Since this variable is specific to the cloud credentials in use, we need
to reset it when we change credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 11:14:11 -08:00
Dirk Hohndel
801ce01585 Always sync with cloud server when updating backend data
It makes no sense to only do this the very first time we connect to a
cloud storage account. The existing code only happened to work because we
incorrectly tried to maintain the loadFromCloud status across restarts of
the application. So one bug hid another bug.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 11:12:43 -08:00
Dirk Hohndel
c1b3de6190 Remember status of specific cloud account in settings
What matters is that the cloud storage for a specific email address has
successfully been synced - and we need to remember this across restarts of
the app. This way Subsurface-mobile can work with different accounts, even
if offline.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 11:10:21 -08:00
Dirk Hohndel
d43a2c032b QML UI: correctly handle back key on edits
This requires mobile components that include commit 03c868fc57e5 from
earlier today. With this a single press on the back key cancels the edit
and a second press on the back key brings you up one level in the page
stack (usually back to the dive list).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 08:41:42 -08:00
Miika Turkia
d97ae62c75 Move preferences under GPS menu
Since we currently only have preferences that affect the GPS
functionality, it might be more logical to have the preferences under
GPS menu.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 08:00:27 -08:00
Henrik Brautaset Aronsen
8eb019456d Avoid QtCreator warning about ==
Warning M126: == and != may perform type coercion, use === or !== to avoid it

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 13:57:02 -08:00
Henrik Brautaset Aronsen
47403588e5 Move endEditMode() to DiveDetails.qml
Having endEditMode() in main.qml seemed wrong somehow.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 13:56:46 -08:00
Henrik Brautaset Aronsen
d976310094 Add top-right edit and back buttons for mobile
Adds a back button in edit mode, and an edit button for view mode.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 13:56:07 -08:00
Dirk Hohndel
e174389618 QML UI: another attempt to fix the random crashes
I finally was able to reproduce the crashes with the infinite recursion when
computing a GridLayout.

This seems to be triggered by competing Layout.fillWidth settings that the
layout engine couldn't figure out how to accomodate.

I did three things to make this work better:

- explicitly grab the columnWidth for the width of the DiveDetailsView.
- split the GridLayout in two so the area above and below the profile are no
  longer forced to fit in the same column widths.
- remove most of the Layout.fillWidth settings and only leave a couple that
  seem sufficient to get reasonable on screen layout in my experiments.

Here's hoping that this one is finally resolved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 12:45:36 -08:00
Dirk Hohndel
d8d9301e8e QML UI: disable download from divecomputer button on start page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 10:09:06 -08:00
Dirk Hohndel
ad72d437a3 Revert "QML UI: end edit mode when leaving the edit page"
This reverts commit d2928a137c.

The presence of this Action causes crashes for one of the testers. Which
is utterly ridiculous.
2016-02-07 07:32:08 -08:00
Dirk Hohndel
d2928a137c QML UI: end edit mode when leaving the edit page
This should fix the problem when using the back key to exit the edit page.
Requires a patch to the mobile components that isn't upstream, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06 12:08:16 -08:00
Dirk Hohndel
6d8d956853 QML UI: make time parsing more lenient
White space between numbers and units should be ignored.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06 12:07:42 -08:00
Dirk Hohndel
a4ec520601 QML UI: enable editing of weight
But only if there is only one weight system defined in the dive. Otherwise
display a read only text that explains that this cannot be edited.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 22:54:47 -08:00
Dirk Hohndel
7f70802b90 QML UI: explicitly hide the keyboard when exiting dive edit
If you save or cancel the dive edit, the keyboard should be closed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 10:49:43 -08:00
Dirk Hohndel
48695cda7c QML UI: disable download from divecomputer
This is not hooked up, yet, and would likely only confuse potential
testers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 09:22:54 -08:00
Willem Ferguson
545b106d5c Mobile. Modify DownloadFromDiveComputer.qml
1) Create space for sillybutton at bottom of screen
        2) Reformat columns in tableview
        3) General cleanup and simplification of code.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03 10:50:00 -08:00
Rick Walsh
fdd5ee507c QML UI: Another attempt to shift dive number to top row
Commit 1030cb265a 'QML UI DiveDetailsView: shift
dive number to right of top row' was reverted because it caused mysterious
crashes for some testers, inferred to be related to sizing items in a
gridLayout.

This patch brings the dive number back up to the right of the top row, so the
page width doesn't exceed the screen width. Using text wrapping should prevent
the date text and dive number items from increasing in width, and hopefully
avoids the mysterious crashes.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01 17:52:20 -08:00
Dirk Hohndel
cba50ece33 Revert "QML UI DiveDetailsView: shift dive number to right of top row"
This reverts commit 1030cb265a.

Simply trying to find out if this is the cause for the odd crashes one
tester is seeing.
2016-01-31 11:27:13 -08:00
Dirk Hohndel
a1aa83fcfd Minor cleanups
Improve readability of the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 10:17:22 -08:00
Dirk Hohndel
0eae59bcd2 QML UI: introduce "add" state and correctly clean up when canceled
Adding a dive is just like editing it, except that canceling the operation
has different consequences. Instead of trying to figure this out by some
inference on other state, let's just make it explicit and then clean up
after ourselves if the user canceled a manual dive add.

This also switches to use the properties that we defined in order for the
main menu to be able to setup these values. Makes the code easier to read
and is more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 07:50:45 -08:00
Dirk Hohndel
9f7ecbb53e Add helper to remove dive from model
I tried various things to do this from QML but it just doesn't seem to
work at all. So I gave up and instead added a trivial helper function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 07:50:38 -08:00
Dirk Hohndel
957f03f2a4 QML UI: remove apparently obsolete code
I couldn't make sense of either the code nor the comment, so I tried what
broke when I removed it. Nothing that I could find. So maybe we don't need
this after all?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 07:40:12 -08:00
Dirk Hohndel
ba4bb56701 QML UI: better way to determine dive details edit width
Instead of passing magic values around, calculate the columnWidth as part
of the SubsurfaceTheme object.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 22:49:46 -08:00
Dirk Hohndel
66b08f53f2 QML UI: make manually added dives more like those added on desktop
By giving them a fake profile we can actually edit the dive profile in the
desktop app.

Fixes #998
Fixes #1000

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 22:09:40 -08:00
Dirk Hohndel
ff2f6d4082 QML UI: once again hide "--" as section header
The fix for correctly showing multiple trips with the same location text
inadvertantly broke the detection of empty location text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 21:58:27 -08:00
Dirk Hohndel
6dd3e4c30e QML UI: use the new helper to ensure the right dive is selected after edit
There are two cases where this is important
- when running Manually add dive which may add a dive in the middle of the
  dive list
- when editing the date and time of a dive which may move it around in the
  dive list

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
dbe9bad0aa QML UI: add the properties needed to be able to manually add dive
This way the trigger from the main drawer works again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
034ffa229b QML UI: add field to edit the total weight
This isn't hooked up to anything, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
bac39b5482 Better id for yet another QML item
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
c52769a90f QML UI: use unique names for the different ListViews
Having both the dive list (the vertical list) and the sequence of dive
details (the horizontally swipe-able list) named the same caused me
endless confusion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:20:15 -08:00
Dirk Hohndel
106bb07cff QML UI: clear out empty strings from the UI
Right now the UI shows "--" as place filler for empty data. That may or
may not change - but while it's there, we should not store that string in
the corresponding string fields of the dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 14:07:27 -08:00
Dirk Hohndel
30a4fb2274 Avoid uninitialized memory access
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 09:02:20 -08:00
Dirk Hohndel
8813f13bfd QML UI: end edit mode when switching to different page
Fixes #997

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 19:05:13 -08:00
Dirk Hohndel
bda0b01216 QML UI: avoid clearing and rebuilding the dive list model
This causes all profiles to be rendered which is a massive performance
concern.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 15:11:37 -08:00
Dirk Hohndel
e895374e4b QML UI: fix Qt's broken handling of two digit years in dates
Because dives in 1912 are unlikely to be added to my dive log...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 15:07:10 -08:00
Joakim Bygdell
9342dedb26 Move helper function to DiveObjectsHelper
As per Tomaz recomendation the helper functions from 19588ce and e072596
are moved from qmlmanager to DiveObjectsHelper.

[Dirk Hohndel: merged with the latest code]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 11:18:44 -08:00
Dirk Hohndel
4abe73ff2a QML UI: on edit only request location if user checks the box
The code inexplicably always checked for a gps location. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 10:16:25 -08:00
Dirk Hohndel
a74175324a QML UI: fix precision of total weight displayed
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27 10:16:25 -08:00