aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2017-11-24printing: add set_bundled_templates_as_read_only()Gravatar Lubomir I. Ivanov
Add the function set_bundled_templates_as_read_only() in templatelayout.cpp/h. The function is used to mark the bundled template files as read-only in the user folder. It is called in mainwindow.cpp, after the files are copied from the bundle. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: delete `One Dive Simple.html` and cleanupGravatar Lubomir I. Ivanov
The previous commit by Willem introduced a new HTML template file which is not needed, as it was decided to override the default `One Dive.html`. This patch also include small cleanup in the new version of `One Dive.html`. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24PATCH: Update the single-dive per page print templateGravatar Willem Ferguson
1) Place the dive profile below the synoptic info for the dive. 2) Re-arrange the synoptic info items. 3) In the synoptic info, replace air temperature info with gas and cylinder info. 4) If any items among the the synoptic data take more than one line, the the alignment of cells in the synoptic info table is maintained. In the previous version this caused a ragged bottom edge of the synoptic info table. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
2017-11-24Include stdbool.h also from prefs.h if included from C fileGravatar Stefan Fuchs
Currently not mandatory in our code because we never include prefs.h from a C file today but for the future this could avoid confusion. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-24Change prefs.show_units_table to boolGravatar Stefan Fuchs
Bool is the correct choice for this option. int was used before because it was not clear to me how and if I can use bool in this C file. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-23Fix obscure display bug in profile widget, where heat map wasn't shownGravatar Berthold Stoeger
Fixes an obscure bug, which happened under very specific circumstances. Precodition: fresh program start and neither of the partial pressure graphs, nor the heat maps are shown. User clicks on heat map icon. Bug: The heat map is not shown at the bottom of the graph. The fix consists in replacing two percentageAxis->setLine() calls by precentageAxis->animateChangeLine() calls. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-22Clean up system_default_filename()Gravatar Berthold Stoeger
In the old implementation there were two static C-style strings, filename and path, which were initialized to NULL and filled on first call of the function (i.e. singletons). There is no sense in having two static variables indicating whether this function was called previously. Moreover, there is no point in remembering filename accross function calls, because it is not used once path is set to a non-NULL value. Therefore, make the filename variable non-static and calculate it only on first invocation (as indicated by a NULL path). Moreover, free() the filename variable after its use to fix a memory leak of the old code. The windows code is slightly different in that the temporary filename is not dynamically allocated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-22Copy default filename string when assigning to default preferencesGravatar Berthold Stoeger
This tries to remove subtle ownership issues. When copying preferences structures, the default filename is copied. But the default preferences struct simply takes a pointer to a global string which is free()d in main(). Now, this is not strictly a bug because the free()ing of preferences resources is not implemented. Yet, let's try to make this consistent. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-21Update Release notes for this PR (and more)Gravatar Jan Mulder
Sneaked in 2 earlier commits solving a published issue. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-21Desktop UI: allow user defined cylinder as defaultGravatar Jan Mulder
Currently, it was only possible to use a hard-coded default cylinder in the preferences. At the same time, the user is allowed to add own cylinders to a dive (by just typing in a new name and cylinder properties). These own cylinders could not be selected in the preferences, requiring the user to manually add this every dive. Not sure the reason for all this was intentional, or just an overlooked aspect in the implementation. It appeared that the selection list in the UI was constructed before any logbook was parsed, so at that moment, there are only hard-coded cylinders. The fix is simple. Refresh the UI of the preferences just before it is shown. While opening the logbook, a new list of cylinders, including the own cylinders is constructed, so the UI is refreshed to that. While a simple change, there is a use case that might be considered strange. Open a logbook, choose new logbook, and change the default cylinder preference to an own (from the previously opened logbook). Do not add a dive with the new (own) cylinder and save this logbook. Reopen this new logbook, and see that the default cylinder in the preferences is empty. This is logical, as the list of own possible cylinders is constructed from the (new) logbook, that has no dive with that specific own cylinder. I consider this acceptable behavior, as it can be also be used to copy own cylinders to a new logbook. Fixes: #821 Proposed-by: Davide DB <dbdavide@gmail.com> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-21Disable Mention-BotGravatar Dirk Hohndel
This is too unreliable and too buggy to work be useful. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-20Make handling of booleans consistent on the C-side of preferencesGravatar Berthold Stoeger
Boolean settings were declared in pref.h randomly as bools and shorts. Since the code relied anyway on bool being well-defined and identical on the C- and C++-sides, turn all of them into bools. They use less space and express intent more clearly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-20Make handling of booleans consistent on the C++-side of preferencesGravatar Berthold Stoeger
In general, the C++-side of the preferences code consistently uses the bool data type for boolean settings. There are five exceptions, which use short instead: showPo2 showPn2 showPhe saveUserIdLocal displayInvalidDives This patch attempts to make the code more consistent by turning these into bools as well. Tests showed that writing as short and reading as bool is handled gracefully by the Qt variant code. Therefore, an upgrade should not cause user-visible changes to their settings. As a bonus, two extern declarations of the set_save_userid_local() function, which is not defined anywhere, were removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-20Fix typo: successfull -> successful and succesfully -> successfullyGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-19mobile: new Kirigami SHAGravatar Jan Mulder
Notice this is not the current master. Do not go there right now. Kirigami SHA f8ee631aac787b60 introduces a failing load of our main.qml (tested with both Kirigami 2.0 and 2.2). This SHA is safe. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: QtQuick.Layouts to 1.2Gravatar Jan Mulder
And again, no visual changes. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: QtQuick.Controls to version 2.2Gravatar Jan Mulder
Tested fine without visual changes. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: QtQuick to 2.6Gravatar Jan Mulder
Upgrade QtQuick to 2.6. Seeing a small artifact in the application header, lets see what happens when upgrading more includes. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: Kirigami to 2.2Gravatar Jan Mulder
When first tested this commit, especially the dive list was looking terrible. However, after including newer SHA's from libkirigami, and correcting lots of spacing/margin issue, a retest of this commit shows no strange artifact any more, and the amount of warnings in the log output is reduced significantly. So now, it appears save to upgrade. Notice that main.qml still uses Kirigami 2.0. and is not updated in this commit. With version 2.2, there is a new way of theming, that is not (yet) compatible with our current code. Blindly upgrading to 2.2 leads to a almost black dive list, wrong button colors, and runtime errors in the log, due to the fact the direct setting from QML Kirigami's Theme colors is not allowed any more. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19Remove dead codeGravatar Jan Mulder
While investigating Qt 5.9.2 problems, I found this unused code. Just remove it. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19Fix indentationGravatar Berthold Stoeger
Fix an indentation issue in qt-models/diveplannermodel.cpp. An if was indented as if it were part of an outer if. Correct indentation confirmed by Stefan Fuchs <sfuchs@gmx.de>. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-19Trivial: fix indentationGravatar Berthold Stoeger
Fix an obvious indentation bug where one line more than intended was indented. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-18Constify strings in pref.hGravatar Berthold Stoeger
Make all char * pointers in pref.h const to make it clear that these strings are not mutable. This meant adding a number of (void *) casts in calls to free(). Apart from being the right thing to do, this commit makes the code more consistent, as many of the strings in pref.h were already const. While touching core/qthelper.cpp turn three instances of (void*) into (void *). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-18Prevent signed/unsigned comparison warningGravatar Berthold Stoeger
Change an unsigned integer to a signed integer in profilewidget2.cpp, because commit 1f8506c changed the definition of duration_t from unsigned to signed. Since this value represents the number of seconds since a dive started, there is no possible chance of overflow problems. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-18Prevent annoying signed/unsigned comparison warningGravatar Berthold Stoeger
Commit d6c013f303 introduced a cast to avoid a signed/unsigned comparison warning for all translation units that included core/dive.h. Commit 1f8506ce64 then changed the definition of duration_t from unsigned to signed, inverting the effect of d6c013f303. Thus, revert d6c013f303 to allow compilation with -Wall without flooding. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-18build.sh: fix comparisonGravatar Dirk Hohndel
This prevented googlemaps from building in some circumstances. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-18Switch back to upstream uploadtoolGravatar Dirk Hohndel
In commit e643589233 ("Travis: setup up the desired release message right away") we temproarily switched to my fork of uploadtool to take advantage of a new feature that I had implemented there. This has already been merged upstream, so let's switch back to upstream. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-18Travis: setup up the desired release message right awayGravatar Dirk Hohndel
Instead of using the default release message and then trying to fix it up in the after_success section of one of the builds that we test, let's just always use the message that we want, regardless which build finishes first. This currently requires my fork of the uploadtool - the changes have been submitted upstream and I hope they'll get merged there so we can switch back to the upstream version of uploadtool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-18Travis: include the symlink in the zip of Mac .appGravatar Dirk Hohndel
Don't try to follow the (recursive) symlink. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-17Release notes: Cleanup, pressure graphs, VPM-B ceilingGravatar Stefan Fuchs
Remove old 4.7.2 headline. Add pressure graphs improvement. Add VPM-B ceiling improvement. Suggested-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-17Travis: update the release messageGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-17Travis: don't edit Release info if this is a PRGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-17mobile: black and white backgrounds on startingGravatar Jan Mulder
This very simple commit has a long story. See the mailing list subject "mobile: android splash screen (and issue 513) opacity weirdness". There is even more. I found the following deccription on Internet: https://falsinsoft.blogspot.nl/2017/07/qml-show-android-native-splash-screen.html and tried to implement this with the potentially nice Qt functionality (since 5.8) to manually get rid of the splash screen. Unfortunately, this does not work. Notice that there are subtile differences in the here found internet page, and the method originally implemented in commit 04e994b575. This fix is as mimimalistic as it can be. Just do not set black but white for the initial background. Unfortunately, there is still a small position change of the icon. It is known why, but solving is left as an exercise to the reader. Fixes: #513 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-17Fix memory leaks in SettingsObjectWrapper.cppGravatar Berthold Stoeger
Free a bunch of C-style strings before assigning newly copied strings. One case was particularly buggy: prefs.locale.use_system_language = copy_string(qPrintable(value)); Note that prefs.locale.use_system_language is a bool, which of course always evaluates to true! Probably nobody noticed because a restart is required when changing locale. Moreover remove a few double-semicolons.
2017-11-17Fix typo: LENGHT -> LENGTHGravatar Berthold Stoeger
2017-11-17Don't show cylinder pressures for other dive computersGravatar Linus Torvalds
Stefan Fuchs points out that sometimes you get cylinder duplication when you merge dives, particularly with a planned dive. For example, if we had different manual pressures in the two different dives, the cylinders will be kept separate. But that also means that we don't want to plot the pressures from those other cylinders that came from another dive and are now associated with another dive computer. Change the "seen" logic for the cylinder to ignore cylinders that are only mentioned by other dive computers than the active one. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-17Properly declare 'has_gaschange_event()' functionGravatar Linus Torvalds
It's already used in core/gaspressures.c where it was declared privately, and we'll have a new user in the profile code, so just declare it in a proper header file like it should have been. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-17Clean up confusing code in setup_gas_sensor_pressure()Gravatar Linus Torvalds
The "prev" cylinder can never be negative since commit 56c206d19fba ("For more manual gas pressure details"), so remove stale code that checks for a case that cannot happen any more. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-17Show all autocompletes after entry of comma in tag listGravatar Jan Mulder
The almost 3 year old commit e1db5f21b15b2 introduced the behavior that you need to type at least 1 character for a tag to show any autocompleted data. While this went unnoticed for years, there is always a user that notices this changed behavior. The solution is rather simple. Do allow the 0 lenght string to act as seed for autocompletion instead of just returning, and doing no autocomplete at all. As the afore mentioned commit was explicitly meant to prevent over active firing of the tag list autocompleter, this (simple) change is carefully tested on this, and no adverse effects are visible. Fixes: #605 (wrt the 1 character issue) Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-16In maintab disable correct label when dive trip selectedGravatar Stefan Fuchs
Until now accidentally the dateLabel was disabled and the timeLabel was enabled. Changed this the other (correct) way round. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-16github: update PR template with 'documentation-change'Gravatar Lubomir I. Ivanov
Add a 'Documentation change' section to the PR body. This instructs the PR submitter to edit the section with notes for the team editing the documentation. If a PR has such notes, a maintainer should then apply the needs-documentation-change label, so that the documentation team can easily filter such PRs by label. Suggested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-16android: Add android build on travis-ciGravatar Anton Lundin
This adds a android-apk-build which runs on travis-ci. This is using a quite ugly trick, building in a docker container, basically just to get a newer cmake. The cmake in trusty is way to old to work with android builds. A good side-effect is that this is a complete copy-paste for anyone who would like to build android-binaries them self on Linux. All the uglyness is hidden away in a docker container. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-11-16android: Don't re-clone subsurface in android-build-wrapper.shGravatar Anton Lundin
Just use the source tree you where called from instead. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-11-16android: Correct path to Qt binariesGravatar Anton Lundin
Back in 6451adfec11262c3522878e700cb6794df8ee3d2, the path to the qt binaries was changed. The current binaries are back on the old urls, so this reverts half of 6451adfec11262c3522878e700cb6794df8ee3d2. The other half is still true. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-11-16android: Remove unneeded extra argument parsingGravatar Anton Lundin
This is handled by build.sh, which handles it correctly for running with set -u. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-11-16android: Install android sdk on a different wayGravatar Anton Lundin
This way we can auto-accept all the licenses. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-11-16android: Terminate build.sh on unknown argumentsGravatar Anton Lundin
Previous code ended up in a eternal loop on unknown arguments. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-11-16android: Ensure rm exits zeroGravatar Anton Lundin
This is to comply with set -e Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-11-16android: Remove unset variable VERSIONGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>