aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2020-04-30cleanup: remove DivePlotDataModel::diveIdGravatar Berthold Stoeger
Nobody was using that member variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-30desktop: don't replot profile when populating dive information tabGravatar Berthold Stoeger
When the dive mode is changed, the profile has to be replot. This is by a function of the TabDiveInformation. However, that function was also executed when populating the tab. Thus, when changing dive, the profile was plot twice. Move the profile plotting out of the function. Ultimately, the profile should listen to the appropriate signals itself. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-30Github Actions: don't bundle mac appGravatar Dirk Hohndel
There's no point in doing that since the app directory this creates is broken on older macOS versions, anyway (and we create a working DMG through a webhook). Additionally, lately this has started to fail on GitHub, so let's just rip this out. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-27README.md: fix typo in system requirementsGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2020-04-27profile: set empty state when there is no current dive to showGravatar Berthold Stoeger
The profile data was not properly cleared when not showing a dive. Fixes #2787 Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-27cleanup: remove unused function get_divepoint_gas_string()Gravatar Berthold Stoeger
The last user was removed way back in commit 9fbd11744f1bfffbc6973e0f9483ae1630dd8722. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-27build-system/Android: add missing install-qt.shGravatar Dirk Hohndel
This file is copied from the QBS project. It's under LGPL and therefore compatible with our licensing. While it would be possible to retrieve this file at build time from the original project, for now it seemed easier to include it in our repo. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-27GitHub Actions: we can't have an action with no on: clauseGravatar Dirk Hohndel
So in order to disable an action, I'll just use an unused repository_dispatch. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-27Revert "map: remove selectedDivesChanged"Gravatar Jan Mulder
This reverts commit cd474996948b7592ab2973b7f936320a663a914e. The signal removed in the reverted commit was used in Subsurface-mobile. So removing it, caused a not running app. Signed-off-by: Jan Mulder <jan@jlmulder.nl>
2020-04-26move GitHub url to the Subsurface orgGravatar Dirk Hohndel
Instead of using the Subsurface-divelog user on GitHub, we now use an org that was generously donated to us. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-26selection: replace selectedTrips() by singleSelectedTrip() functionGravatar Berthold Stoeger
To check wether the tab widgets should show the trip view, they called the selectedTrips() function. The trip view was shown if that contained only one trip. However, the selectedTrips() function was very slow, because it has to query to core models. Change the function to singleSelectedTrip(), which returns a trip if there is exactly one trip selected. The function returns early if there is more than one trip selected. This makes the select-all case much faster. There are two cases which are still very slow: - List mode, because here all top-level items are queried. - Dive log with many only top-level items. Ultimately, we will have to cache the trip selection because querying the model is too slow. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-26desktop: select dives at onceGravatar Berthold Stoeger
The old code would call QItemSelectionModel::select() once for every dive. Instead collect the selection in a QItemSelection and only call QItemSelectionModel::select() once. This makes selecting multiple dives significantly faster. The loop also expanded the trips with selections. This has now to be done in an extra loop. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-26dive list: don't access selected dives via indicesGravatar Berthold Stoeger
When determining the selected dive sites to highlight them on the map, the DiveListView code used the local indices of the selected dives. However, that was unreasonably slow. Even though a layering violation, let's access the core data structures directly. In my tests this improved from 700 ms to 0 ms! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-26cleanup: remove Command::inCommand()Gravatar Berthold Stoeger
This was used by the divelist to check wether a selection change is programmatical or user-initiated. However, since there is only one entry point for programmatical selection changes, this is not needed anymore. Remove it - this removes an inter-module dependency. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-26cleanup: make DiveListView slots privateGravatar Berthold Stoeger
It makes reasoning about code so much easier when one knows that functions cannot be accessed from the outside. Therefore, make a number of DiveListView slots private. Moreover, unslotize functions that never were used in connect calls. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-26selection: move test for programmatical selection changes to widgetGravatar Berthold Stoeger
The DiveListView widget has to differentiate between programmatical und user-initiated selection changes. It did so by using the DiveListNotifier::inCommand() flag. However, 1) There is only one point of entry for such selection changes, viz. the MultiFilterSortModel::selectionChanged() signal 2) This signal is not only emitted in command-context. Another source is for example dive-map selection changes. Therefore, move the programmatical-selection-change status down to the widget and set/reset it in the diveSelectionChanged() slot. This makes "select all visible dive sites" somewhat faster. Sadly, not as much as expected. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-25cleanup: make various functions in DiveListView privateGravatar Berthold Stoeger
Outside callers had no business calling these functions. Especially some functions that were simply there to override default DiveListView behavior. Mark these as overridden. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-25cleanup: remove DiveListView::selectDives()Gravatar Berthold Stoeger
This was used by the map to select dives. However, the map now calls the core function directly, so this can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-25map: call set_selection() core function to select divesGravatar Berthold Stoeger
The map widget called the dive list to select dives. This is inconsistent and complex. The dive list has to call down to the core anyway. Therefore, change the code to call the common core function. This means that we have to transform integer ids into dive-pointers. That is a bit sad, because the dives were just transformed into indices. Let's address that in a future commit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>