Commit graph

9792 commits

Author SHA1 Message Date
Sebastian Kügler
936c9cee1f Add more icons
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>
2015-12-07 18:46:57 +01:00
Sebastian Kügler
de5bb98dba dive edit gets contextual actions
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.
2015-12-07 18:46:57 +01:00
Sebastian Kügler
610ce4325f noise--
Kill print in DiveList's startpage.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-12-07 18:46:57 +01:00
Sebastian Kügler
cb77548f9b add context drawer component to the qrc file
It's now needed in main.qml.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-12-07 18:46:57 +01:00
Sebastian Kügler
49eb7d841d add a contextdrawer
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>
2015-12-07 18:46:57 +01:00
Sebastian Kügler
8cf4725742 split divedetails into view and edit parts
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>
2015-12-07 18:46:32 +01:00
Sebastian Kügler
bd7af5a511 state machine controls edit/view dive details
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>
2015-12-07 18:46:32 +01:00
Sebastian Kügler
54da517e9d Styled heading in startpage
We have a specific component for headings now, use it for consistency's
sake.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-12-07 18:46:32 +01:00
Sebastian Kügler
b6f5f235f0 sync with mobilecomponents 9d8bf6d77d
- 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>
2015-12-07 18:46:32 +01:00
Sebastian Kügler
72411eee63 Fix indentation
It's a bit all over the place. This makes it consistent and aligned.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-12-07 18:46:32 +01:00
Sebastian Kügler
d9cfdc3b69 Better theme information page
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>
2015-12-07 18:43:25 +01:00
Dirk Hohndel
b928dff3ce Only install QML Framework files for Subsurface-mobile
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>
2015-12-06 13:44:32 -08:00
Dirk Hohndel
eb0ccace77 Uemis downloader: handle yet another corner case
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>
2015-12-06 13:38:38 -08:00
Lubomir I. Ivanov
491ef7edc8 diveprofileitem.cpp: fix unused variable warning on mobile
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-06 12:28:01 -08:00
Lubomir I. Ivanov
2aed907525 profilewidget2.cpp: hide the heartbeat graph on an empty state
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>
2015-12-06 12:19:44 -08:00
Dirk Hohndel
956d189734 Only warn about different number of tanks and gases if there are tanks
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>
2015-12-06 09:40:21 -08:00
Dirk Hohndel
b5fcfc8867 QML-UI: a small bit of reindentation
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>
2015-12-05 06:42:10 -08:00
Dirk Hohndel
5588268cb2 QML-UI: remove duplicate "Run location service" menu entry
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>
2015-12-05 06:36:16 -08:00
Dirk Hohndel
c9dbb424f2 QML-UI: delete unused code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-05 06:29:06 -08:00
Dirk Hohndel
703c3de880 QML-UI: mark email entry field as such
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>
2015-12-05 06:27:06 -08:00
Dirk Hohndel
091d099368 QML-UI correct cut and paste error
Stupidly the wrong functions were connected to the signals.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-04 20:39:12 -08:00
Dirk Hohndel
fd78f8dc1a QML-UI: re-architect the way we access network resources
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>
2015-12-04 19:51:35 -08:00
Dirk Hohndel
4266600254 QML-UI: use consistent capitalization
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>
2015-12-04 19:51:20 -08:00
Dirk Hohndel
a600253e62 QML UI: log the text shown on the log page
Sadly this doesn't work, even though it appears to be the thing to do based on
the documentation.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-04 19:50:54 -08:00
Dirk Hohndel
1cb5419a57 Cloud storage: do not store the actual pictures in git
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>
2015-12-03 23:14:20 -08:00
K. \"pestophagous\" Heller
445dbe73bf Crash fix in add_single_dive. No writing to dive_table.dives[-1]
Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03 22:56:54 -08:00
K. \"pestophagous\" Heller
2778470b97 Prevent gaschange tank icons from using garbage coords.
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>
2015-12-03 22:56:23 -08:00
Dirk Hohndel
b0063e5d1a QML-UI: use our styled elements
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>
2015-12-03 17:57:25 -08:00
Dirk Hohndel
2fc99092fb QML-UI: replace the two ways to log progress with one
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>
2015-12-03 16:01:17 -08:00
Dirk Hohndel
d20e25419f QML-UI: make Log page scrollable
I noticed when sending a bunch of debug output to the log that it didn't scroll
and that seemed wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03 15:55:08 -08:00
Dirk Hohndel
2413f23cd5 QML-UI: open cloud storage once credentials were entered
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>
2015-12-03 14:54:30 -08:00
Dirk Hohndel
a0b83dc2f1 QML UI: different functions for saving Preferences and Cloud Credentials
Tapping Save on those two pages should only update the data that are actually
available on those pages.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03 14:30:30 -08:00
Dirk Hohndel
7a94360a6d QML-UI: Split cloud credentials and other preferences
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>
2015-12-03 14:11:30 -08:00
Sebastian Kügler
9ef475844d Fix crasher
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>
2015-12-03 12:48:51 -08:00
Dirk Hohndel
7d2a7da079 Small change to the Mac make package script
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>
2015-12-03 12:47:50 -08:00
Dirk Hohndel
774f45b98b Fix compile error on Mac
We need a space between the two string literals.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03 10:42:24 -08:00
Dirk Hohndel
3499e50d0c Uemis downloader: ignore leading junk in the data
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>
2015-12-03 09:47:46 -08:00
Dirk Hohndel
75d30b8d70 Uemis downloader: don't leak memory
Don't just clear out the buffer pointer, free the memory, first.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03 09:47:09 -08:00
Dirk Hohndel
f17041e1cb QML-UI: refuse to save to cloud unless you loaded from cloud, first
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>
2015-12-02 18:49:02 -08:00
Dirk Hohndel
789c32bf4c QML UI: if load fails, don't continue processing data
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 17:50:47 -08:00
Dirk Hohndel
8f33403e4f Fetch the Subsurface webservice userid if cloud credentials were given
This allows users to not have to worry about this userid anymore. Both the
mobile app and the desktop app can now derive the userid from the cloud
storage credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 14:32:03 -08:00
Dirk Hohndel
962341ae9f Add instance method for GpsLocation
This way we can call members from different parts of the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 14:30:47 -08:00
Dirk Hohndel
1bfcf5c0f8 QML UI: fix profile scaling
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>
2015-12-02 11:28:35 -08:00
Joakim Bygdell
84a47c0cb4 QML-UI: Remove button from dive details
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>
2015-12-02 10:36:17 -08:00
Lubomir I. Ivanov
794d4e88be user-manual.txt: modifications related to Grantlee variables
This patch adds the new variables to the Grantlee section
of the user manual, which were recently added, code wise.

The patch also cleans the descriptions of some of
the already present varaibles and fixes a couple of typos
in the process.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 09:21:52 -08:00
Anton Lundin
c1f8ecd67a Correct Qt version in README for android building
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 09:21:14 -08:00
Anton Lundin
59042b2ed0 Fix disabling of facebook integration
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 09:21:04 -08:00
Anton Lundin
58901690dd Remove defaults for Android from cmake
Some of the flags needed to build for android was set in cmake. There
are many more that needs to be set correctly for things to work, so
having some in cmake and some in the Android build.sh is just confusing.

This removes the bits from cmake and moves everything into build.sh.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 09:20:50 -08:00
Dirk Hohndel
63eff39edd QML-UI: turn of some profile features
We don't have a tooltip on the QML UI as it's rendered into a pixmal.
We also don't need the timer as we don't need the TTS calculations.
And we don't need the acrobatics to figure out if we're in the planner as
we don't support the visual planner (or any planner, at this point) with
the mobile UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-01 15:37:28 -08:00
Dirk Hohndel
3f72500f87 Switch to compile time connect syntax
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-01 15:34:00 -08:00