aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-02-11Cylinders: Add CylindersModelFilteredGravatar Berthold Stoeger
When the show_unused_cylinders flag is not set, the cylinder tables in the equipment tab and the planner should not show unused cylinders. However, the code in CylindersModel is fundamentally broken if the unused cylinders are not at the end of the list: The correct number of cylinders is shown, but not the correct cylinders. Therefore, add a higher-level CylindersModelFiltered model on top of CylindersModel that does the actual filtering. Some calls are routed through to the base model (notably those that take indexes, as these have to be mapped), for some calls the caller has to get access to the source model first. We might want to adjust this. For filtering, reuse the already existing show_cylinder function and export it via CylindersModel. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-11Cleanup: make CylindersModel::updateBestMixes non-slotGravatar Berthold Stoeger
This was not used as a target of a connection anywhere. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-11Cleanup: remove filterSelectedDives function in divetripmodel.cppGravatar Berthold Stoeger
The last users of the returned vector were removed in commit e1abf9485cf59f1b8cb79d827fa386af48f095a4 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-11Filter: update filter if any of the string-modes changedGravatar Berthold Stoeger
Simply hook the corresponding signals to the update-filter slot. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-11Filter: implement starts-with and exact modesGravatar Berthold Stoeger
Currently, we do substring search. Implement starts-with and exact mode (for example when search for "Cave vs. Cavern" tags). For each textual search criterion add a combo-box. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-10build-system/coverity: it seems silly to need both wget and curlGravatar Dirk Hohndel
But hopefully with this we'll get the Coverity scans back. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-10mobile/summary: remove some debug outputGravatar Dirk Hohndel
I don't think we need that anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-10mobile/summary: expand refresh buttonGravatar Dirk Hohndel
Buttons ignore the width of the enclosed label and base their width on the illogically named implicitWidth instead. Also translate the button text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-10mobile/summary: more UI fine tuningGravatar Dirk Hohndel
Creating more space for the header column and a little visual separation for the different sections. The commit is much smaller than it looks - try 'git show -w'. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09build-system/iOS: don't build libdivecomputer inside the source treeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09buils-system/iOS: change confusing variable nameGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09mobile UI: fix font size breakage on AndroidGravatar Dirk Hohndel
The pointSize() of a font can return -1 if the font was originally specificied with a pixelSize. Work around this by using QFontInfo to calculate the correct value. Additionally, don't use the pointSize() of a font when we can instead use the calculated size. This fixes the problem with the missing star ratings on Android. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09documentation: remove reference to the building page on the Subsurface websiteGravatar Jason Bramwell
Removed the reference and link to the building page on the subsurface website (https://subsurface-divelog.org/building) from CONTRIBUTIONG.md. This page no longer exists and gives a 404 error. I have looked for suitable alternate build/contributing instructions on the website and on github and can't find anything so i think best to just remove the broken link for the time being. If more comprehensive instructions exist in the future this will be simple to add back in. Signed-off-by: Jason Bramwell <jb2cool@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09Correct celcius/celsius typo in test divesGravatar Jason Bramwell
Corrected typos in three files: dives/Test.csv dives/TestComma.csv dives/APDLogViewer.csv Simply replaced the word celcius with celsius. Signed-off-by: Jason Bramwell <jb2cool@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09documentation: break git pull command into three separate commandsGravatar Jason Bramwell
The contribution instructions originally had the cd, git checkout and git pull all on one command this is not allowed and gave a syntax/command error. When I looked at the CONTRIBUTING.md file the commands were on three separate lines it was just the markdown backticks that were missing from showing up as three separate lines. I have simply wrapped each of these lines in its own backticks. Signed-off-by: Jason Bramwell <jb2cool@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09mobile UI: fix alignment issue in dive details viewGravatar Dirk Hohndel
The 'Map it' button could overlap with the dive number below, depending on font size. This fixes the issue. Reported-by: Peter Reinold <mcc.nash@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09Correcting typos of the word celsiusGravatar Jason Bramwell
Corrected typo of the word celsius in three files: core/import-csv.c core/divefileter.h mobile-widgets/qml/Settings.qml These were spelled as celcius but corrected these to celsius. The 'core files were just comments but the mobile-widgets file would be 'active' code. Reported by: tormento <turment@gmail.com> Signed-off-by: Jason Bramwell <jb2cool@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-09Cleanup: remove const bool parameters and return typesGravatar Berthold Stoeger
These just make no sense. Since the value is copied, it has no meaning to the caller whether the function can change the value (and vice versa for return types). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-09Cleanup: only use necessary includes in exportfuncs.hGravatar Berthold Stoeger
Forward declare if possible. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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>