Commit graph

16584 commits

Author SHA1 Message Date
jan Iversen
0974c7524f mobile-widgets/qml: add diveplanner pages to globalDrawer
Add "Dive planner" menu entry in GlobalDrawer/Developer
with 4 subitems one for each diveplanner pages.

Developer is chosen in order to allow interested access to
pages, without raising expectations for the normal user.

That allow a step-by-step implementation

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-26 10:21:16 -08:00
jan Iversen
fac8d5b125 mobile-widgets/qml: add diveplanner pages
Diveplanner consist of 3 pages:
- Edit, creation of the plan
- View, view the plan
- Manager, list/delete/select stored diveplans

With the current navigation system (pageStack)
View needs to be split in multiple pages.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-26 10:21:11 -08:00
jan Iversen
800973a920 mobile-widgets/qml: add TemplateComboBox
standard font-size as well as color are set
in the template (but can be overwritten in
the object)

Using TemplateComboBox allows central change of how
labels are presented in the UI.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 10:18:11 -08:00
jan Iversen
f44fa1aa27 mobile-widgets/qml: add TemplateCheckBox
standard font-size as well as color are set
in the template (but can be overwritten in
the object)

Using TemplateCheckBox allows central change of how
labels are presented in the UI.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 10:18:10 -08:00
jan Iversen
43b813d58e mobile-widgets/qml: add TemplateRadioButton
standard font-size as well as color are set
in the template (but can be overwritten in
the object)

Using TemplateRadioButton allows central change of how
labels are presented in the UI.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 10:18:10 -08:00
jan Iversen
6c8dae5a04 mobile-widgets/qml: add TemplateSpinBox
standard font-size are set in the template (but can
be overwritten in the object)

Using TemplateSpinBox allows central change of how
spinBoxes are presented in the UI.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 10:18:09 -08:00
jan Iversen
99cce7e807 mobile-widgets/qml: add TemplateLabel
standard font-size as well as color are set
in the template (but can be overwritten in
the object)

Using TemplateLabel allows central change of how
labels are presented in the UI.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 10:18:09 -08:00
jan Iversen
8468d28a41 mobile-widgets/qml: add TemplateSection
TempleSection is a clickable rectangle that contains
information.

It is used to
- group information
- hide/unhide details

And are an important building block in decluttering small
screen, while showing all information on bigger screens

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 10:18:08 -08:00
jan Iversen
d4a2c5cdee plannerShared: replace notes variables to plannerShared
Replace
    display_runtime
    display_duration
    display_transitions
    verbatim_plan
    display_variations

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 09:59:26 -08:00
jan Iversen
55d856b0fd plannerShared: add notes variables
Add
	display_runtime
	display_duration
	display_transitions
	verbatim_plan
	display_variations

Get is direct from qPrefDivePlanner and set is plannerModel

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 09:59:19 -08:00
jan Iversen
c976385aed desktop-widgets: replace variables to plannerShared
Use plannerShared setter to update the variables in qPref.
This will also signal the cylindermodel to calculate a new bestmix.

variables:
   bottompo2
   decopo2
   bestmixend

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 09:58:47 -08:00
jan Iversen
738ee360ba desktop-widgets: replace o2narcotic from plannerModel to plannerShared
Use plannerShared setter to update o2narcotic. This will also signal
the cylindermodel to calculate a new bestmix.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 09:58:21 -08:00
jan Iversen
c4d9b737cd plannerShared: add o2narcotic
Add include of cylinderModel
Add o2narcotic

the set function is special because it first
informs the plannerModel that there is a new value
and then ask cylindermodel to calculate a new bestmix

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:46:01 -08:00
jan Iversen
413501bc61 desktop-widgets: replace variables from plannerModel to plannerShared
variables
bottomsac
decosac
problemsolvingtime
sacfactor
are not set in diveplanner.cpp, but instead
signals a slot in plannerModel.

change signals to slots in plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:45:40 -08:00
jan Iversen
d8780fdd89 plannerShared: add variables from plannerModel
the variables are set through set functions in DivePlannerPointsModel,
but read via getters from qPrefDivePlanner.

Variables:
bottomsac
decosac
problemsolvingtime
sacfactor

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:41:07 -08:00
jan Iversen
53958a50c6 desktop-widgets: replace var plannerModel -> plannerShared converted
variables
min_switch_duration
are not set in diveplanner.cpp, but instead
signals a slot in plannerModel.
and are read from plannerShared which includes a conversion

