- 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>
The workaround to building Subsurface-mobile on Mac messes with the ability to
sign the bundle, so only do this when building Subsurface-mobile which we don't
bundle, anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we looking for dive details and are trying to guess the offset between
object_id and logfilenr, we need to treat logfilenr 0 as special - it
means we read past the end of the list of stored dives and need to walk
backwards.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Opening Subsurface for the first time with heartbeat graph visible
and then immediately doing File->New shows the logo/background in the
profile space while hiding everything except the heartbeat graph.
This patch makes sure that the graph is hidden with everything
else on an empty profile state.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some backends support giving tank data for some, but not all models that
they support (and simply report no tanks for those models that don't
support this). The Suunto Vyper is one of the dive computers where this
happens and without this change we report angry red warnings after a
perfectly correct download.
So this changes the logic to only show that error if there actually were
tanks reported.
Signed-off-by: Dirk Hohndel <dirk@hohndel.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>
Adding pictures to the repository was a big mistake on my part. It's very
easy for the git repositories to reach a gigabyte and more making sync
times (and especially "first download" times) completely unreasonable.
This doesn't solve the problem for existing repositories (as the pictures
are already there, in the git history), but at least it prevents us from
storing more pictures out there.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Tank icons were shown at incorrect spots on the profile
when the DiveEventItem object held a pointer to a struct
event even after the struct event at that address had
been freed. When internalEvent is a pointer to freed
memory, internalEvent->time.seconds could have all kinds
of crazy values, which get used in member function
DiveEventItem::recalculatePos to place the tank at bad
x coordinates.
The DiveEventItem(s) no longer store a pointer to memory
that they do not own. This way, no matter how the path of
execution arrives into slot recalculatePos, we never need
fear that the DiveEventItem will dereference a garbage
pointer to a struct event.
Fixes#968
Signed-off-by: K. Heller <pestophagous@gmail.com>
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>
m_dives can be empty, so make sure we don't push an invalid QModelIndex
into the mode.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It still is rather specific to my system layout, but at least removes a
reference to my home directory path...
It also removes @rpath references from the executable. This should in theory
work, but it failed for me on one machine that I tested on and doing things
this way doesn't appear to cause problems.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
One user's debug log shows valid data, only not in the format we've seen
before (with the response starting with '{'). Instead he gets a repeat of
the second word in the response to processSync prepended to the expected
output. So let's skip the data until the first '{'.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>