Commit graph

1204 commits

Author SHA1 Message Date
jan Iversen
f424f9292e mobile-widget/qml/Settings.qml: correct theme switches
Replace subsurfaceTheme with ThemeNew, since there are still 2 objects
subsurfaceTheme in main.qml and ThemeNew in themeinterface.*

Replace theme color references with ThemeNew, as they are no longer available
in main.qml (subsurfaceTheme).

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-28 11:05:45 -08:00
jan Iversen
1d35942249 themeinterface: move registration to themeinterface
Move setup call and registration from subsurface-helper
to themeInterface, in order to keep the registration where the code
are.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-28 11:05:45 -08:00
jan Iversen
97e2890990 mobile-widgets/qml: integrate DiveSummary in menu.
Add DiveSummary to globalDrawer

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27 14:25:03 -08:00
jan Iversen
b6e86a1c70 mobile-widgets/qml: add DiveSummary.qml
Add DivePlannerSummary, a page to show in dive centers.

Allow user to select period for the 2 colums in DiveSummary.

Default is "Total" and "3 month", but allowing the user to change
these, make it a very simple tool to view how the user progresses.

Variables are taken from Backend.

[Dirk Hohndel: adjusted text strings as these aren't really months]

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27 14:25:03 -08:00
jan Iversen
6cd46bee06 divesummary: add DiveSummary class to shared and backend
Create DiveSummary class in backend-shared and make the DiveSummary calculation
results available to QML.

This adds a loop over all dives (could have been done with a model, but the
models available to mobile are very limited, so use the basic way).

[Dirk Hohndel: renamed the results variable and combined a couple of commits]

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27 14:25:03 -08:00
jan Iversen
bb13065a75 mobile-widgets/qml: add background color property
Add property "colorBackground" to allow instances of templateLabel to have
background color overwritten.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27 14:25:03 -08:00
jan Iversen
0920adf40f mobile-widgets/qml: correct spelling error
Correct spelling error in TemplateTitle.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27 14:25:03 -08:00
Dirk Hohndel
5b81997459 code cleanup: whitespace cleanup
A lot of whitespace issues have snuck in recently, this just cleans those up so
that I don't need to hand-edit patches every time I touch this file (since
QtCreator automatically fixes whitespace when I make changes).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-26 16:51:05 -08:00
Dirk Hohndel
2268b6b212 code cleanup: QLatin1Literal is deprecated in Qt 5.14
Simply replace it with QLatin1String. There is a tiny performance penalty,
but none of that code would care.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-26 16:49:42 -08:00
jan Iversen
df9164f7e5 mobile-widgets/qml: integrate ThemeNew in qml
Update Settings to use ThemeNew (for theme change)
Reduce subsurfaceTheme in main

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-26 16:42:35 -08:00
jan Iversen
9de296f3dd mobile-widgets: add themeInterface
Currently subsurfaceTheme resides in main.qml, where it does not naturally
belong.

Add C++ class that will replace subsurfaceTheme in main.qml in a 1-1 manner.

This opens future posibilities
- on top of the 3 themes, allow users to select colors/fonts
- add stylesheets to Template* components
- make day/night shift automatically.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-26 16:42:35 -08:00
jan Iversen
6584cd82d5 mobile-widgets/qml: correct backgroundcolor in setup
Use subsurfaceTheme in DivePlannerSetup.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25 17:26:11 -08:00
jan Iversen
3ff65dd7cf mobile-widgets: update design of TemplateSection
Update size and colors.

Changing the TemplateSection, automatically changes all sections
in the system, converted to the new layout.

The styling would be better in a style/theme class, but
subsurfaceTheme is in main.qml and not in a C++ class, so for now
use primitive styling.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25 17:25:54 -08:00
jan Iversen
a97a6d607c mobile-widgets: update design of TemplateSpinBox
The standard SpinBox uses far too much real estate.

The new SpinBox have a smaller footprint, and more visual effect.

Changing the TemplateSpinBox, automatically changes all spinboxes
in the system, converted to the new layout.

The styling would be better in a style/theme class, but
subsurfaceTheme is in main.qml and not in a C++ class, so for now
use primitive styling.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25 17:25:23 -08:00
jan Iversen
c1bbab6eaa mobile-widgets/qml: connect QML to Backend.
Add property pressureUnit to use as BAR/PSI text.

