aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-11-27Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-26Update list of divecomputers supported in Subsurface-mobileGravatar Dirk Hohndel
There was some whitespace change as well - this is straight from the tool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-26Inform LocationFilterModel of added dive site nameGravatar Berthold Stoeger
If the user implicitly adds a dive site by editing a dive, and a location filter is active, check the new dive site in the location filter. This is done by informing the LocationFilterModel of the new dive site name prior to repopulation. The LocationFilterModel then adds a corresponding entry and marks it as checked. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26Inform LocationFilterModel of changed dive site nameGravatar Berthold Stoeger
Since commit 01d961086c1d175732c597dc9acdba7cc4cd2d26, the location filter list is updated if a dive site is edited. The problem is that if the name of a selected dive site is changed, the selection is lost. Therefore, before repopulating, inform the location filter that a dive site changed its name. The location filter then internally changes the name and can properly transfer the old selection on repopulate. This is performed via the new LocationInformationWidget::nameChanged signal, which is connected to the new LocationFilterModel::changeName slot. A special case to be handled is the following: [ ] Site 1 [x] Site 2 and "Site 2" being renamed to "Site 1", i.e. both sites being merged. Here, the merging is detected and "Site 1" will likewise be checked: [x] Site 1 [x] Site 1 No merging is performed, as the list will be repopulated anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26Simplify signal handling after dive site editingGravatar Berthold Stoeger
Since commit 01d961086c1d175732c597dc9acdba7cc4cd2d26, MainWindow::refreshDisplay() is called in the refreshDiveInfo() signal of maintab after editing a dive site. Since this was the only use of the refreshDiveInfo signal, remove this signal and instead connect to MainWindow::refreshDisplay directly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26Fix comparison function in qt-models/divelocationmodel.cppGravatar Berthold Stoeger
The function dive_site_less_than() in qt-models/divelocationmodel.cpp does not what it promises: it uses less-or-equal instead of less-than comparison. Note that, even though this may sound pedantic, this is an actual bug. Usually, sorting functions suppose that they are provided with strict weak ordering, which <= does *not* provide. This is the actual reason for the crash mentioned in commit f8a3a8521003a26525b658840ce8e7bfd3f7b141. While touching this function, make it of static linkage, since its usage is local to this translation unit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26Remove unused method LocationInformationModel::addDiveSite()Gravatar Berthold Stoeger
The call to this method was removed in commit f4c31f110fc98eb6d5d18c806e6b0f2ccc762d54 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26Remove redundant declaration of set_userid()Gravatar Berthold Stoeger
set_userid() was declared in core/dive.h and dektop_widgets/subsurfacewebservices.h. Remove the second instance because two declarations of the same function are a recipe for disaster. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-26In maintab clear location tags when selecting a dive w/o dive siteGravatar Stefan Fuchs
Until now when selecting a dive w/o dive site after having a previous dive with dive site and location tags displayed, the location tags of the previously selected dive where still displayed. This fixes this behavior. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25Update ReleaseNotesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-25Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-25Fix toggling of partial pressure graphsGravatar Berthold Stoeger
When toggling the display of the partial pressure graph, the graph was either not shown correctly or unnecessary ticks were left in the graph. Calling the settingsChanged() method of the profileYAxis object solves the problem by initializing the ticks according to the selected graphs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25Use equality instead of substring comparison in suits and buddy filterGravatar Berthold Stoeger
This commit is a continuation of commit 739b27427cfb5119eebe214c984843cd5d155620, in which a substring comparison was replaced by equality comparison to avoid confusing UI behavior of the filter interface. The suit and buddy filters were plagued by the same problem, so change their code in analogy. Fixes #551 (in conjunction with commit dd2466f51899aae406dc8c13904787710f30ec1c). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25In strings start lower case in parenthesisGravatar Stefan Fuchs
Start with lower case letter inside a parenthesis. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25In strings change tank to cylinderGravatar Stefan Fuchs
Change the word "tank" to "cylinder" or "cyl." in two occurences. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25In planner.c remove unused variable o2break_doneGravatar Stefan Fuchs
Reported-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25Refresh display if a dive site was editedGravatar Berthold Stoeger
Calls MainWindow::refreshDisplay() if a dive site was edited so that the filter lists are updated. The old call to updateDiveInfo() was removed because it is call implicitly in MainWindow::refreshDisplay() anyway. Fixes #675. Requested-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25Planner UI improvements: Enable/disable optionsGravatar Stefan Fuchs
Don't accidentally enable o2breaks option when entering planner in RECREATIONAL mode. Disable also label for min_switch_duration according to dive mode. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25Hand planner variables to profileGravatar Robert C. Helling
Pass the planner state struct to the profile computation so it can use deco_time and first ceiling to display VPM-B ceiling. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Localize global planner stateGravatar Robert C. Helling
For UI responsiveness, we need to be able to run the planner in the background. This needs the planner state to be localized (and we need to pass a pointer around). In order to not let too many lines overrun (and to save typing in the future) I have renamed instances of struct deco_state to ds. Yes this should have gone to a separate commit but I accidentally commit --amend'ed it. Computing of planner variations is temporarily disabled. Unlock the planner when returning early So we don't deadlock in add dive and recreational mode (which use the planner without actually planning). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Run variations calculation in backgroundGravatar Robert C. Helling
but there are still side effects and thus it crashes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Add logic parentheses to make compiler happyGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Update Subsurface-mobile version numberGravatar Dirk Hohndel
Should have done that right after the release. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-25Merge branch 'print' of https://github.com/neolit123/subsurfaceGravatar Dirk Hohndel
2017-11-25Update filters on refreshDisplay and remember old selecttionsGravatar Berthold Stoeger
Update the filters if the list of dives is updated by calling MultiFilterSortModel::instance()->myInvalidate(); This had the side effect of clearing all selections. Thus, in the repopulate() methods of the FilterModels, check those entries that were checked previously. Since all the filter models use the same code, introduce a base class FilterModelBase. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25Replace bool * array by std::vector<char> in MultiFilterInterfaceGravatar Berthold Stoeger
This replaces a dynamically allocated array of bool by std::vector<char>. 1) This makes the code shorter and less error prone, because memory management has not to be done by hand. 2) It fixes a bug in the old code: memset(checkState, false, list.count()) is wrong, because bool is not guaranteed to be the same size as char! Two notes: 1) QMap<>, QVector<>, etc. are used numerous times in the code, so this doesn't introduce a new C++ concept. Here, the std:: version is used, because there is no need for reference counting, COW semantics, etc. 2) std::vector<char> is used instead of std::vector<bool>, because the latter does a pessimization where a bitfield is used! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25LocationFilter: use equality instead of substring comparisonGravatar Berthold Stoeger
The location filter used a substring comparison, which had the side effect that dives with the location "Test 1" were shown when filtering for "Test 12". Moreover, avoid a deep copy of the location list. This is done by looping over one item less than rowCount() instead of removing the last item. While doing this, remove an unnecessary if-statement. This commit partially fixes #675. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25Fix crash when dives have no dive siteGravatar Dirk Hohndel
get_dive_site_by_uuid() returns a NULL pointer in that case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-25Release notes.Gravatar Jan Mulder
Autocomplete dive site name for mobile. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-25mobile: get GPS data from dive site nameGravatar Jan Mulder
When the user entered a dive site using autocompletion, it is a known site, of which we might have a GPS location already. Just fill the known site coordinates. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-25mobile: autocomplete location namesGravatar Jan Mulder
Add the capability to select the location name from a list, constructed from the known dive sites in the logbook. Fixes: #546 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-25Only call autogroup when it's enabledGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-25Fix ownership issues in preferences codeGravatar Berthold Stoeger
Each preferences object owns its string members. In three cases, pointers were copied instead of strings, leading to (in the best case) dangling pointers if the user edited values: 1) In the GET_TXT macro in core/prefs-macros.h 2) In the PreferencesDialog::defaultsRequested() method 3) In main() of the mobile version This patch fixes these issues, by using copy_string() or copy_prefs() as appropriate. The only reason that the old code didn't crash regularly is that the default_prefs object was only used at startup and defaultsRequested() is (at the moment?) dead code. This patch also aligns the backslashes in core/pref.h and fixes a typo. The declaration of copy_prefs() is moved to the core/prefs.h header. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25Cleanup: remove unused extern declarationGravatar Berthold Stoeger
Removes the extern declaration of edit_dive, which wasn't defined anywhere. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-24Travis: Mac: enable googlemaps againGravatar Dirk Hohndel
This should work now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-24Travis: Mac build prevent error out when not using libcurl/libssh2Gravatar Dirk Hohndel
This shouldn't be needed anymore since the Homebrew libgit2 is not linked against libcurl and libssh2. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-24build.sh: remove googlemaps .qmake.conf hackGravatar Dirk Hohndel
This needed to be fixed in googlemaps instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-24build.sh: don't use sed -iGravatar Dirk Hohndel
I can't seem to find a way to make this work on both Linux and Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-24Fix build without BT supportGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-24Travis: try to make sure failing builds failGravatar Dirk Hohndel
In some situations Travis CI doesn't seem to notice that a build failed and give us a green check mark even though the build didn't succeed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-24build.sh: only modify googlemaps .qmake.conf on MacGravatar Dirk Hohndel
This otherwise causes a failure on Linux builds. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-24printing: add release note about the recent template changesGravatar Lubomir I. Ivanov
refs #847 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: update the coping of bundled templatesGravatar Lubomir I. Ivanov
This update includes: - Instead of copyPath() use a new specialized function: copy_bundled_templates() - The new function supports overwriting of templates in the user path, but only if a template file is read-only - If the file is RW create a backup of the file in the form of: <file-name>-User.html - Collect backup files and store them in a QStringList which is then shown in a QMessageBox from MainWindow to notifying the user about the backup This change allows moving the maintenance of the bundled templates back to the application developers and contributors as currently the only one who can edit the templates in the user path was the user. Suggested-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: only load *.html files in the UIGravatar Lubomir I. Ivanov
The function find_all_templates() thus far handled all files in the user template directory. This patch makes it so that only files with the .html extension are loaded. Also remove brackets for single lined `if` statement. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: detect a 'statistics' template when editingGravatar Lubomir I. Ivanov
Prefix the path for 'statistics' templates when detecting if a template is read-only. Import / Export for statistic templates is not supported. So the user has to manually copy and chown a '/statistics' templates. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: handle overwriting in import / exportGravatar Lubomir I. Ivanov
Show an error message if trying to: 1) Import over an existing read-only template with the same name 2) Export to a read-only file with the same name 3) Delete a read-only template Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: make sure that exported templates are .htmlGravatar Lubomir I. Ivanov
Thus far the exported template did not had the .html extension. This patch makes sure that the extension is always added to the file if missing. Also handle the case where the user used ".htm" and replace that with ".html". Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: store the last import / export templateGravatar Lubomir I. Ivanov
Store the last template file name which the user imported / exported and then try to pre-select it in the combo box. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: improve messaging in printoptions.cppGravatar Lubomir I. Ivanov
1) on_deleteButton_clicked() show a proper message box with icon title and also quote the file name. 2) When exporting a file, make sure that the destination is not read-only even if the source is. 3) Do not allow editing of read-only templates (e.g. the bundled ones). Instruct the user to Export first. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: minor improvements to import / exportGravatar Lubomir I. Ivanov
1) Always open the user path on Import / Export 2) Update the list after Export, as the user might have exported to the user path Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>