This still is way to fragile. Ordering of object completion doesn't appear
consistent. Hopefully bringing the properties all into one (now reasonably
named) object will help.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I don't expect this to be complieted. I'll keep it in the tree
for the moment, but expect to remove all of the related code
eventually.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With the columnSpan 3 (in a grid with only two columns) they were drawn
on top of the drop down for the theme.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In a color swatch the color of the body of the swatch is the one that
matters. And we need to ensure readability. So for each pair of colors,
use the combination in the regular order (color/textcolor) for the
background swatch, and inverted for the text swatch.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The TemplateLabel comes with a set background color which creates a very odd
effect and makes the text generally unreadable in the color swatches.
Fix this by matching the color of the parent rectangle.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These are not color swatches like the rest, these are the column titles, so
don't draw them the same way as the color swatches.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
move initialWidth/initialHeight out of subsurfaceTheme to placeHolder,
this secures no change in behaviour.
Signed-off-by: jan Iversen <jan@casacondor.com>
Show all colors in a theme, allowing user to change theme.
This is preparation for allowing users to click on the individual
colors and change them.
Signed-off-by: jan Iversen <jan@casacondor.com>
Make variables and functions static where possible, this is done
to prevent different versions of theme with different values.
Signed-off-by: jan Iversen <jan@casacondor.com>
Use the TemplatePage and TemplateButton in the converted pages.
In order to avoid a bigger search/replace all other pages are left
untouched (for now).
Signed-off-by: jan Iversen <jan@casacondor.com>
Do "git mv SsrfButton TemplateButton", and search/replace
all uses.
The general idea of the templates are to secure common layout,
but also to isolate the Kirigami parts (slowly) in the templates.
Signed-off-by: Jan Iversen <jani@apache.org>
Usually, we use PascalCase (i.e. camelCase with a capital
letter at the start) for class names. For consistency, let's
do it here as well.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
QMLInterface::instance() is only used in one single place. This
makes the whole notion of having a global instance of the object
moot, isn't it?
Simply make the object static to the function that uses it, which
guarantees that the object will be created when the function is
called. I.e. the same behavior is retained with less complexity.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
It appears weird to connect the QMLInterface signal/slot combination
in a static helper function. This generates a bunch of lambdas that
call the instance() function.
Instead, simply do the connections in the constructor as we do it
in numerous other places.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When either length or volume unit is changed, the text needs to be
changed.
Let signal lengthChanged and volumeChanged cause a recalcation and therefore
new text.
Signed-off-by: jan Iversen <jan@casacondor.com>
Emit signals for each standard color when theme changes.
The iconStyle property was changed from being a constant, because it can
change, and thus a signal was added.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove extra empty lines in themeinterface.cpp just a cleanup, no functionality
change.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
fontMetrics is no longer used in production code, but still in the theme test
page.
Isolate fontMetrics in ThemeTest page.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to remove fontMetrics from QML, replace references (height)
in DownloadFromDiveComputer and Settings
Add include kirigami as needed
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move setting of font properties used throughout to themeInterface.
Add new settings "currentScale".
The properties are kept in main (subsurfaceTheme) in order not to do
a big search/replace.
Update settings to use currectScale and signal changes in themeinterface.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Check defaultfont and calculate basepointsize in themeinterface instead
of in QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There were quite a few issues with the code - clearly a complete failure of
code review.
- all values were '??' if a period contained no dives
- imperial units were not calculated at all
- significant truncation and data loss in the way totals were added as meters
and minutes instead of the higher precision data that is available
- several issues in striing conversion methodology, e.g. missing zero padding
for minutes
- missing maxSac
- incorrectly calculated avgSac
- incorrectly claculated number of EANx dives
- hard to read code with most variables named 'temp'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Solve kirigami error:
INFO: qrc:/org/kde/kirigami/ScrollablePage.qml:187: TypeError: Cannot assign to read-only property "parent".
Kirigami.scrollPage does not allow a ListModel be defined, even though it is allowed in QtQuick.
Signed-off-by: jan Iversen <jan@casacondor.com>
Add dive_move variable to qmlinterface, to make it aviable to QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add bottompo2, decopo2 and bestmixend to QMLInterface
Bestmixend in gas options changing with
meter/feet
Signed-off-by: jan Iversen <jan@casacondor.com>
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>
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>
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>
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>
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>
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>
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>
For METRIC and IMPERIAL, show the radiobuttons disabled
For PERSONALIZED, allow user to select individual units.
Signed-off-by: jan Iversen <jan@casacondor.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
default_cylinder was moved from PrefGeneral to PrefEquipment,
but Settings was not updated
update Settings.
Signed-off-by: jan Iversen <jan@casacondor.com>
When changing METERS <-> FEET, the text change automatically
between "m/min" and "ft/min".
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Do not use a.set_b(value); it works, but it introduces yet another way of using
the QML/C++ interface, furthermore the function might not be called set_b in
some future, which is the reason the function is define in Q_PROPERTY
Use a.b = value, that respects Q_PROPERTY, and is slightly more performant,
most importantly it's like all the other settings so noone starts wondering why
this is special.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set the text of ascent/descent rates.
This shows the correct speed units when the user switches between metric and imperial.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
but the proper way, as a direct check on
PrefCloudStorage.
This secures PrefCloudStorage is only tested once and not
n times. As a sideeffect it saves typing and control.
Signed-off-by: Jan Iversen <jan@casacondor.com>
(planning is excluded, due to not finished UI).
Connect all spinboxes with plannerShared.
This change allows live testing and compare with the desktop version.
Signed-off-by: Jan Iversen <jan@casacondor.com>
(planning is excluded, due to not finished UI).
Connect all checkboxes with plannerShared.
This change allows live testing and compare with the desktop version.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Switch oldStatus from qmlprefs to qmlmanager
This is the last use of QMLPrefs, which can later be safely removed.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
oldStatus() is kept in qmlPrefs during the login process to allow
for a couple of special cases:
- if a user have added dives in NO_CLOUD mode and changes to use the
cloud these dives are copied to the Cloud, instead of being lost.
- if a user does a bailout from the login process (this should not
happen anymore) the old status is restored.
The pure solution would be to have oldStatus at the top level (e.g.
a property in qml) and only change it when actually being in the
login process, however due to way the qmlmanager is written it proved
very difficult and not worth the effort.
In order to be able to remove qmlPrefs, oldStatus are moved to
qmlManager.
This commit only contain the creation of the variable and the supporting
code.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
prefs.showpin is the same as
PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY
but is actually implemented as a separate variable.
Removing showPin in order to limit use of QMLPrefs, which is the overall goal.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove no longer used function setCredentialStatus() from qmlprefs.
This is done to secure there are no missing setCredentialStatus calls
in the code.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
call setOldStatus() and set_filename().
saveCredentials() will adjust email and password.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This setCredentialStatus() will never do anything, because qPrefCloudStorage
is identical to prefs.cloud_verification_status, and can thus be
safely removed.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Revert to the divelist by setting oldStatus() directly to
set_cloud_verification_status()
This is done to further limit the use of setCredentialStatus() and
prepare to remove qmlPrefs.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update revertToNoCloudIfNeeded() to not use setCredentialStatus() by adding an
extra call to setOldStatus()
setOldStatus() is called in setCredentialStatus together with
set_cloud_verification_status() therefore these 2 calls need to added when
removing setCredentialStatus().
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
qmlprefs::setCredentialStatus() basically only does something when called with
CS_NOCLOUD.
A number of setCredentialStatus() calls happen where status cannot be
CS_NOCLOUD, and therefore setCredentialStatus() can be safely replaced with
set_cloud_verification_status()
This limits the use of qmlprefs::setCredentialStatus(), but there are still a
couple of more complicated calls.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace all credentialStatus() with cloud_verification_status()
Where both prefs.credentialStatus and
PrefCloudStorage.cloud_verification_status are being set, remove
prefs.credentialStatus.
These replacements are valid since credentialStatus() is a simple
envelope over cloud_verification_status().
Also remove qmlPrefs::credentialStatus() from qmlPrefs (mostly to ensure no
replacements was forgotten).
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove m_credentialStatus in qmlpref, but let the setter/getter
stay, using qPrefCloudStorage::cloud_verification_status()
instead.
This change ensures that qmlPrefs:credentialStatus() returns the
same as qPrefCloudStorage::cloud_verification_status(), and the
setter/getter of credentialStatus can later be removed safely.
This is a "checkpoint" to ensure everything works without a temporary
credentialStatus. No code part depend on the difference between
qmlPrefs::credentialStatus() and
qPrefCloudStorage::cloud_verification_status(), but the code reference
both.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove use of prefs. (apart from instanciating the object) in
main.qml
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the divelist is only visible if online/offline (CS_VERIFIED/CS_NOCLOUD),
there is no need to check that to enable "Add dive manually".
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manual sync was enabled both for CS_VERIFIED (online) and CS_NOCLOUD (offline)
and then in the trigger CS_NOCLOUD lead to a login screen, potentially
confusing the user.
Only enable manual sync with verified cloud credentials.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
prefs. is only important during the signin process, so use the standard
PrefCloudStorage variable
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
cloudPin does only have the values "" and NULL, so replace cloudPin()
with "" in csa->backend() call
remove setting of cloudPin to ""
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
cloudPin is only set to "" and NULL, therefore and "if" checking if
cloudPin is not empty will never have affect.
Remove else part.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move verifyCredentials() from public slots to private, eliminating
the need to MOC and making the C++/QML interface on function less
complicated.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add pin parameter to saveCredentials() thereby having all info about
credentials in one function call.
Add "" as pin in saveCredentials() - main.qml, when verifying
credentials.
replace verifyCredentials() with saveCredentials() in the register
button on the pin page.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
clearCredentials() was only called from one place (in the same file), copy
functionality and remove function.
It was declared as a public slot, so this saves a little bit of overhead too.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
cancelCredentialsPinSetup() is no longer used, so remove it.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Copy functionality from cancelCredentialsPinSetup() into Cancel in
CloudCredentials.qml, this is part of the general qmlprefs cleanup.
Remove rootItem.returnTopPage() since the user stays on this page
(sees credentials again).
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For now just copy the functionality into Settings.qml, this is part
of the qmlprefs cleanup.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These were again copied from the material design icon set and will be used to
differentiate the various help topics.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The global drawer already has a name that can be referenced. This was adding
confusion as now both names were used in the menu structure.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The user is most likely to find out, that he does not remember
the password, when asked for it.
Add "forgot password" button in the signin dialog
(both credentials and pin dialog).
Signed-off-by: Jan Iversen <jan@casacondor.com>
rightPadding seems defined in Kirigami and the default value
causes a binding loop.
set rightPadding directly.
Signed-off-by: Jan Iversen <jan@casacondor.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
WARNING: multi directory commit, needed to secure it builds.
move the core/exportfuncs.* to backend-shared.
update backend-shared/CMakeLists.txt to generate backend-shared lib
update CMakeLists.txt to include backend-shared lib in link process.
update ios project to reflect new directory
Signed-off-by: Jan Iversen <jan@casacondor.com>
Remove aliases for showPin/oldStatus and reference prefs.showPin/oldStatus directly.
showPin/oldStatus are "temporary" variables, that are not saved in settings,
so they easily be replaced
Signed-off-by: Jan Iversen <jani@apache.org>
In order to make the central CMakeLists cleaner and more consistent
add a CMakeLists.txt to mobile-widgets, like in other root directories.
Signed-off-by: Jan Iversen <jan@casacondor.com>
change prefs.cloudUserName to PrefCloudStage.cloud_storage_email.
This is slightly more effective (direct instead of indirect), and
reduces the use of prefs.
This is part of limiting the use of prefs. (which is a precessor to
qPref) to the login process, and ultimately remove it.
Signed-off-by: Jan Iversen <jani@apache.org>
set_default_cylinder is accepted, because it is defined in Qt Meta system,
however the call is never carried out, because the Q_INVOKE macro is missing
Change PrefGeneral.set_default_cylinder(...) which is a function call
to PrefGeneral.default_cylinder = ... which is a builtin assignment
Signed-off-by: Jan Iversen <jani@apache.org>
LOG_STP is on longer providing the data needed, since a lot of the startup
is indirectly in QML, furthermore using the xcode project and running profiler
gives much more detailed information
Signed-off-by: Jan Iversen <jani@apache.org>
Remove "TO BE IMPLEMENTED" and add call doUpload
Connect signal to signal in QMLManager to avoid registring the
upload class.
Signed-off-by: Jan Iversen <jan@casacondor.com>
When opening the saveAsDialog a second time, it contains
the last status from first time.
Clear statusText before calling saveAsDialog
Signed-off-by: Jan Iversen <jan@casacondor.com>
When using Connect, the context is switched, so close()
might or might not work.
Change unqualified close() to qualified uploadDialog.close()
Signed-off-by: Jan Iversen <jan@casacondor.com>
Handle reading/writing of userid/password settings in the
saveAsDialog and set field to visible when needed.
Activate divelogsde radio button
Signed-off-by: Jan Iversen <jan@casacondor.com>
Since we now have a selection.c translation unit, put the selection-
related functions there.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The current png generation is intertangled with the desktop
UI, and a shared Webservice needs to be developed.
Block Radiobutton
Signed-off-by: Jan Iversen <jan@casacondor.com>
The current Webservice implementation is intertangled with the desktop
UI, and a shared Webservice needs to be developed.
Block Radiobutton
Signed-off-by: Jan Iversen <jan@casacondor.com>
DiveFilter have 2 implementation on or desktop and one for mobile,
the common export function uses DiveFilter (desktop version).
Block Radiobutton
Signed-off-by: Jan Iversen <jan@casacondor.com>
All exports are to file except 2 which are upload to web.
Integrate standard qml filedialog for all exports (minus 2).
Signed-off-by: Jan Iversen <jan@casacondor.com>