Added slot to catch when user changes BAR <-> PSI.

Add Backend variables to Planning section.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
ff360d28f5 diveplanner: add surface_segment to plannershared
Add surface_segment to plannerShared and then
update desktop-widgets.

Signed-off-by: jan Iversen <jan@casacondor.com>

desktop-widgets: use plannerShared for surface_segment

Change getter/setter for surface_segment to plannerShared, in
order to share the conversion with mobile diveplanner

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
995340b68a mobile-widgets: make planning vars available to QML.
Update qmlinterface.h with the planning variables (calling
plannerShared).

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
ee839fe5d9 mobile-widgets: make DECO_MODE and DIVE_MODE available to QML
Duplicate deco_mode to DECO_MODE, in order to make it available to QML.

Duplicate enum divemode_t to DIVE_MODE in order to make it
available to QML. Only part of the enum is made available.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
59ac506091 mobile-widgets/qml: correct reference in TemplateComboBox
theme is not available, use older subsurfaceTheme.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
8f6aaaba25 mobile-widgets/qml: graphic layout Planner (Planning)
Add all needed graphical elements for DivePlannerSetup
planning section.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
1e3879d87d diveplanner: add last gas variables to QMLInterface
Add bottompo2, decopo2 and bestmixend to QMLInterface

Bestmixend in gas options changing with
meter/feet

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
86fd49f2d7 diveplanner: adjust sac-factor calculation.
The real values are 1.0 to 10.0, but QML needs int so mobile
gets values 10.0 to 100.0

add sacfactor() to QMLInterface and update QML.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
cd3c2266f9 dive planner: correct bottomsac/decosac calc.
Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp
to plannerShared, to facilitate the same results in mobile
diveplanner

Use Backend for bottomsac/decosac and update to check
for switch LITER <-> CUFT

Add bottomsac/decosac to QMLinterface.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
e55c740d84 diveplanner: call planner model directly for simple variables.
Variables without conversion, do not need to pass plannerShared
(due to the QML interface).

Simple variables do not pass plannerShared, but diveplanner
in desktop-widgets and qmlinterface in mobile-widgets call the
implementation directly.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25 17:13:20 -08:00
jan Iversen
1e14c3f0d3 mobile-widgets/qml: add slot for volume change
Catch when volume type is changed and update bottomsac/decosac.

Also update text l/min <-> cuft/min and add a space between value and unit.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24 20:23:37 -08:00
jan Iversen
2ef0d23c29 mobile-widgets/qml: Add drop_stone to rates
Drop_stone_mode, when set, affect the descent rate, so place it alongside the
descent rate.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24 20:23:37 -08:00
jan Iversen
0710e610d3 mobile-widgets: add simple part of remaining planner variables
Add simple variables, where getter uses prefs. and setters call directly to set
function (without using plannerShared).

rename last_stop --> last_stop6m

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24 20:23:15 -08:00
jan Iversen
b0e46c208d mobile: move dive planner notes access to pure interface
Make notes rates available to QML through the Backend interface.
Remove the corresponding variables from plannerShared.

Getters are from prefs. while setters are linked to diveplan model.

Remark: signals from qPrefDivePlanner is used, because the diveplanner model
sets qPrefDivePlanner but do not issue special signals.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24 20:20:42 -08:00
jan Iversen
e22943fa21 mobile-widgets/qml: use Kirigami Units instead of hardcoded values
This allows for better scaling of the UI.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24 20:20:41 -08:00
jan Iversen
97376eb382 mobile-widgets/qml: add radiobuttons for single units.
For METRIC and IMPERIAL, show the radiobuttons disabled
For PERSONALIZED, allow user to select individual units.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24 10:55:04 -08:00
jan Iversen
cc5b856280 mobile-widgets: use radiobuttons for Units
Change to radiobuttons for units, and add a third choice (personalize).

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24 10:55:04 -08:00
jan Iversen
6db7e6d278 mobile-widgets/qml: use Backend instead of Planner
Use Backend instead of Planner for ascent/descent variables.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 15:47:26 -08:00
jan Iversen
699665ce9e mobile-widgets: add asc/desc rates to pure interface
Make ascent/descent rates available to QML through the Backend interface.

