aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-05-04Add test for profile dataGravatar Robert C. Helling
There was a TestProfile but that was a stub that did not test anything. We have an export function that serialises the profile data (including lots of derived data like deco information and cylinder pressure interpolation). So here is now a simple tests that can detect regressions in the profle. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-05-04Mobile user manual updateGravatar willemferguson
As the heading above says. two images changed. Short table of contents added. Add section on dive trip editing and dive list structure. Added links to video tutorials. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-05-04update README to reflect discontinued ci-release on GitHubGravatar Dirk Hohndel
The previous commit ended publishing current test binaries on GitHub. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-04GitHub Actions: stop creating CI releasesGravatar Dirk Hohndel
Net net this has caused more problems than it solved. Too often binaries were missing or broken. Instead 'release equivalent' binaries are now consistently posted to downloads/test via a Webhook. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-04Add conneciton for display variations checkboxGravatar Robert C. Helling
...this gat lost at some point. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-05-04Update changelogGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-04CSV import/export test: Add support for dive modeGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-04CSV export: include dive mode fieldGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-04CSV export: Add dive modeGravatar Miika Turkia
Include dive mode to exported dive detail CSV Closes #1588 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-04planner: on printing, restore textual plan using a saved stringGravatar Berthold Stoeger
When printing, the dive plan was prepended with a logo, a disclaimer and the profile. Then it was restored by setting the plan of displayed_dive. Instead, simply save the original plan in a QString and restore that. This removes a further dependency on displayed_dive, which I'd like to make local to the planner. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-04planner: remove conditional command-calls for mobileGravatar Berthold Stoeger
In the planner the undo commands for adding / editing dives were only called if not on mobile. This is from days were mobile didn't have undo commands. We can remove these now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-04desktop: remove unused if-branch in MainWindow::editCurrentDive()Gravatar Berthold Stoeger
MainWindow::editCurrentDive() used to be a general function to enter edit mode. Nowadays, this is only called for one very specific case, namely editing the profile of a manually added dive. Therefore, we can remove the if-branch that dealt with planned dives. Moreover, we can do the test right at the beginning and remove a warning message for duplicate "edition", as this is not possible anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-04Planner: fold MainWindow::setupForAddAndPlan into createSimpleDive()Gravatar Berthold Stoeger
There was only one caller of MainWindow::setupForAddAndPlan() left and that caller immediately called DivePlannerPointsModel::createSimpleDive(). Thus, we might just as fold the former in the latter and thus concentrate all the prepare-dive-for-plan business in one place. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-04planner: send plan in calculatedPlanNotesGravatar Berthold Stoeger
Thus, the MainWindow doesn't have to extract the plan from displayed_dive. This is a tiny step in an attempt to detangle the interfaces. The bigger goal will be to make displayed_dive local to the planner. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-04planner: update variations in planner not mainwindowGravatar Berthold Stoeger
When calculating variations, they were sent to the mainwindow, which updated displayed_dive accordingly. Do this directly in the planner-model. The idea is to detangle interdependencies and to make the code reusable (planner on mobile?). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03selection: create global single_selected_trip() functionGravatar Berthold Stoeger
The DiveListView had a singleSelectedTrip function that returns the selected trip if exactly one trip is selected. This could be very slow if numerous non-trip items were selected, because all the selection indices were back- translated by the proxy model. This could make selection changes very slow, because the MainTab used said function to determine whether it should show trip or dive data.. Indeed, with a 3500 dive test log, when selecting all dives in tree mode, the updating of the TabWidgets is sped up from 130 ms to 5 ms this commit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03selection: inform core of trip selection in DiveListViewGravatar Berthold Stoeger
When selecting / deselecting trips, keep the core updated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03selection: introduce clear_selection() functionGravatar Berthold Stoeger
The DiveListView would touch the selection-innards directly. Let's encapsulate that. Moreover, take care to reset the trip selection when resetting the core data. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03selection: add selection flag for tripsGravatar Berthold Stoeger
In analogy to dives add a selection flag for trips. The reason being that search for a selected trip can be painfully slow when we do it through Qt's proxy model. Make sure to deselect trips when they are removed from the core. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03cleanup: don't explicitly clear tabs in MainWindow::selectionChanged()Gravatar Berthold Stoeger
When there is no current dive, mainTab->updateDiveInfo() implicitly clears the tabs. There is no need to call this explicitly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03profile: don't interpret NULL as current_dive in plotDive()Gravatar Berthold Stoeger
ProfileWidget2::plotDive() had this weird interface, where passing in NULL as dive would mean "show current_dive". However, most callers would already pass in current_dive. Therefore, unify and always pass in current_dive if the caller wants to draw the current dive. This allows us to interpret NULL as "show empty profile". Thus, passing in current_dive when there is no current_dive simply shows an empty profile. This makes the calling code in MainWindow::selectionChanged() simpler. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03profile: use member-to-function style connect() statementsGravatar Berthold Stoeger
This makes things compile-time instead of run-time checked. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03profile: remove outside callers of ProfileWidget2::replot()Gravatar Berthold Stoeger
There was a mix of ProfileWidget2::replot() and ProfileWidget2::plotDive(current_dive, true), which is equivalent. Since there was more of the latter and it is more flexible, unify on that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03cleanup: remove parameter to ProfleWidget2::replot()Gravatar Berthold Stoeger
Firstly, the parameter appears conceptually wrong, as replot suggests that the currently shown dive is replot. Secondly, the only caller that passed a parameter was passing in current_dive, which is just what happens if one doesn't pass a parameter. Therefore, change that caller (call plotDive directly) and remove the parameter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03desktop: ask user when quitting application while planningGravatar Berthold Stoeger
We used to cancel a plan (or profile edit) when the user quit the application while planning. This is inconsistent with respect to closing or opening a different log, where the user was asked for confirmation. Thus, for consistency and to avoid loss of a planned dive, use the okToClose() function in on_actionClose_triggered() of MainWindow. As an added bonus, this saves a few SLOC. Fixes #1078 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-03mobile: update version to 3.0.6Gravatar Dirk Hohndel
This is needed to be able to push new betas into the AppStores. I keep forgetting to do that after I do a mobile release. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02pull latest translations from Transifexv4.9.4Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02add random helper scriptsGravatar Dirk Hohndel
These are all kinda weird but I use them when creating releases, so it seems to make sense to add them to the repo. I don't think they are useful to anyone but me, but in the event someone else takes over, they might be a useful starting point. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02update README for 4.9.4Gravatar Dirk Hohndel
This tweaks the language about where to find the latest binaries, as some of them are also under downloads/test and in the OBS repos. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02ReleaseNotes for 4.9.4Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02documentation: update list of supported dive computersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02Update translation source stringsGravatar Dirk Hohndel
Also pull latest translations from Transifex. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-02cleanup: remove unused function append_dive()Gravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-02desktop: fix editing of tripsGravatar Berthold Stoeger
In 2021035cfcee08ec4c6f9d16683db8ce400bef30 a bug was introduced: currentTrip of MainTab was not set in trip mode. Thus, when editing the trip notes, the notes of all selected dives were edited instead. Set the member variable and not a local variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-02cleanup: remove unnecessary include in command_divelist.cppGravatar Berthold Stoeger
"code/display.h" needs not be included anymore for selection things. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01profile: properly update lastgasmix when populating eventsGravatar Berthold Stoeger
When populating the events of a profile, a pointer to the current gasmix was passed around to properly calculate isobaric_counterdiffusion. The DiveEventItem::setupToolTipString() function updated this gasmix when processing gas change events. I inadvertently broke the code when replacing gasmix-pointers by values. We could of course simply revert this part of the commit. However, the data flow was horrible anyway: for example is supposed that the setup functions were called in the correct order (i.e. DiveEventItem::setupToolTipString() is called after all other functions using the gasmix). Not exactly easy to follow. Therefore, keep passing around the gasmix as value to make it clear that the functions don't modify it. Keep the gasmix up-to-date at the caller's site in ProfileWidget2::plotDive(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: move declaration of utc_mk* functions to new subsurface-time.h headerGravatar Berthold Stoeger
No point in slurping in all of dive.h for translation units that only want to do some time manipulation without ever touching a dive. Don't call the header "time.h", because we don't want to end up in a confusion with the system header of the same name. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: remove includes from desktop-widgets/locationinformation.hGravatar Berthold Stoeger
Notably, there was a circular include locationinformation.h <-> importgps.h Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: only include QString in desktop-widgets/importgps.hGravatar Berthold Stoeger
This included QFile, which is fatter and not needed here. Include QFile only in the actual translation unit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: move dive_table from dive.h to divelist.hGravatar Berthold Stoeger
This allows us to decouple dive.h and divelist.h, a small step in include disentangling. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: move FRACTION macro from dive.h to units.hGravatar Berthold Stoeger
There appears to be no reason to slurp in all dive.h when compiling membuffer.c. units.h might not seem like the perfect place, but it is the most fitting I found. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: move DECOTIMESTEP from dive.h to planner.hGravatar Berthold Stoeger
Long-term project: reduce the size of dive.h Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: make enumerate_devices of external linkageGravatar Berthold Stoeger
For consistency: declare enumerate_dives as extern, since we do that for all other C-functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: make analyze_plot_info local to profile.cGravatar Berthold Stoeger
No external caller of this function exists. Moreover, turn the return type to void, as it only returned the passed-in plot_info and no caller used that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01cleanup: const-ify a few functions in planner.cGravatar Berthold Stoeger
It make debugging much easier if the function signature tells you that a parameter is not altered. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01profile: for maxtime calculation include the sample after the last eventGravatar Berthold Stoeger
When plotting profiles with surface segments, there were strange artifacts. As we found out with Robert, these were due to the fact that the calculated maxtime was set to the last event which is just one second inside the surface segment. This terribly confused the profile code. For example, it didn't properly allocate samples for the surface segment. Thus, when calculating maxtime, consider the last sample beyond the last event. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01profile: return air for one-past last cylinderGravatar Berthold Stoeger
This is the code for "surface air". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01core: create fake cylinder at end of cylinder table (hack!)Gravatar Berthold Stoeger
When we had fixed-sized cylinder arrays, the planner used the last empty cylinder for "surface air". This was not recognized by the UI as a separate cylinder, because "empty cylinder" was the sentinel for the end of the table. The conversion to dynamically sized cylinder tables broke this code: everytime the surface segment is changed, a new dummy cylinder is added, which is visible in the UI. As a very temporary stop-gap fix, emulate the old code by creating a cylinder and then setting the end-of-table to before that cylinder. This means that we have to loosen the out-of-bound checks. That's all very scary and should be removed as soon as possible. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-01core: always keep an empty cylinder at the end of the cylinder arrayGravatar Berthold Stoeger
This will be temporarilly used by the planner to mark consumption of air at the surface. Do this by creating a new function add_cylinder, which replaces add_to_cylinder_table() and takes care of always adding a dummy cylinder at the end of the table. Make the original add_to_cylinder_table() local, so that it cannot be accessed anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-30cleanup: replace Q_ASSERT by qWarningGravatar Berthold Stoeger
These two Q_ASSERTs made no sense - their expression (a string literal) always evaluated to true. A qWarning() was intended here. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>