Commit graph

9662 commits

Author SHA1 Message Date
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
Dirk Hohndel
c0ac953242 QML UI: call plot dive when we set the dive
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>
2015-12-01 15:32:16 -08:00
Dirk Hohndel
9dd26a00e8 Profile: avoid potential crash
If things go as planned, then the length of the polygon is the same as the
number of rows in the model. Turns out when running Subsurface-mobile on
Android that simple truth doesn't seem to be correct. Most of the time
the polygon seems to have twice as many elements as the model. But a few
times I ended up in here with a polygon that had fewer elements than the
model. And then things crash.

This simply avoids the crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-01 15:20:32 -08:00
Dirk Hohndel
dcce7358ff QML-UI: make sure errors make it to the log
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>
2015-12-01 09:37:47 -08:00
Dirk Hohndel
da2da116b5 QML UI: add number of loaded dives to log
This way we can see if loading dives succeeded at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-01 09:15:40 -08:00
Dirk Hohndel
05bf480e2e CMake hack to build Subsurface-mobile on Mac
With this running

	make && make install

should give you a Subsurface-mobile.app that you can execute (either with
double click or using "open Subsurface-mobile.app" from the command line).

This contains a couple of hacks but I didn't try too hard to make this clean
since Tomaz is redoing the CMake build system, anyway and I'll need to make
sure this still works once he's done.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 15:06:18 -08:00
Dirk Hohndel
26fbcb0b74 Fix QML component import path when running Mac bundle of Subsurface-mobile
When running the QML UI on a Mac the deployment of the QML Components
seems to fail and the search path for the components is rather odd -
simply the same directory the executable was started from:

	<bundle>/Contents/MacOS/

To work around this we need to manually copy the components at install
time to Contents/Frameworks/qml (not covered in this commit) and make sure
that we add the correct import path.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 14:17:04 -08:00
Dirk Hohndel
2311bc2378 Subsurface-mobile: don't create the GPS source until it is needed
This should accelerate the startup of the UI a little more.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 10:58:18 -08:00
Dirk Hohndel
f6ae8bf3ea QML UI: don't load dives before the UI has been instantiated
This should deal with a big part of the delay when starting the app.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 10:15:04 -08:00
Dirk Hohndel
2f2e9da2cd Clear the Dive model before repopulating it
Otherwise we could get duplicate dives in the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 10:09:46 -08:00
Dirk Hohndel
9d62258316 Merge branch 'mobilecomponents' of github.com:sebasje/subsurface 2015-11-29 19:58:29 -08:00
Sebastian Kügler
f8fb9181b2 sync with mobilecomponents 68c6dc9
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>
2015-11-30 02:53:21 +01:00
Sebastian Kügler
6381c2eb2a improve preferences layout
- 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>
2015-11-30 02:43:40 +01:00
Sebastian Kügler
5f40ac6da3 Style the checkbox
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>
2015-11-30 02:43:40 +01:00
Sebastian Kügler
c5722773d2 Easy access to enable/disable location service
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>
2015-11-30 02:43:40 +01:00
Marco Martin
fd3bb4a84d The system integrated component is TextArea
this will give graphical styling and behavior

Signed-off-by: Marco Martin <notmart@gmail.com>
2015-11-30 02:43:40 +01:00
Marco Martin
0926776877 Align the labels ar right
uniform look for forms: labels aligned at
the right, fileds at the left

Signed-off-by: Marco Martin <notmart@gmail.com>
2015-11-30 02:43:40 +01:00
Marco Martin
cf9476c74e use a ScrollView for the main flickable
It managed the styled scroll indicator and the
behavior.

Signed-off-by: Marco Martin <notmart@gmail.com>
2015-11-30 02:43:40 +01:00
Sebastian Kügler
09bf7fabcf sync with mobilecomponents e7d789465b9a935ec
This fixes lack of spacing in the drawer's menu items.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-30 02:43:40 +01:00
Sebastian Kügler
52b3c68b24 Align subsurface logo correctly
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>
2015-11-30 02:43:40 +01:00
Sebastian Kügler
e12c784db4 Smaller topbar, no button in it anymore
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>
2015-11-30 02:43:39 +01:00
Sebastian Kügler
f4906abf59 Fix left margin in dive list
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>
2015-11-30 01:07:42 +01:00
Marco Martin
13f78743c6 Divelist has its own color
don't reassign DiveList color upon declaration
it's just redundant and error prone

Signed-off-by: Marco Martin <notmart@gmail.com>
2015-11-30 00:04:10 +01:00
Sebastian Kügler
b96f202f14 sync with mobilecomponents 67e73fa85e
Colors have slightly changed in breeze.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-30 00:03:02 +01:00
Sebastian Kügler
78d5325dda Simplify dive list items
- 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>
2015-11-29 23:59:49 +01:00
Sebastian Kügler
95c5b35583 Add a bit of spacing below the dive details
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>
2015-11-29 23:58:49 +01:00
Marco Martin
8e523329b6 fix contents size
correct childrenRect mistakedly called contentRect

Signed-off-by: Marco Martin <notmart@gmail.com>
2015-11-29 23:58:49 +01:00
Marco Martin
8646934ba3 Simple DiveList as initial Page
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>
2015-11-29 23:58:49 +01:00
Sebastian Kügler
609d138a49 sync with mobilecomponents' d3fa79b50b54
This fixes the flickering when the drag button hits the right edge.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 22:24:34 +01:00
Sebastian Kügler
33d589ff5c Add missing icon
This is the SVG file used on the drag button. Like the other two, it's
taken from the Breeze icon set.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 22:21:31 +01:00
Sebastian Kügler
e0fc5268fe Sync with mobilecomponents 54e4f2622a
This fixes loading the icon.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29 22:13:52 +01:00