change signals to slots in plannerShared
change read from prefs. to plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:40:08 -08:00
jan Iversen
5b9014aeb7 plannerShared: add variables from plannerModel with conversion
the variables are set through set functions in DivePlannerPointsModel,
but read via getters from qPrefDivePlanner and converted

Variables:
min_switch_duration

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:39:58 -08:00
jan Iversen
316e56f4f7 desktop-widgets: replace vars. qPrefDivePlanner -> plannerShared
change local doo2breaks to plannerShared and update connect.

change signals to slots in plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:39:49 -08:00
jan Iversen
0a7e673c5f plannerShared: add variables that reference qPrefDivePlanner
These are simple pass-through functions (normally optimized away
by the compiler), and serve to make a consistent backend interface
which have a simpler use especially in QML.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:39:39 -08:00
jan Iversen
5063431263 desktop-widgets: replace variables from plannerModel to plannerShared
variables
drop_stone_mode,
last_stop,
switch_at_req_stop
are not set in diveplanner.cpp, but instead
signals a slot in plannerModel.

change signals to slots in plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:39:30 -08:00
jan Iversen
6f3d1d3747 plannerShared: add variables from plannerModel
the variables are set through set functions in DivePlannerPointsModel,
but read via getters from qPrefDivePlanner.

Variables:
drop_stone_mode
last_stop
switch_at_req_stop

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:39:17 -08:00
jan Iversen
df6f01a6f6 desktop-widgets: replace vars. qPrefDivePlanner -> plannerShared
change local setBailout to plannerShared and update connect.

change signals to slots in plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:39:05 -08:00
jan Iversen
87f680f5e7 desktop-widgets: replace variables from plannerModel to plannerShared
planner_deco_mode is not set in diveplanner.cpp, but instead
signals a slot in plannerModel.

reserve_gas is not set in diveplanner.cpp, but instead
signals a slot in plannerModel.

change signals to slots in plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:38:51 -08:00
jan Iversen
8d322218a8 plannerShared: add variables that reference qPrefDiveplanner
These are simple pass-through functions (normally optimized away
by the compiler), and serve to make a consistent backend interface
which have a simpler use especially in QML.

Variables:
dobailout

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:38:40 -08:00
jan Iversen
b877dd973c plannerShared: add variables from plannerModel
the variables are set through set functions in DivePlannerPointsModel,
but read via getters from qPrefDivePlanner.

Variables:
planner_deco_mode
reserveGas
safetyStop
gflow
gfhigh
vpmb_conservatism

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:38:27 -08:00
jan Iversen
d90a2ca008 build-system: add missing models for iOS build
Append missing models to Qt creator project

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:38:08 -08:00
jan Iversen
da38b84bc8 build-system: add diveplannermodel to Mobile
add diveplannermodel to GENERIC instead of DESKTOP

as a consequence other models are need, move those
from DESKTOP to GENERIC

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:37:39 -08:00
jan Iversen
63d676d9e4 qt-models: conditionally compile Commands:: in diveplannermodel.cpp
commands (undo) are not available for mobile, but diveplannermodel
is needed

add #ifndef MOBILE around Commands::

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 08:37:25 -08:00
jan Iversen
9c74ac23a5 mobile-widgets/qml: remove console messages
Remove console.log messagees used to test the
split of startpage/divelist.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27 01:29:30 +09:00
Dirk Hohndel
3dbdd2ee5e mobile UI/login: fix PIN entry page
In commit a4d299e01e ("mobile-widgets/qml: use showPin/oldStatus consistently")
one instance of rootItem.showPin wasn't replaced with prefs.showPin and as a
result we had a very strange password entry line in the middle of the PIN entry
screen.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:15 -08:00
jan Iversen
611c4bb088 mobile UI/login: move startpage to main
StartPage does not belong in divelist.

Remove startPage from diveList and anchor in main.

Make needed functional changes.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:15 -08:00
jan Iversen
11810d5d06 mobile UI/login: remove startpage dependency in divelist
DiveList should not depend on StartPage, so remove references to
startPage.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:14 -08:00
jan Iversen
b83dcc4b25 mobile UI/login: make divelist a proper object in main
Instanciate DiveList like all the other pages.

Move DiveList properties set in main to DiveList.qml

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:14 -08:00
jan Iversen
4687de8c82 mobile UI/login: clean startPage/setupActions from Divelist
setupActions() in StartPage contained a mixture of StartPage
actions and DiveList actions.

