Commit graph

16912 commits

Author SHA1 Message Date
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
jan Iversen
07c4d94f8a mobile-widgets/qml: add TemplateTextField
Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:50:10 -08:00
jan Iversen
93c3a18db7 mobile-widgets/qml: use strongly typed CloudStatus
Replace CloudStatus.<value> with backend.<value> as part
of making enum sharing between C/C++ and QML more robust.

Replace PrefCloudStorage.verification_status with
backend.verification_status to use the strongly typed function.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18 17:35:16 -08:00
jan Iversen
c93b76eee6 mobile-widgets: make cloud_verification_status type proof in QML.
Add CLOUD_STATUS enum to interface.

Add cloud_verifification_status variable to interface, and make
it strongly typed in QML.

using backend.cloud_verification_status = 1 will fail but
backend.cloud_verification_status = backend.CS_UNKNOWN is correct.

Added note to the original definitions of the enums that they have been
duplicated.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18 17:35:04 -08:00
jan Iversen
9105a4c39b mobile: register QML interface
call setup with registration of QML interface class

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18 17:33:15 -08:00
jan Iversen
fdc2fd35bf mobile-widgets: add pure interface for passing values to QML
Add a header file that contains a duplicate of the enums,
that are needed in QML in one class.
the unit enums are added imidiatly, since they are needed
or will be neede shortly in Settings and DivePlannerSettings

This class will also contain Q_PROPERTY and signal/slot for
variables used in QML. This is done to allow e.g.

deco_mode qPrefUnits::planner_deco_mode()
void qPrefUnits::set_planner_deco_mode(deco_mode)
as strongly typed in C++
and
DECO_MODE planner_deco_mode()
void set_planner_deco_mode(DECO_MODE)
as strongly typed in QML
Remark: wrong assignments gives errors in QML

The advantage over using strings or the value directly is that
QML detects typos and flags them as errors/warnings.

It is important to note that the class may only contain
a) a function call to the implementation
b) a reference to a global variable e.g. prefs.

Added note to the original definitions of the enums that they
have been duplicated.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18 17:31:58 -08:00
jan Iversen
fe8b7e3b72 mobile-widget/qml: add missing colors to dark theme
add missing colors so that dark theme contains the
same colors as "colors in use".

Update the darkTheme() to correctly copy colors from
pink theme

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
65a0a9c7eb mobile-widget/qml: add missing colors to pink theme
add missing colors so that pink theme contains the
same colors as "colors in use".

Update the pinkTheme() to correctly copy colors from
pink theme

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
f17aeb92e3 mobile-widget/qml: add missing colors to blue theme
add missing colors so that blue theme contains the
same colors as "colors in use".

Update the blueTheme() to correctly copy colors from
blue theme

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
5c2e08199f mobile-widgets/qml: secure block of used colors is correct
move contrastAccentColor, lightDrawerColor
to block of used colors in order to avoid confusion.

move darkDrawerColor to dark theme.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
bcfe505f09 mobile-widgets/qml: remove M126 warnings in main.qml
changed != --> !==
and == --> ===
to make QML happy.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
2d12d251b7 mobile-widgets/qml: columnWidth undefined
Remove reference to columnWidth, because it is
not defined in main.qml (subsurfaceTheme).

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
b25e791d13 mobile-widgets/qml: main reference qPrefGeneral.default_cylinder wrongly
change qPrefGeneral.default_cylinder -> qPrefEquipment.default_cylinder

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17 08:51:04 -08:00
jan Iversen
59d72474d6 mobile-widgets/qml: change PrefGeneral -> PrefEquipment
default_cylinder was moved from PrefGeneral to PrefEquipment,
but Settings was not updated

update Settings.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17 08:51:04 -08:00
jan Iversen
008f350dec core/settings: remove PrefClearDC because not used.
PrefClearDC was registred with the wrong object, but also
is not used.

Remove registration.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17 08:51:04 -08:00
jan Iversen
36b2014183 core/settings: correct copy/paste error.
The registration for several Pref* point at wrong C++ object,
correct the paste error.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17 08:51:04 -08:00
Dirk Hohndel
de846bad96 whitespace cleanup
Since writing the file with QtCreator in the previous commit
pointed all these out...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
e1cd055111 code cleanup: add empty table structures
It seemed to make sense to combine all three types in one commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
70cabb968c code cleanup: use explicit zero_location
Again, several different ways to achieve the same thing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
247194e839 code cleanup: use gasmix_air for zero initialized gas
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
c81693d023 code cleanup: consistently initialize zero duration_t
There were three different ways (two of which generated warnings) in a single
source file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
cef30619d0 code cleanup: introduce empty_cylinder constant
This deals with the issue of initializing structs in C++.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
4e419f7445 code cleanup: use setPath to set directory
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
e9dcac7514 code cleanup: replace use of toStdVector()
Frankly, I find the old API easier...

Also, replace toList() with values()

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
daf3821fcc code cleanup: replace created() with birthTime() for Qt >= 5.10
We still support Qt5.9 for now, so we need the version check as birthTime() wasn't
available in 5.9.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
e1dbf65672 code cleanup: replace deprecated member function QColor::dark()
dark() and darker() appear to have the same semantics.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
fa4208cc18 code cleanup: remove deprecated QString::null
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
d2ff40deb8 code cleanup: replace deprecated setAutoCompletion() functions
It's not even clear if we need the setCaseSensitivity() call as it appears
that a case insensitive completer is the default.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
24e02d878d code cleanup: remove unused member variable
It was initialized, but never referenced.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
57f5d4b784 code cleanup: replace deprecated fromStdVector() method
Replacement was only introduced in Qt 5.14

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
c3614040d9 code cleanup: ensure all fields are initialized
In a total abundance of caution, make sure we don't exit the constructor
leaving fields uninitialized.

Fixes CID 351437

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
2feb7077f8 code cleanup: add missing initialization
While technically the initial value of this variable makes no difference as
it is set when the first dive is displayed, technically Coverity is correct.

Fixes CID 353273

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
1f35b005fb code cleanup: remove unused QSignalMapper
Fixes CID #353274

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
daedffce2e code cleanup: replace deprecated setBackgroundColor() method
Here the replacement has been around for a very long time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
46441689b9 code cleanup: mark unused argument
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
e6210aafc5 code cleanup: initialize all elements in structure
This seems silly. I don't like that warning and would rather disable the warning.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
44ddb1411e code cleanup: use QElapsedTimer instead of QTime
Newer versions of Qt deprecate using QTime as a timer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
afd53be6f5 code cleanup: QFontMetrics::width() is deprecated
Qt5.11 introduced the suggested replacement QFontMetrics::horizontalAdvance().

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
jan Iversen
042799eb2a desktop-widgets: add comment why last SIGNAL/SLOT is not converted
The last SIGNAL/SLOT cannot be converted due to a limitation in the
new connect() syntax, it does not "understand" default parameters.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07 03:46:01 +09:00
jan Iversen
130fd9e8c2 desktop-widgets: replace connect() for CylindersModel.
Replace SIGNAL/SLOT in favor of new connect()

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07 03:46:01 +09:00
jan Iversen
9a78c29b47 desktop-widgets: replace connect() with parameter double.
Replace SIGNAL() with QOverload<double>::of() to allow
new connect syntax.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07 03:46:01 +09:00
jan Iversen
954c4c7289 desktop-widgets: convert last simple connect().
Convert the last convert() statements, that can be
converted just by changing the syntax.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07 03:46:01 +09:00