summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-02-09Cleanup: remove exportFunc classGravatar Berthold Stoeger
exportFunc was a collections of functions for exporting dive data. It had no state, therefore there is no reason for it to ever be instantiated. Simply remove the class. Rename the saveProfile function to exportProfile so that all export functions start with "export". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-09Cleanup: Remove global QFuture from exportFuncsGravatar Berthold Stoeger
When exporting dives we show a message. The message is closed when the export is finished. This is coordinated by a QFuture. Instead of keeping a global QFuture in the export-code, pass it around as a local variable. This is supported according to Qt's documentation: "QFuture is a lightweight reference counted class that can be passed by value." and the source code indicates the same. Not only does this remove a global, it also makes the code more flexible: Now we could show one notification per export, for example. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08Dive list: be more careful on when updating the UI after selectionGravatar Berthold Stoeger
Fix two issues: 1) When narrowing the selection, we didn't get setSelection() calls. Only, when the user released the mouse button was the selection updated. Therefore, hook into the mouse-release- event and update the UI if the selection changed. 2) We updated the ui in setSelection(). However, this was called on mouse-move even if the actual selection didn't change. Therefore, compare selection before and after processing of the event and only refresh the UI if there are changes. Clearly, this can only be a quick stopgap solution and we should find out how to properly hook into the selection change machinery. Though see commit 4928c4ae0421193bbd371cb0924091a970489611 for the reason why we do things as we do them. Fixes #2595 Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08Cleanup: remove erroneous commentsGravatar Berthold Stoeger
Remove two erroneous comments stating that a function-local QSettings variable should not be static because it is initialized too early. Scoped static variables are initialized when execution first hits the statement. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08mobile UI: correctly determine the number of columns when screen size changesGravatar Dirk Hohndel
This also deals with a bug we had before where we didn't re-start the calculation for the various sizes from the assumption of 'at least 21 grid units'. Now you can rotate the device and the right thing will happen. Small warning - this checks the orientation of the screen, which is exactly what you want it to do on your device. When running mobile on desktop this may not be what you expect. Even if the window has a portrait aspect ratio, your screen is likely still landscape... so testing this feature in mobile on desktop mode is a bit harder... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08mobile/settings: add UI for single column preferenceGravatar Dirk Hohndel
This is placed in the Advanced section as I expect this to be rather unusual for people to enable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08core/settings: add new preference to limit number of columns on mobileGravatar Dirk Hohndel
The idea is that in portrait mode we can force the display to be single column (which makes sure that the profile in dive display mode is nice and big). This commit only implements the preference variable that we need for that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08mobile/summary: remove backend-share/divesummary.[h|cpp]Gravatar Berthold Stoeger
These were replaced by a model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08mobile/summary: use more intuitive time periodsGravatar Dirk Hohndel
No one will ask you about your dives in the last seven months (and the existing code actually provided the past 210 days in that case). Instead do more intuitive periods. Last month, quarter, half year, year. Use Qt's ability to make sane date calculations easy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08mobile/summary: improve the spacing of the contentGravatar Dirk Hohndel
Use more idiomatic ways to indent the rows, replace the TemplateLabel with a simple Label since drawing the extra rectangle for the background of the TemplateLabel is obviously redundant and using it doesn't change the number of properties we need to set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08mobile/summary: correctly align text to vertical centerGravatar Dirk Hohndel
I keep forgetting that the verticalAlignment is only within the current object, which means that in a single line label it has no meaning at all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08mobile/summary: add refresh buttonGravatar Berthold Stoeger
On tablet devices, the summary page stays open and therefore the summary is not refreshed. For now, add a button. Later, this should be connected to signals when dives are edited, added or deleted. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08mobile/summary: add section headersGravatar Berthold Stoeger
Add section headers to the dive summaries on mobile by adding a section-property. Of course, this will not work on desktop. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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: create DiveSummaryModelGravatar Berthold Stoeger
Instead of passing the dive summary via a completely unstructured QStringList to QML, implement a dynamic model. For potential reuse on desktop (though somewhat unlikely) the model has two interfaces, one for QtWidgets and one for QML. The former is based on columns, whereas the later is based on roles. The number of columns is set dynamically. The roles currently support access to two columns. If more columns should be accessed from QML, more roles have to be added manually. This commit only creates the model and hooks it into QMLs global context, but does not yet change the QML page. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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-08Updates to user manualGravatar willemferguson
Add an image that was lost in the latest updates. Add text about checking of hand-entered coordinates. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
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-06Changes to user manualsGravatar willemferguson
Added text dealing with problems in user cloud registration and loss of password Other small edits and corrections to these texts. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-02-06Cleanup: don't initialize DivePlannerPointsModel at startupGravatar Berthold Stoeger
The whole point of having X::instance() functions is to solve the infamous "Static Initialization Order Fiasco": When having global objects in different translation units, their order of initialization is undefined. Thus, when these objects access each other one cannot guarantee the correct order of initialization. The X::instance() functions generate the objects on first use. DivePlannerPointsModel has such an instance() function. However, for convenience(?) in diveplanner.cpp we find the global variable static DivePlannerPointsModel* plannerModel = DivePlannerPointsModel::instance(); Thus, the DivePlannerPointsModel constructor is run before main(), negating the whole purpose of the instance() function. Let's remove this line to avoid hard-to-debug startup issues. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-06Gps coordinates: be more graceful when parsing coordinatesGravatar Berthold Stoeger
Some Wikipedia pages use special (non-ASCII) unicode symbols for representing the " and ' separators. Before parsing, replace these by the ASCII symbols to enable copy & paste from Wikipedia (and other sources?). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-06Dive site: don't save invalid GPS coordinatesGravatar Berthold Stoeger
On the dive site screen, when entering invalid GPS coordinates, we cleared the location of the dive site. Don't do this. To clear the location, the user now has to enter the empty string. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-06Dive site: give visual clue for invalid coordinatesGravatar Berthold Stoeger
On the dive site edit screen, when the user enters invalid coordinates and saves, we treat this as "no location". This is rather unfriendly, therefore warn the user with a visual clue. This is performed by setting the background color of the widget to red. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-06Coding style: remove braces around single-line if blocksGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-06Coding style: move & from type to variableGravatar Berthold Stoeger
Trivial white-space cleanup according to coding style document. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-06CSV import: fix importing ampersand characterGravatar Miika Turkia
As we do XSLT parsing for the CSV import, ampersand characters need to be encoded with &amp; for the parsing to succeed. Fixes #2037 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-02-05GitHub Actions: convert Coverity build to using container as wellGravatar Dirk Hohndel
Same build failures as we had with the other Bionic based build. 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-04Dive site: ignore dive sites without location in proximity searchGravatar Berthold Stoeger
When editing a dive site, the user can search for close dive sites to merge duplicates. Dive sites without location are treated as being located at 0N0E. This makes no sense, because: When selecting a dive site without location, we shouldn't list dive sites close to 0N0E. Likewise when having a dive site close to 0N0E, we shouldn't list dive sites that have no location. Therefore, ignore these cases. This also means that now dive sites without location are not considered as close to other dive sites without location. That might be a debatable point. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>