aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
AgeCommit message (Collapse)Author
2020-02-08mobile/summary: remove dive summary calculationGravatar Berthold Stoeger
Since we now use a model to calculate the dive summary, there is no need to export recalculation of the dive summary via QMLInterface. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08mobile/summary: implement frontend code for the new summary modelGravatar Dirk Hohndel
Implements the ListView and its delegate to use the dynamic data provided by the DiveSummaryModel Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08mobile/summary: recalculate first and last dive on visibility changeGravatar Berthold Stoeger
Recalcluate not only the statistics for the given period, but also the global first and last dive date. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08mobile/summary: implement firstDiveDate and lastDiveDateGravatar Berthold Stoeger
Instead of transporting the global first and last dive date in the dive summary, calculate it in an external function. Since we already have time and date functions in qthelper.cpp implement those functions there. Provide a stub in QMLInterface so that QML can access these standalone functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08mobile: prevent crash adding divesGravatar Dirk Hohndel
When the cylinders became a dynamic data structure, a get_cylinder() call suddenly could return a NULL pointer. So use get_or_create_cylinder() for the first call when parsing the user's data. Also, deal with an oddity where the string lists look different because an empty list technically isn't the same as a list with one empty string. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-07mobile/notes-edit: ensure cursor stays visible editing dive notesGravatar Dirk Hohndel
This seems to work much more reliably as it specifically compares the cursor position to the visible bottom and top of the screen. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06mobile/settings: fix the width of cylinder drop downGravatar Dirk Hohndel
The GridLayout isn't part of a Layout, so set its width and have the combo box fill it's part of the grid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06mobile UI: set correct width for TeplatePageGravatar Dirk Hohndel
A page by default fits in a column. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06random white space fixGravatar Dirk Hohndel
QtCreator fixes that for me after every edit, I'm getting tired of manually removing those hunks. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06mobile UI: redo the screen size magicGravatar Dirk Hohndel
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>
2020-02-06mobile: comment out planner referencesGravatar Dirk Hohndel
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>
2020-02-06mobile/settings: correctly draw the size buttonsGravatar Dirk Hohndel
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>
2020-02-06mobile/settings: refer to the correct theme objectGravatar Dirk Hohndel
This was missed when switching object names. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06mobile/settings: white space cleanupGravatar Dirk Hohndel
Some odd empty lines and an unnecessary line break. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06mobile/settings: make the color swatches work as color swatchesGravatar Dirk Hohndel
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>
2020-02-06mobile/settings: correctly set label backgroundGravatar Dirk Hohndel
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>
2020-02-06mobile/settings: remove confusing frame around column titlesGravatar Dirk Hohndel
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>
2020-02-04Cleanup: remove capture-all lambda clausesGravatar Berthold Stoeger
These were forgotten the last time. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-03mobile-widgets: switch to new subsurfaceThemeGravatar jan Iversen
Remove subsurfaceTheme from main.qml Replace ThemeNew -> subsurfaceTheme change registration ThemeNew -> subsurfaceTheme Signed-off-by: jan Iversen <jan@casacondor.com>
2020-02-03mobile-widgets/qml: secure subsurfaceTheme.initial*Gravatar jan Iversen
move initialWidth/initialHeight out of subsurfaceTheme to placeHolder, this secures no change in behaviour. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-02-03mobile-widgets/qml/settings.qml: show all colorsGravatar jan Iversen
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>
2020-02-03mobile-widgets/themeinterface: make most part staticGravatar jan Iversen
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>
2020-02-03mobile-widgets/qml: use new templates in converted pagesGravatar jan Iversen
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>
2020-02-03mobile-widgets/qml: add TemplateButtonGravatar jan Iversen
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>
2020-02-03mobile-widgets/qml: add TemplatePageGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2020-02-04Cleanup: rename plannerShared to PlannerSharedGravatar Berthold Stoeger
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>
2020-01-31Cleanup: remove QMLInterface::instance()Gravatar Berthold Stoeger
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>
2020-01-31Cleanup: connect QMLInterface signals in constructorGravatar Berthold Stoeger
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>
2020-01-30mobile-widgets/qml/divesummary.qml: detect change in unitsGravatar jan Iversen
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>
2020-01-30mobile-widgets: emit signals for each colorGravatar jan Iversen
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>
2020-01-30mobile-widgets: correct empty linesGravatar jan Iversen
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>
2020-01-30mobile-widgets/qml: move fontMetrics to ThemeTestGravatar jan Iversen
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>
2020-01-30mobile-widgets: do not use fontmetric for heightGravatar jan Iversen
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>
2020-01-30mobile-widgets: move font property to themeInterfaceGravatar jan Iversen
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>
2020-01-30mobile-widgets: move basePointSize to themeinterfaceGravatar jan Iversen
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>
2020-01-30mobile/dive summary: rewrite statistics codeGravatar Dirk Hohndel
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>
2020-01-29mobile-widgets/qml: Fix Kirigami error.Gravatar jan Iversen
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>
2020-01-28mobile-widgets/qml: add icon to dive summary entryGravatar jan Iversen
Add sigma icon to menu entry "dive summary". Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-28mobile icons: add sigma svgGravatar jan Iversen
Add svg sigma to be used for dive summary. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-28mobile-widgets: add dive_mode variable to QMLGravatar jan Iversen
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>
2020-01-28mobile-widget/qml/Settings.qml: correct theme switchesGravatar jan Iversen
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-28themeinterface: move registration to themeinterfaceGravatar jan Iversen
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-27mobile-widgets/qml: integrate DiveSummary in menu.Gravatar jan Iversen
Add DiveSummary to globalDrawer Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27mobile-widgets/qml: add DiveSummary.qmlGravatar jan Iversen
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-27divesummary: add DiveSummary class to shared and backendGravatar jan Iversen
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-27mobile-widgets/qml: add background color propertyGravatar jan Iversen
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-27mobile-widgets/qml: correct spelling errorGravatar jan Iversen
Correct spelling error in TemplateTitle. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-26code cleanup: whitespace cleanupGravatar Dirk Hohndel
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-26code cleanup: QLatin1Literal is deprecated in Qt 5.14Gravatar Dirk Hohndel
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-26mobile-widgets/qml: integrate ThemeNew in qmlGravatar jan Iversen
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>