Commit graph

36 commits

Author SHA1 Message Date
Dirk Hohndel
2b1ffb3cc4 QML UI: trigger download of GPS fixes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07 21:41:52 -08:00
Dirk Hohndel
e20005ed36 QML UI: when manually adding a dive clear out all the fields
Otherwise the data from the last dive dispayed (or added) will be shown.

Fixes #983

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05 23:06:46 -08:00
Dirk Hohndel
fd23a4891c QML UI: consistency in naming
Let's try to call it Subsurface-mobile everywhere.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 09:34:32 -08:00
Dirk Hohndel
fcc615a497 QML UI: try to remove two binding loops
Let's face it. I have no idea what I'm doing here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-27 12:28:08 -08:00
Dirk Hohndel
9be42fff81 QML UI: correct text for context drawer when adding dive
This needs to say "Save" to indicate that you are saving the data that was
entered.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 21:56:45 -08:00
Dirk Hohndel
0962b504ce QML UI: get add dive closer to being useful
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>
2015-12-26 21:37:18 -08:00
Dirk Hohndel
763986b683 QML UI: when adding a dive, start in edit mode
Obviously we don't want to "view" a new dive, we want to "edit" it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 17:06:52 -08:00
Dirk Hohndel
c3ebeadb34 QML-UI: allow toggling verbose mode from the UI
Hidden in the Developer menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-19 18:41:50 -08:00
Sebastian Kügler
36e3c5485e implement new menu structure
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>
2015-12-08 04:55:56 +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
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
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
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
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
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
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
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
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
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
Marco Martin
32219f1276 Port the page navigation to ApplicationWindow's one
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>
2015-11-29 21:59:48 +01:00
Sebastian Kügler
6580f078d0 Fix reference errors caused by moving properties around
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>
2015-11-29 19:22:10 +01:00
Sebastian Kügler
8fad349c82 new container for extended theme properties
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>
2015-11-29 19:09:59 +01:00
Sebastian Kügler
6ffef818a8 Rework central navigation
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>
2015-11-29 17:51:14 +01:00
Lubomir I. Ivanov
daf8f36dd4 main.qml: fix crash on native Win32 desktop
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>
2015-11-19 07:55:00 -08:00
Dirk Hohndel
7afed04520 Location service: upload GPS fixes to webservice
With this Subsurface-mobile should be able to mostly replace the companion
app. This needs some more testing and fine tuning (for example the minimum
time / distance should be configurable, there should be a location name),
but I think the hard part is done now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-13 17:21:43 -08:00
Dirk Hohndel
577da54454 Location service: add ability to delete all stored GPS fixes
This may need an "are you sure" confirmation dialog...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-13 17:20:45 -08:00
Dirk Hohndel
4b39971978 Location service: apply the saved GPS fixes to dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-12 20:23:00 -08:00
Sebastian Kügler
63cde0e120 dpi improvements for small text
- word-wrap and style the log message at the bottom, this should fix
  clipping of error messages down there
- introduce units.smallPointSize, which defines a small font size to use
  for toned-down display elements (e.g. the date in the dive list)
- No need to assign the default value to Text.text

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 19:04:26 -08:00
Dirk Hohndel
62f7ec11d7 Location service: store locations in settings
This is rather simplistic and will clutter the settings. I'm not convinced
this is the BEST way to do this, but it's a rather straight forward way to
get persistant storage of the location fixes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 15:28:10 -08:00
Dirk Hohndel
cd7d6ae6e5 Location service: toggle the service from the main menu
That way we don't track the user's location until explicitly asked to do
so.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 15:28:10 -08:00
Sebastian Kügler
2b70b76133 Rejig navigation
This change streamlines the navigation across the pages to be in line
with the stackview organization. The top bar becomes a static element
with the title and a button that either opens the preferences or shows
the back arrow.

This makes it a bit more efficient, since we load the title bar only
one, and there are no strange animations in the title. The stackview
gets the role of content container, the "chrome" around it is laid out
in main.qml.

Most of the churn in this patch comes from moving large blocks of code
between files with different indentation levels.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:03:47 -08:00
Sebastian Kügler
aae4a326f4 organize qml files in subdirectories
This makes the organization of the qml files a bit more fine-grained, it
prevents mixing of .cpp and QML files, and also of what's compiled, and
what's included in the app as qrc data.

In particular:
- subsurface specific QML items go into the qml/ subdirectory
- theme and unit definitions to into qml/theme subdirectory (they
  already were located in a theme directory)
- generic components, such as our Label goes into qml/components

This facilitates sharing of functionality and identifying common stuff
better. Ideally, we can pull qml/theme and qml/components from a
standardized set at some point, so we don't have to maintain that code.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:00:59 -08:00
Renamed from qt-mobile/main.qml (Browse further)