Split setupActions to be pure.

However currently StartPage is embedded inside DiveList so the
action onVisibleChanged must be simulated.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:13 -08:00
jan Iversen
d1bee58dad mobile UI/login: move onCompleted actions to main
manager.finishSetup() have nothing to do with startpage/divelist,
but belong in main (seeing main as responsible for setup and window layout).

Move onCompleted functionality to main.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:11 -08:00
jan Iversen
48bae80577 mobile UI/login: remove cloudPassword from QMLPrefs
cloudPassword is no longer used as a temporary variable

Remove cloudPassword from QMLPrefs.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 10:24:41 -08:00
jan Iversen
5af7727ad0 mobile UI/login: replace use of cloudPassword
Replace prefs.cloudPassword with PrefCloudStorage.cloud_storage_password in QML

Replace QMLPrefs.....cloudPassword with PrefCloudStorage::cloud_storage_password in C++

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 10:24:15 -08:00
jan Iversen
a97cc83458 mobile UI/login: remove cloudUserName from QMLPrefs
cloudUserName is no longer used as a temporary variable.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 10:23:11 -08:00
jan Iversen
ac28896a5d mobile UI/login: replace use of cloudUserName
Replace prefs.cloudUserName with PrefCloudStorage.cloud_storage_email in QML

Replace QMLPrefs.....cloudUserName with PrefCloudStorage::cloud_storage_email in C++

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 10:22:39 -08:00
jan Iversen
4b713ece96 mobile UI/login: do not revert to old credentials.
If the user asked to change credentials it is equivalent to a signout,
so no need to store old credentials. This simplification allows removal
of the temporary credentials in qmlPrefs.

this commits secures the user is locked in the login page, until one
of 3 things happen:

- enter verified credentials (divelist is loaded from cloud)
- select no-cloud mode (divelist is loaded from local)
- enter new credentials, PIN page shows, enter PIN or
  cancel (back to enter credentials).

This is consistent even if the program is restarted.

Old version had a non consistent way:
A user enters new credentials,
  sees the PIN screen,
  but does not receive the email immediately,
  so works with other applications (causing the mobile app to close)

Having received the email with the PiN,
  the user starts mobile again,
  BUT does not see the PIN screen, instead the old credentials are used.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 10:17:45 -08:00
jan Iversen
9117aa2a52 mobile-widgets: make saveCredentials() an atom
Call saveCredentials with username/password to avoid first
setting the two and then calling.

Change saveCredentials() to use newUser, newPassword.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-25 03:15:52 +09:00
jan Iversen
e92dbe7974 mobile-widgets/qml: clean whitespace in main.qml
Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-25 03:15:52 +09:00
willemferguson
6212bb6721 Preferences UI: final cleanup
This commit does some final cleaning up to the code, mostly deleting
white space and comments.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00
willemferguson
42a85dfa7e Preferences: add some tests
Write a test program to test the log tab in the preferences main menu
I am a bit skeptical about the accuracy of the last section that
delas with testing signals.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00
willemferguson
75b5be8f40 Preferences UI: add reset tab
Add a separate preferences tab for resetting all preferences to their default values.
One or two very small alterations to other sections of the preferences UI code.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00
willemferguson
b6c3cdb20c Preferences UI: add dive log tab
This adds a tab for dive log - related preferences.
A suitable test programs is still required.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00
willemferguson
b24caa4e2d Preferenced UI: add dive download tab
Add a preferences tab for dive download, allowing resetting the
buttons representing download connections in the Download panel.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00
willemferguson
f63f3eb4ae Preferences: Create a test program for qPrefMedia
This is a companion for the new Media tab in the Preferences UI

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00
willemferguson
2ac279d129 Pereferences UI: add media tab
Remove the preference settings dealing with thumbnails (currently under
General preferences and Profile preferences) and put them in a newly-created
Media preference tab.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00
willemferguson
3e853e37a5 Preferences UI: create new equipment tab
Remove the "Show unused cylinders" checkbox (Profile tab) and the
"Set default cylinder" qTextEdit box (General tab) and put them in a
separate and new Equipment tab. This sounds like a simple task but,
as can be seen from the files changed, was actually a complex matter.
Adapt the existing test programs (General and TechDetails) for creating
a test program that tests parts of the Equipment tab.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00