summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2019-04-12Parser: parse into custom dive site tableGravatar Berthold Stoeger
To extend the undo system to dive sites, the importers and downloaders must not parse directly into the global dive site table. Instead, pass a dive_site_table argument to parse into. For now, always pass the global dive_site_table so that this commit should not cause any functional change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Dive site: add dive site table parameter to dive site functionsGravatar Berthold Stoeger
To enable undo of dive site functions, it is crucial to work with different dive site tables. Therefore add a dive site table parameter to dive site functions. For now, always pass the global dive site table. Thus, this commit shouldn't alter any functionality. After this change, a simple search for dive_site_table reveals all places where the global dive site table is accessed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12optimize selectedDivesGasUsed()Gravatar Rolf Eike Beer
-return the result instead of storing in a parameter, we now know that the list contains only those results that are generated in the function -allocate the result with the correct length right from the start -do not iterate over keys of a map and then do a map lookup to get the value but use an iterator that gives us both right from the start -remove one call alltogether as the results were not used there Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-12replace deprecated qSort() with std::sort()Gravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-12tell QObject to give the desired children right awayGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-12use QStringLiteral for constantsGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-12get rid of some foreach and Q_FOREACH constructsGravatar Rolf Eike Beer
See https://www.kdab.com/goodbye-q_foreach/ This is reduced to the places where the container is const or can be made const without the need to always introduce an extra variable. Sadly qAsConst (Qt 5.7) and std::as_const (C++17) are not available in all supported setups. Also do some minor cleanups along the way. Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-11Cleanup: provide our own qOverload<> implementation.Gravatar Berthold Stoeger
This is only in Qt 5.7 and therefore can't be used in Qt 5.5 and 5.6 builds. Moreover, we can't simply reuse Qt's version owing to licensing concerns. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04Undo: implement split-out of dive computerGravatar Berthold Stoeger
Allow splitting out a dive computer into a distinct dive. This is realized by generating a base class from SplitDive. This turned out to be more cumbersome than expected: we don't know a-priori which of the split dives will come first. Since the undo-command saves the indices where the dives will be insert, these have to be calculated. This is an premature optimization, which makes more pain than necessary. Let's remove it and simply determine the insertion index when executing the command. Original code by Linus Torvalds <torvalds@linux-foundation.org>. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04Export profile dataGravatar Robert C. Helling
This introduces a csv file that contains the data from the structs defined in profile.c, in particular all deco information computed for the dive profle (including NDL, TTS, ceilings, surface GFs etc). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-04-02Cleanup: remove all Q_NULLPTR instancesGravatar Berthold Stoeger
It expands to nullptr anyway and is inconsitent with the rest of the code. Let's remove this anachronism. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-29Add UI element for final surface segment in plannerGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-03-27CMake: add headers to targetsGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-27print a reason when dup() failsGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-27Cleanup: provide printGPSCoords in C and C++ versionsGravatar Berthold Stoeger
printGPSCoords() returned a newly allocated C-style string. Most callers simply made a QString out of it and freed the C-style string. This is paradoxical, as printGPSCoords internally works with QStrings and converts them to C-style on return. Therefore, let printGPSCoords() return a QString and create a printGPSCoordsC() wrapper for the two C-callers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-24Cleanup: fix printGPSCoords signature and leaksGravatar Berthold Stoeger
The printGPSCoords() function returns a copied C-style string. Since the owndership is transferred to the caller, the correct return type is "char *" instead of "const char *". Thus a number of casts when calling free can be removed. Moreover a number of callers didn't free the string and thus were leaking memory. Fix them. Ultimately we might want two versions of the function: one for QString, one for C-style strings. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-20Remove partial support for QWebEngineGravatar Dirk Hohndel
Printing never worked, none of this was ever included in test builds. Also, now that there are official releases of QtWebKit again, this just doesn't seem worth carrying along anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-19Misc: replace some FIXME commentsGravatar Dirk Hohndel
All these aren't actually things that need fixing, they are observations about the code. Given that LGTM.com reports FIXME comments as Alerts, let's change the ones that aren't about things that need fixing to something more harmless. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-18Desktop: fix another variable name conflictGravatar Robert C. Helling
Addresses LGTM.com issue. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-18Leak fix: make ostcFirmwareCheck a unique_ptrGravatar Berthold Stoeger
ostcFirmwareCheck in DownloadFromDCWidget was neither freed in the destructor, not freed if a new object was allocated. Simply make it a unique_ptr<> to do all the work for us. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-13Desktop: ensure cloud storage email address is all lower caseGravatar Dirk Hohndel
We already do that on mobile and I was certain we used to do this for desktop as well, but apparently that got lost somewhere... This should solve the problems we are seeing for people with mixed case email addresses. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-28Filter panel: add suit and notes search fieldsGravatar Willem Ferguson
All the field in the Notes Panel of the main window are now supported. This needs some testing especially for the Notes field that may contain markup. It appears ok to me for single term searches. One would like to think about the default search option for the Notes. There is a vertical spacer in the Filter panel that I moved downwards and whose function I am not quite sure of. [Dirk Hohndel: small adjustments] Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-28Autogroup: make notrip flag work again.Gravatar Berthold Stoeger
6bf4120dbbf7be1b9267e0e86f3948b77870ea71 replaced the trip flag by a notrip boolean. This was supposed to signal that the user removed the dive from a trip and therefore it shouldn't be autogrouped again. Sadly, the commit removed the feature. Reinstate it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-19Desktop: remove checkmark from Filter divelist entry in Log menuGravatar Dirk Hohndel
That's redundant with the information that we show in the window title (and only risks going out of sync, as it is right now). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-19Desktop: show filter button explanation in the widgetGravatar Dirk Hohndel
Since the filter numbers are now shown in the window titlebar, we can use this space for an explanation of the two button (they already have tooltips, but this is even easier for the user). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-19Desktop: show the filter information in the window titleGravatar Dirk Hohndel
Instead of using the filter widget itself to show the information how many dives are displayed, put it in the window title where it's visible even if the filter widget isn't shown. If the filter is not active, simply show the total number of dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-19Desktop: don't clear the filter when the widget is hiddenGravatar Dirk Hohndel
Only clear the filter when the user explicitly resets it. This way the user can toggle between the map and the filter widget without losing the filter state. Fixes #1952 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-19Desktop: track if the filter widget is activeGravatar Dirk Hohndel
This is not perfect - if you open the filter, set some criterion and then remove it again (without resetting the filter), this variable will give you a false positive). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-19Filter: implement any-of modeGravatar Berthold Stoeger
Add an additional mode to the tags, people and location filters: any_of. Replace the original invert-bool by an enum. Move the common code into a distinct function. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-18Edit: use correct offset when changing dive timesGravatar Berthold Stoeger
The undo-work reversed the direction of the offset. This was apparently only fixed when using the menu entry, but not when editing dives directly. Invert the offset to get the correct time. While doing so, remove a redundant if: First it checked whether the dates are the same, then whether the offset is non-zero. Fixes #1975. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-14Desktop: only show dive computers in the Bluetooth device listGravatar Dirk Hohndel
By default we'll only show devices that we believe to be dive computers, but the user can override that with the recently introduced check box. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-14Desktop: add checkbox to show all BT devicesGravatar Dirk Hohndel
Which right now is of course what we do by default, the goal is to only show what we think are dive computers, but allow to see all of them if the user wants to. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-11Desktop: show filter panel with maximized dive listGravatar Dirk Hohndel
This way we can filter both in the default layout and in the dive list layout. Fixes #1951 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-11Small whitespace fixGravatar Dirk Hohndel
Simply because it bugged me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-09core: move updatecheck to its own domainGravatar Dirk Hohndel
This make it easier to move backend services around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-07Add various enhancements to profile export and dive data copyGravatar Robert C. Helling
... as suggested by Lubomir. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-02-07Profile: add "synchronous" mode for picture plottingGravatar Berthold Stoeger
The thumbnails were fetched in the background to achieve a snappier UI. The problem with that is that on LaTeX etc. export only placeholder thumbnails were shown. Therefore, implement a synchronous mode. This only tries to fetch cached thumbnails or calculate thumbnails for images. Videos and remote files are not supported. Fixes #1963 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-07Copy dive description to clipboardGravatar Robert C. Helling
Upon "Copy dive", store a text description of the items on the system clipboard. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-02-07Export profile imageGravatar Robert C. Helling
With Facebook support gone, we should offer a way to export the profile image. This has been part of the TeX support but this makes it explicit. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-02-05Add button to toggle deco info in info boxGravatar Robert C. Helling
The info box can get longish. Offer the user to turn off display of deco information (surface GF and individual ceilings). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-02-02Cleanup: rename locationInformation.ui -> locationinformation.uiGravatar Berthold Stoeger
The .cpp and .h files are all lower-case, the .ui file is camel-case. Unify to lower-case (which is much more common in the code base). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-02Cleanup: remove unused function MainTab::setCurrentLocationIndexGravatar Berthold Stoeger
The last caller was removed in ce8199cdfdef97437ad85178c7104f307baf018b. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-01facebook: remove the featute from the code baseGravatar Lubomir I. Ivanov
Remove from: - unit tests - desktop widgets - preferences - core intergration - cmakefiles - build scripts - icons - docs Also remove the plugins and social network integration. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2019-01-28Desktop: cleanups for the filter UIGravatar Dirk Hohndel
Just trying to get the spacing to be a bit nicer. Hand editing XML... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-28Desktop: set filter negation textsGravatar Berthold Stoeger
The texts may not be perfect, but this is a start. Replace the buttons by combo-boxes. This will allow potential extension to "any of". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-28Desktop: add vertical spacer at bottom of filter widgetGravatar Dirk Hohndel
This way we don't have this weird stretched out look. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-28Desktop: change filter negate buttonsGravatar Dirk Hohndel
Use button text to indicate what the current state is (done in code) and use tool tip to tell the user that pressing the button negates the filter's effect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-27Cleanup: remove redundant conditionalGravatar Berthold Stoeger
In MainTab::acceptChanges there was a "editMode != ADD" condition inside a else block to "editMode == ADD", which is therefore redundant. Remove. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-26Coding style: unify connect() calls in filterwidget2.cppGravatar Berthold Stoeger
The connect() calls had different styles. Unify them to the one that was used the most. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-26Filter: quick implementation of negationGravatar Berthold Stoeger
Add negate buttons to the Tags, People, Location and Equipment filters. Currently, if nothing is entered the filter is ignored whether negate is on or off. One might think about filtering all dives without tags, etc. instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>