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>
It's not recommended to set the height explicitly of an item in a layout. Use
Layout.preferredHeight instead
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit f3f7930 introduced a more attractive button style to the start page.
This patch turns it into its own type so it can easily be used everywhere.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It is not recommended to set the width explicitly of items in a layout. This
caused some issues in DiveDetailsView, which were fixed by commit 1030cb2.
See http://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#details
Set 'Layout.preferredWidth' instead of 'width' for GpsList and Preferences
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I want a prettier visual for those, anyway, but artificially making them
shorter than that text they display seems silly - and causes the text to be
trunkated for no good reason on some devices.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on post by Ben Laud
https://medium.com/@benlaud/complete-guide-to-make-a-splash-screen-for-your-qml-android-application-567ca3bc70af
It creates a theme that uses a splash drawable that Android will show
immediately when the application is launched. And then starts the QML
application with visibility set to false adn only makes it visible (and replace
the splash screen) once initialization is finished.
We still get a little flicker with the switch from splash to start page to dive
list, but over all the experience is hugely improved. And the bug that the
splash screen stays around when starting Subsurface-mobile in landscape also
appears to be fixed.
Fixes#994
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In dive details view, shifting the dive number to the right of the top row
means it won't be cut short if the dive duration is 1 hr or longer
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This one appears to work in my testing so far. And reading the code it
seems to make sense. We look at the size that the widget thinks it is. And
we scale the scene to fill that size (including a margin). And then let Qt
and QML deal with the rest of it. Assuming this works it shows that we
have been trying too hard all this time.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Different approach here:
- profile gets a bit higher, this was requested on the mailinglist, and
seems to behave much better with the painted profile, we'd otherwise
get it magically clipped on the right hand side.
- Make the scaling dpi aware, this fixes scaling for me on the Nexus7, I
haven't been able to test it properly on other devices, so this needs
some more testing. The result is visually quite close to what we can
do, although I'm still getting a somewhat larger margin on the right.
To get at the devicePixelRatio without too much custom code, I've
added a property to the QMLProfile to retrieve it from the theme engine.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Apparently, QMLProfile doesn't like being painted without being
visible, when flicking quickly through the dives I would get empty
rendered profiles. Setting the cachebuffer to zero fixes it, and saves
some memory.
It still has some unfortunate timing, the profile gets rendered
mid-flick, which leads to a delay in the flicking motion, quite
annoying. We will have to somehow make sure that new profiles are
rendered after flicking, not during
- Smallish cleanups
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- stop at bounds, this is in line with other flickables. I really
don't like Flickables floppy default behavior to allow dragging and
scrolling over the bounds.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- As the list may get reset on save, the dive_id effectively changes
since currentItem isn't updated. So after editing, we end up with a
different currentItem than visible. This is very unintuitive, but
has to do with the model resetting. It would result in the edit view not
showing the current dive when opened the second time. Let's make sure
that out currentItem is always the visible one before we're filling
the data into the edit page.
- Close the drawer when we're navigating away from the dive item, for
example when hitting the back button.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This patch reworks the navigation of the dive details.
- The detailsview is now a list view with page-sized delegates. This
allows horizontal swiping to the next and previous dive.
- The central button now allows to open the edit mode for the dive.
Original patch was done by Marco Martin, but needed to be reapplied by
hand.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
In commit 25aa80846b ("Move Dive class from qthelper.h/cpp to it's own file")
the meaning of getting the "date" of a dive was changed to just be the date and
not the date and time. That's not what the QML code expected.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While it makes sense to have the concept of "what's in memory" and "what's on
disk" in a desktop application, on a mobile device that seems like the wrong
approach. If the user edits a dive and taps on "save", they reasonably expect
this to be saved to storage (so our local cache of the remote git repository).
And "Upload to cloud" then pushes the data to the cloud server. It may even be
reasonable to do that automagically, but that I'm not so sure about.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise, if the device is offline we would not be able to store changes in
the local cache, completely defeating the purpose.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small error was introduced in commit 25aa80846b. The dive.location was
shown in the DiveList instead of the intended dive.number
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This only deletes the fix on the mobile device, not on the server.
And it is really really slow. Re-reading the data from the settings just isn't
a smart way to do this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Just having the string means we lost the unique value that we can use as key to
indentify a specific GPS fix.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is just the UI, the actual deletion is not yet implemented.
I really like this interaction with the list items. Slide them to the left and
you see icons for actions. Right now we have just one and that may seem like
overkill (hey, we could just have the delete icon instead of the application
menu icon, right?) but once we allow the ability to show the GPS location on a
map we'll have two operations and this will make more sense.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
and rename it to DiveObjectHelper, since it should be an QObject
based class to make it easier on the QML, grantlee and widgets
side to display the dive's internal data.
each Q_PROPERTY defined in the DiveObjectHelper.h file
can be acessed directly via it's name.
So, if you are on a model that returns a dive, acess it's name
by dive.name
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
with the adittion of gpslistmodel/location, the libraries
qt-models had a direct dependency on subsurface-core, and
subsurface-core had a direct dependency on qt-models, this is
bad.
Moving a bit of code around I'v managed to clean this out, and
also to clear a bit of uneeded code (GpsTracker and gpsTracker where
basically the same thing.)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When starting ssrf-mobile, and the local divelist is identical to the
cloud version (so same sha1), a save of local modifications to the
cloud should be possible. This fix enables this by pretending
that a suppressed load from cloud on start is still a valid load
from cloud.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This had been broken by mistake in commit e5f95daee8 ("QML UI: reimplement
context menu for dive details").
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far the user can't interact with these. We should implement an ability to
visualize the GPS fix and to delete it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
- 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>
- 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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
In the dive detail view, if a location has an associated GPS location, show the
name of the location underlined so the user knows that tapping on it will open
a browser window with a map picture.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is of course stupid and NOT what we want to do, but one could argue it's
better than nothing (well, not sure, whatever). If we have a GPS location
associated with a dive and you tap on the location name when showing the dive
details, it opens a static image of a satellite map with a marker for the dive
site.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This still doesn't address all the issues, but appears to be a step
forward. It also contains some debug output to better understand what's
going on.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It appears that one some Android devices there is an interaction between
Qt and the GL implementation that results in black squares instead of
icons being shown on the screen.
Disabling the GammaAdjust avoids running the shader and fixes this
problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
At least one tester cannot retrieve their web user id. This should help us
collect more data and figure out why this fails.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now the message should make more sense. First it tells you that it's looking
for dives. Then you get some progress during the git download, and error
messages if things failed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So this has a lot of caveats:
- right now it only works for buddy, divemaster and suit
- you have to actually exit the field with your cursor or the change
doesn't take - that's ridiculous, there must be a far more clever way to
do this
- because I use the onEditingFinished handler I can't do this for the
Notes (so here's another reason why I KNOW that this is the wrong way to
do this)
But it shows in principle how this could be done and once someone who
actually knows what they are doing gets their hands on the code I'm
optimistic that this can be morphed into something much more useful.
It does tie together the changes made in the previous commits so that both
clicking around on the dive list gives the expected results and synching
the data back to the cloud actually works.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Well, at least it doesn't what you think it does. Let's use our little
helper to actually compare the strings.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
File is unused, apparently a left-over from a rename. It's not included
in the qrc and referenced nowhere, so it's safe to delete.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- page margins are gridUnit / 2, consistent with other pages
- Simplify layout: we don't need to nest that much here, saves two
objects and simplifies code a bit
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This patch creates the following menu structure in the application menu
as discussed on irc:
Cloud credentials
Preferences
Manage dives
Download from computer
Add dive manually
Refresh dives
Upload to cloud
GPS
Add GPS tags to dives
Upload GPS data
Clear GPS cache
Advanced (hidden by default)
App log
Theme Information
"Save" moves out of the context menu, since it's a global thing (syncs
to server).
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Spacing around pages is half a grid unit, as consistent with (some of
the) other pages. For the dive list, it's slightly more complicated:
We want the list items to reach the edges on both side as to increase
the interactive area. We have to apply the spacing left and right inside
the listitems. This patch does that.
Another consistency fix with other pages is that we're now adding a
header at the top of the dive list, which scrolles with the list view.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Apparently, the width setting got lost in the previous change. This sets
the width of the log text explicitely to the grandparent's width. It
fixes text clipping in the log window.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This change cleans up the layout optimized for viewing dive details. The
top part contains brief and essential dive info (location, depth,
duration, dive no.), then the profile, then a table with more details,
and finally the notes.
The goal here is to present the dive's data more efficiently and
attractively now that the edit part is factored out.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Icons for document-edit, document-save and view-readermode are added
from the light breeze variant. They're usd in the dive's contextual
actions.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Option to switch between view and edit and to save the changes are now
in the context drawer. Let's see how this works out.
If it turns out to be badly discoverable (which is what I'm worried
about), this needs to be fixed at component level.
This item can be dragged in from the right hand side and provides
contextual actions for a page. It will be used in the dive details edit.
If there are actions, the floating button on the bottom shows an arrow
indicating that one can drag it in from the right hand side to the left.
Also clean up a bit of a noisy print that's not needed anymore.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This splits the dive detail page into two modes: view and edit
- The edit part loses the profile (it's not editable anyway)
- The view part gets a new layout, friendlier for viewing
- Properties for diveNumber, duration, depth and weight are added
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This is the first part of splitting the dive details into edit/view
modes.
- introduce a state machine to switch between view and edit mode
- factor out the editor into its own component
Both components are almost the same, but we can change them individually
now.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- Fixes interactivity in context drawer.
- These are mostly cleanups that have been done pre-merge of these
components. This now is the state of master in plasma-mobile.
- makes navigation a bit more intuitive
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Bit nicer layout so my eyes don't insta-bleed when checking this page.
Also add information about the size of the rootItem, that's really
useful to know what kind of constraints we're dealing with.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
For consistency. Still not sure what the best scheme is. QtCreator wants to be
pretty aggressive with how far things are indented. Not sure I'm in love with
that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We only need this once and having it at the bottom of the menu with the
indicator whether it's on or not is much nicer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I hoped that this would show the "email keyboard" on Android that includes the
'@' sign without having to switch layers but that didn't seem to work. I'll
leave this here, anyway, as it seems like the right thing to do since this
input field is indeed for an email address.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We really need to verify that the credentials are valid before trying to access
our backend resources. Trying to do so in a clean manner caused quite a bit of
changes to how we retrieve the webservice userid and how we load the dive list
from cloud storage.
So instead of accessing the network resources directly, this adds a handler
function that first checks the validity of the credentials (by using the
rederict handler on the cloud server), and only calls the function that does
the actual work (looks up the web service userid, loads the dives) if that
succeeds.
Right now there is no good user feedback mechanism - this just gets logged on
the log page. But this is a massive improvement if there are issues with
network connectivity or if the user mistyped their credentials.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Throughout Subsurface we try to only capitalize the first word of every menu or
window text (unless there are other reasons to capitalize the word, of course).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This gets us consistent look and feel as otherwise the labels aren't styled the
same as for the rest of the application.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The logging to the UI didn't work anymore since the message area had been
removed in commit 8646934ba3 ("Simple DiveList as initial Page").
This way all the updates simply land on the Log page.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes for a much more friendly first use experience:
Open Subsurface-mobile, enter your cloud credentials, tap on Save and you see
your dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes the cloud credential entry page much simpler, separate page. It also
removes the two colums and uses the label of the check box instead of having a
separate label item.
The preferences page of course also gets simpler by doing this. Here I kept the
two columns, though.
Finally the code for the old context menu was removed - not sure why this was
still here.
Next I need to fix the savePreferences() call to do the right thing in each
case.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This prevents people from overwriting a perfectly fine repository with an empty
one. Typically happens when you first enter your cloud credentials and then
don't Load Dives right away.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The scaling needs to happen before we draw the profile on the viewport, not
before we render that viewport into the pixmap. This is why prior to this patch
the first time the profile was rendered it was way off, but then if it got
re-rendered things worked better. I'm still not 100% happy with the size and
position of the profile, but this is a huge improvement.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The button to hide the dive profile serves no purpose anymore.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The asynchronous nature of the profile bites us here. plotDive() signals
that it changes model data and expects the rest of the data structures to
respond to that. Very neat and it seems to work perfectly well on the
desktop, but on Android calling render() right after plotDive() resulted
in paint() functions being called before all the elements had been
calculated as a result of the signals being emitted in the model change.
That's why so often the profile was missing parts.
Now admittedly this makes me nervous. Do we now know that all calculations
have finished by the time render() gets called? Not really. It just seems
that in my testing we tend to get lucky and things work out. But that does
not feel like a sane architecture to me.
Messing around with the animation speed is silly as we render the profile
into a pixmap, so let's turn this off globally.
Also, the scaling of the pixmap is still completely bogus.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
get_error_message() clears the error message in the process, so calling it
twice in a row does not do what you might think it does.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes spacing around the icon in the left drawer, the stretched-out
icons in the navigation menu, the unnecessary scrolling in the same
menu, and a few other things.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- Use the component's heading for more consistency
- spacing between items: largeSpacing above, half of that below, this
makes the title visually connect to the widgets it refers to.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Using a normal checkbox, we get black text, not our styled Label. Since,
short of doing a style, this is the only way to get the label the right
color, and thus not screw up the visual appearance of the drawer, we
hand-roll it.
This is a bit clunky, but I prefer visual continuity here over code
complexity concerns.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Add a checkbox in the global drawer which allows quick access enabling
and disabling the location service. This is something the user wants to
keep an eye on, quickly enable it before a trip, so it makes sense to
give it some prominence. It also helps reminding that the user switched
the device into battery-monster-mode.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
The right hand side of the logo was slightly off of the left orientation
line for the rest of the layout. This changes it to Units.smallSpacing,
which is used for this kind of spacing.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This change makes the top bar a information/decorational item, not
interactive anymore.
- The menu at the top-right is redundant, it is provided by the
left-hand-side drawer and visually present through the botom-centered
control button.
- The back button is already provided on Android by default, swiping
back in the UI also works, so this button provides a third method to
go back -- that's overkill.
Less is more. Less top bar means more screen estate for the meat.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Specifying a negative margin means that we negate the margin that the
ListItem so carefully figures out for us, don't do that.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
- Replace the custom text items with the Components' label
- Remove now unneeded properties
The goal is to use less different font sizes, as to give the listview a
calmer and more uniform look.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This achieves two things:
- make the contents not seem crammed against the bottom
- allow the user to scroll the content above the drawer icon
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Simplify the default page in main.qml:
DiveList has everything needed, remove the outside
layout and the message bar
Signed-off-by: Marco Martin <notmart@gmail.com>
We've already ported everything to MobileComponents.Label, so this file
can be taken behind the barn, never to be seen again.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
The ApplicationWindow component has an internal PageRow for the
management of the application's pages, use that instead of an
own StackView.
Use shared components for common things in the app
ListItem for the dive list
Page for application pages, for correct background color
and moving of the action button
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This makes things like accent(Text)Color and our two custom point sizes
for fonts resolve correctly again.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Move the properties we previously added to units and theme into their
own container. This encapsulates these things that belong together and
allows us to move it out later without many problems. Also, litter the
global namespace a bit less.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This patch is the part implementing the drawers and in-app page
navigation. In more detail:
- main.qml uses the mobilecomponents plugin and the APIs as already
changed in the other components
- The extended properties have moved into the root item (for now,
they'll get properly encapsulated later)
- A menu can be swiped in from the left
- The application makes better use when used horizontally (if there's
enough space, so depending on the display you can get divelist and
-details next to each other, one phone/portrait formfactor, the layout
stays in a single column.
- The options for GPS have been grouped into a submenu
This change follows the Plasma mobile human interface guidelines. These
changes are actually relatively small considered what they're doing,
most of the logic is encapsulated in mobilecomponents' PageRow and *Drawer
classes.
The previous navigation pattern is actually a subset of this
one, so it still works.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This picture is used for the header part of the drawer which can be
swiped in from the left.
I'm sure Dirk has a better one, but this works quite nicely until he
gets to replace it.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This is a dumb port of a number of properties to use the new theme and
units API.
- import the plugin
- change accessors from units and theme to MobileComponents.Unit and
MobileComponents.Theme
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This adds only the bits from MobileComponent that we already use to the
qrc file, including two icons go-next and go-previous (2 simple SVG icons taken
from the breeze theme).
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit adds the .qml and qmldir files for the MobileComponents
import. It contains low-level things like units and theme, and mid-level
things like Heading, and high-level navigation in the form of an
ApplicationWindow and Drawers that hold menues and provide swipe
interactions between the pages.
These components are a more full version of the "light" plasma
components we have been using to make the UI scale well and appear more
consistent (coloring, spacing, alignment, etc.).
An interesting change is that Units and Theme are now singleton types,
which is more efficient. It does mean a few changes to our current API
usage:
- units becomes Units
- theme becomes Theme
- 2 properties move out of each (we can't subclass singleton types)
This change also means that we're using the vanilla upstream components,
so it's very easy to get improvements to these rather young components
in, and we don't have to do this work on our own.
The mobilecomponents consist of just a bunch of qml files which we can
deploy through the qrc file.
In the next commits, we will gradually make the current UI use these new
elements.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Testing the mobile application on Win32 desktop results
in a crash.
Using ApplicationWindow for some reason makes the executable
enter an inifinity loop on startup until it runs out of RAM.
The output is:
setGeometryDp: Unable to set geometry 160x1200+720+426 on ApplicationWindow_
QMLTYPE_12_QML_111/''. Resulting geometry: 160x885+720+426 (frame: 4, 23, 4,
4, custom margin: 0, 0, 0, 0, minimum size: 0x47, maximum size: 16777215x
16777215).
To fix the crash use "Window" instead of "ApplicationWindow".
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
ACKed-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this is primarily something targeted at a mobile device, with many
of the 2 in 1 devices it is possible that the user might be running the
desktop version of Subsurface on a mobile device.
As a first step to make it possible to collect GPS fixes on such a device
we need to make the infrastructure to do so available in the desktop
application as well.
This still needs to be hooked up in the desktop UI.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of directly using the status output for the QML UI, set up the
function used to display messages to the user as part of the constructor.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should actually not be in the mobile section at all. This needs to be
available on the desktop as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's just not user friendly to have two different user IDs for two
different web services that we provide. Instead in the following commits
we'll add a way to retrieve the location service web service userid with
your cloud storage user id.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now this always sends the default name for GPS fixes created by the
location service. There isn't much point in making this configurable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>