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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Instead of passing magic values around, calculate the columnWidth as part
of the SubsurfaceTheme object.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By giving them a fake profile we can actually edit the dive profile in the
desktop app.
Fixes#998Fixes#1000
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
Now the layout flows again and shouldn't cause clipping on the right
(unless the user has excessively long, unbreakable words it seems.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The way sectioning of the dive list works is by watching for different strings
in the section.property. In order to be able to tell different trips apart we
combine the address of the dive trip variable with the location (which will
create a new section for a new trip, even if the location text is the same) and
then strip that information out before showing the trip header.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I was having really ugly fonts here and I actually blamed
QML for that (while I still think it is it's fault), but we
where using pixel fractions. So every time we may hit a pixel
fraction, round that.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we are short on space on the mobile version, lets just show "Multiple" if
a dive has multiple cylinders.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Helper function that retrieved the total weight for a dive to be displayed
on the DiveDetials page.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Helper function that retrieves the cylinder description to be displayed in the
DiveDetails. Only the first cylinder for a dive is retrieved.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After adding "Cylinder" to the DiveDetails page the objects had to be rearranged
in order to better utilise the space.
To get a cleaner look on smaller screens the left side is left aligned and the
right side is right aligend.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Patch #2 that formats the table to be used for downloaded dives.
Signed-off-by: Willem Ferguson <willem@localhost.localdomain>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a proposal for the layout of this page and which may be
useful during further development of the download code.
Signed-off-by: Willem Ferguson <willem@localhost.localdomain>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I guess the Dive list item will be accessed more often
than the preferences item, so put it to to. Also remove
the "back to" prefix.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a multi-part message in MIME format.
After fixing the regression (commit 9e9d220c98) strange double dashes
appeared in the Divelist headers for trips. Just suppress it.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If one browses the application more than one step (e.g. details, gps fix
list and preferences), we need to pop the stack a bit more to get back
to the dive list. This will clear the whole stackView as I saw no harm
in discarding the history when one jumps back to the dive list.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Pressing of buttons were difficult to see mainly due to small buttons
and small color distance between pressed and un-pressed state. This fix
enlarges the buttons a little, and choses a different color for
the pressed state.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As asked for on the mailinglisrt, a menu item is added to return
to the Divelist the easy way. In addition to the standard Android
back button.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 6540e95425 ("dive details navigation") the change to access the gps
variable was only partially implemented.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this edit seems to work again. The edit page can be scrolled around on
smaller screens to allow editing every part of it and to allow the user to
press the "save" button.
This is mainly intended to make sure testing can continue - it's unclear if
this will be the final design.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We keep losing the time when people move code around. date really is just the
date and doesn't include the time component.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We were comparing apples to oranges on a few items and therefore more or less
always assumed that a dive had been modified.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If unit_system is set to imperial, we need to set the units explicitly
on mobile application.
Fixes#993
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>