Remark signals from qPrefDivePlanner is used because the diveplanner model
sets qPrefDivePlanner but does not issue its own signals.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 15:46:08 -08:00
Dirk Hohndel
51a242a1db mobile UI: add ability to unset the default cylinder
This was requested in a 'bug report' by a user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 15:39:22 -08:00
jan Iversen
6e06550631 core/settings:: remove string functions for units
Remove string version of unit_system, duration_units, length, pressure,
temperature, vertical_speed_time, and volume, including tests and make signals
strongly typed in C++

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 09:55:26 -08:00
jan Iversen
75fe59b0da mobile-widgets/qml: use strongly typed units in QML
Change Settings and DivePlannerSetup to use the strongly typed enums

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 09:49:36 -08:00
jan Iversen
25a5be0fe9 mobile-widgets: allow qPrefUnit strongly typed in QML
Add qPrefUnit Q_PROPERTY but using QMLInterface enums, that way
all variables become strongly typed in QML.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 09:49:05 -08:00
jan Iversen
11c6851c74 mobile-widgets: move rest of gridlayout to section advanced
Create section advanced around the remaining gridlayouts, and adjust.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:59:48 -08:00
jan Iversen
5bce4895cc mobile-widgets/qml: create units section and move unit_settings
Move gridlayout unit_settings to TemplateSection units, without changing
anything (apart from adding a visible: attribute).

Removed first label in units_settings, since it is the title of the section

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:59:04 -08:00
jan Iversen
0443d7f2c9 mobile-widgets/qml: create theme section and move themesettings
Move gridlayout themesetting to TemplateSection theme and use the
TemplateTitle.  Also switch from using PrefDisplay.mobile_scale to
subsurfaceTheme.currentScale

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:56:13 -08:00
jan Iversen
ba7a8f68bc mobile-widgets/qml: move dive computers to general section.
move gridlayout divecomputers to TemplateSection general, without changing
anything (apart from adding a visible: attribute and replacing the Rectangle
used to draw a line at the bottom with a TemplateLine on top.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:54:54 -08:00
jan Iversen
3d239a7903 mobile-widgets/qml: move default cylinder to general section.
move gridlayout defaultCylinder to TemplateSection general, without changing
anything (apart from adding a visible: attribute and replacing the Rectangle
used to draw a line at the end with a TemplateLine at the top).

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:53:45 -08:00
jan Iversen
bf7464788e mobile-widgets/qml: move cloudSettings to general section.
move gridlayout cloudSettings to TemplateSection general, without changing
anything (apart from adding a visible: attribute and removing the rectangle
used to create a line).

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:52:47 -08:00
jan Iversen
12631ef2bb mobile-widgets/qml: add General section to Settings
ColumnLayout does not work well with TemplateSection,
so change to Column

Add TemplateSection "General Settings"

"General Settings" are open when visiting page first time.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:52:13 -08:00
jan Iversen
8ee39aa6b6 mobile-widgets/qml: bump versions for settings
bump import versions to reflect Qt 5.12
and remove unused imports

remark QtQuick 1 and QtQuick.Controls 1 are depreciated since Qt 5.12

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:56 -08:00
jan Iversen
96ec585179 mobile-widgets/qml: settings Control.TextEdit -> TemplateTextEdit
Replace Control.TextEdit with TemplateTextEdit, in order to use
common font/color scheme.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:48 -08:00
jan Iversen
ee1d5ba94e mobile-widgets/qml: settings Control.comboBox -> TemplateComboBox
Replace Control.ComboBox with TemplateComboBox, in order to use
common font/color scheme.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:19 -08:00
jan Iversen
2ce32277db mobile-widgets/qml: settings Control.label -> TemplateLabel
Replace Control.label with TemplateLabel, in order to use
common font/color scheme.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:06 -08:00
jan Iversen
da25b107a5 mobile-widgets/qml: add TemplateTitle
Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:50:31 -08:00
jan Iversen
bd06ec371c mobile-widgets/qml: add TemplateLine
Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:50:19 -08:00