summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-06-19Cleanup: move unit-related functions to own translation unitGravatar Berthold Stoeger
Create a units.c translation unit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: move trip-related functions into own translation unitGravatar Berthold Stoeger
These functions were spread out over dive.c and divelist.c. Move them into their own file to make all this a bit less monolithic. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: move TRIP_THRESHOLD into divelist.cGravatar Berthold Stoeger
This macro was not used elsewhere. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: create equipment.h headerGravatar Berthold Stoeger
There is an equipment.c file, but no corresponding header. Move the corresponding functions into a newly created header. This does not improve compile time since, at least for now, equipment.h is included in dive.h. But it makes things more consistent. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: fix comment to STRUCTURED_LIST_FREEGravatar Berthold Stoeger
The comment said "Clear everything but the first element" but actually the macro freed the whole list including the first element. For dive computers it was explicitly called on the second element. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: move tag functions into own translation unitGravatar Berthold Stoeger
Make dive.h a bit slimmer. It's only a drop in the bucket - but at least when modifying tag functions not the *whole* application is rebuilt anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: fix includes in membuffer.hGravatar Berthold Stoeger
Headers should not have to be included in a certain order. Therefore include stdarg.h and stdio.h in membuffer.h, since the latter uses FILE and va_list. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: use taglist_copy() instead of STRUCTURED_LIST_COPYGravatar Berthold Stoeger
There is a function for copying tag-lists, use that instead of the raw STRUCTURED_LIST_COPY macro-invocation. This will help in moving tag functions into their own translation unit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Coding style: remove Java-style function definitions in dive.cGravatar Berthold Stoeger
These stuck out like a sore thumb - let's go C-style instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: remove unused function dump_taglist()Gravatar Berthold Stoeger
This was probably used for debugging but has no callers anymore. Let's remove it. If needed, it can be trivially readded. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-18Pull and push latest translations and stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-06-15Android: add Cressi Cartesio and Goa as potentially supportedGravatar Dirk Hohndel
Assuming they are connected to an FTDI cable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-06-15Undo: add undo button to multi-dive-edited warning messageGravatar Berthold Stoeger
Simply connect the button the the undo-action and the hide-message action. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Undo: hide multi-dive-edit warning message on subsequent editGravatar Berthold Stoeger
When a different field is edited, hide any old multi-dive-edit warning message. The reason is that we might want to add an "undo" button to the message. But this will undo the wrong command if we don't hide the message. Sadly, this means that we can't use animated show / hide, because an animatedHide() followed immediately by an animatedShow() does not necessarily show the message. In other words, and animatedShow() does not interupt a started animatedHide()!? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Undo: only show warning message if dives were actually editedGravatar Berthold Stoeger
The multiple-dives-edited message was shown even if the value was not changed. Notably, when tab-flipping through the dive fields. Therefore, changed the execute_edit() function to return zero when no command was executed. For this, return a boolean from the execute() function indicating whether the command was really executed or trashed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Undo: show warning message if more than one dive editedGravatar Berthold Stoeger
On the MainTab, warn if more than one dive was edited. To this purpose, add a new KMessageWidget with an "OK" button that closes the message. Code is mostly a copy of the already existing "Editing dive" message. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Cleanup: remove MainTab::addMessageAction() functionGravatar Berthold Stoeger
This is a pointless one-liner function. Let's remove it. The message it shows will probably be moved to the profile in the not-so-distant future anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Cleanup: unify comments in desktop-widgets/command.hGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Undo: return number of changed dives from undo commandsGravatar Berthold Stoeger
To enable a "multiple dives edited" message, return the number of edited dives from dive edit undo commands. Since there are two kinds of these commands, viz. normal fields and tag fields, and the former use templates, create a common base class that can return the number of dives. Yes, the class hierarchy is getting scarily deep! At least, this gives a tiny bit of code-reuse. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Undo: don't create spurious undo commands for temperature fieldsGravatar Berthold Stoeger
When tabbing through the dive-info fields we get *EditingFinished signals. This would create undo commands. The undo commands should recognize if nothing changed. But for the temperature fields, owing to rounding, an unchanged text could actually represent a different value. This would lead to very confusing situations: 1) Edit air temperature 2) Press tab to finish editing 3) Focus goes to water temperature 4) Try to undo change in menu 5) When opening the menu water temperature loses focus 6) Water temperature is edited 7) Undo undos the water temperature, not the air temperature 8) Goto 4 Fortunately, QLineEdit fields have the isModified() member function that returns true if the field was changed by the user. Use this to prevent this case. This is not a general method, i.e. it has to applied to every field with that problem. But it is less intrusive than subclassing the QLineEdit class. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-15Cleanup: remove silly typo in translation commentsGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-10Cleanup: remove Q_PROPERTYs from MinMaxWidgetGravatar Berthold Stoeger
This is not used from QML - no apparent need for this property cruft. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-10Cleanup: Un-PIMPL-ize MinMaxAvgWidgetGravatar Berthold Stoeger
The PIMPL idiom is used by some frameworks (notably Qt) to ensure binary compatibility. Objects consist only the general object header (ref-count, connections, children, etc..) plus a single pointer to private data. MinMaxAvgWidget was implemented using this idiom. This seems to make no sense, as we don't produce a general library with the need of a stable ABI. Let's remove this unnecessary indirection. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-07Correct typo in Information boxGravatar willemferguson
Correct type in SCR delta pO2 display in Information box Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2019-06-07Desktop: invalidate dive cache on equipment editGravatar Berthold Stoeger
Owing to the recent undo-changes, the git id was not invalidated when accepting changes to cylinders and weights. Do this in the MODIFY_DIVES macro for now. Reported-by: Jan Iversen <jani@apache.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-07Desktop: don't show location-popup button in trip-edit modeGravatar Berthold Stoeger
The location fields are hidden in trip mode. Only the location-popup button was shown. Hide it as well. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-06Cleanup: remove unnecessary include in downloadfromdcthread.cppGravatar Berthold Stoeger
No QRegularExpressions were used in that file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-06Cleanup: remove unnecessary QRegularExpression copiesGravatar Berthold Stoeger
A regular expression was generated and then copied twice without apparent reason. Remove these copies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-06Printing: use regexp in preprocessTemplate()Gravatar Berthold Stoeger
preprocessTemplate() replaces variables of the kind "dive.weight0" by "dive.weights.0". Replace the old code by regexps. This not only makes the code significantly shorter, it also makes it independent from the name of the dive variable (i.e. "dive"). Moreover, it removes a dependency on MAX_WEIGHTSYSTEMS and MAX_CYLINDERS, which might help in removing these restrictions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-05[snap] add removable-media plugGravatar Michał Sawicz
This optionally allows accessing data in /media/ folders, if the user issues: snap connect subsurface:removable-media https://docs.snapcraft.io/removable-media-interface Signed-off-by: Michał Sawicz <michal@sawicz.net>
2019-06-03Add delta-pO2 disply in Information BoxGravatar willemferguson
Add display of the difference between pO2 in rebreather loop and the equivalent OC pO2: this is the oxygen drop over the mouthpiece for SCR dives. Obviously this is only displayed for SCR dives. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2019-06-03Update usermanualGravatar Robert C. Helling
... to reflect new wording of menu entry. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-06-03Reword configure dive computerGravatar Robert C. Helling
Some users understood "Configure dive computer" as the menu entry where you configure which dive computer to use. Reworded to make clear that this modifies the settings on the dive computer. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-06-01Add BLE detection for the new Oceanic Geo 4.0Gravatar Linus Torvalds
Note that we don't really have libdivecomputer support for it yet, only newly added model numbers etc. But the name detection should make it easier for people to at least download a memory dump. In addition to the libdivecomputer model number updates, this also has a merge of Jef's upstram libdivecomputer changes. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-05-29Update deco disclaimerGravatar Robert C. Helling
Our disclaimer is no longer "new". It is still true that people should not blindly follow it. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-05-29Extended user manual explanation of green ceilingGravatar Robert C. Helling
as a response on a recent discussion on scuba board. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-05-29Check if dive_site exists before accessing its nameGravatar Robert C. Helling
... in copy dive to clipboad. Fixes #2109 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-05-20CHANGELOG.md updateGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-20Undo: be smarter about dive computer shown after deletionGravatar Berthold Stoeger
When deleting a dive computer, don't just show the first dive computer, but the next one in the list (if it exists). Moreover, on undo jump to the previously shown dive computer. Do this by keeping track of the before and after dive computer number in the undo command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-20Core: let count_divecomputers() operate on an arbitrary diveGravatar Berthold Stoeger
Currently, count_divecomputers only works on the current_dive. Instead, let it take a pointer to an arbitrary dive. This is in preparation for being smarter in the undo code concerning which dive computer to show on deletion. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-20Cleanup: rename clone_dive() to move_dive()Gravatar Berthold Stoeger
This function clones a dive and clear out the old dive. This corresponds to move semantics. Name the function accordingly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-20Cleanup: fix a few comments and debug messagesGravatar Berthold Stoeger
This is just minor fixes that are not user-visible: Fix a few erroneous comments and a debug message. These are copy & paste mistakes and mistakes introduced during code- refactoring. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-20Undo: make "delete dive computer" undoableGravatar Berthold Stoeger
Simply reuse the code for "move dive computer" by creating a DiveComputerBase base class. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-20Undo: make "move dive computer to front" undoableGravatar Berthold Stoeger
Instead of the elegant solution that just modifies the dive, keep two copies and add either the old or the new copy. This is primitive, but it trivially keeps the dives in the right order. The order might change on renumbering the dive computers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-19Travis: move storage to a cheaper serviceGravatar Dirk Hohndel
It's surprising how much money this ended up costing... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-05-19Travis: build Mac against macOS 10.12Gravatar Dirk Hohndel
This way the Subsurface.app.zip should run on all versions of macOS that Qt supports. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-05-19Travis: build macOS test against Qt 5.12.3Gravatar Dirk Hohndel
The .app.zip should once again run on any Mac (ignoring the security issue of unsigned binaries). The Qt binaries in that archive include the jpeg and png libraries that were missing in the Qt 5.11.1 binaries we used until now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-05-19[user-manual_es] Update spanish translation to 563137fcdGravatar Salvador Cuñat
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2019-05-18Travis: remove old Windows buildGravatar Dirk Hohndel
The container build should now handle all we need. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-05-18windows-container: remove useless tarball downloadGravatar Salvador Cuñat
0.9 docker image includes static libraries to build mdbtools so there is no need for an aditional tarball. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>