aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
AgeCommit message (Collapse)Author
2018-05-28Distinguish between user and internal divemode namesGravatar Robert C. Helling
The former should be translated but not those that go to xml/git. ... and fix capitalization of pSCR. Suggested-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-05-27Dive pictures: give user option to recalculate thumbnailsGravatar Berthold Stoeger
Even though hashes of image contents are calculated, the hashes are not compared to actual file contents in routine-operation. Therefore give the user the option to recalculate thumbnails, should they have edited the picture. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-21Dive pictures: change removePicture() interfaceGravatar Berthold Stoeger
The function removePicture() had a flag "last", which would indicate that the called had finished removing pictures. Only then would the model be recalculated. This is a strange interface and, matter of fact, the caller was buggy: if the last picture to be removed didn't have a proper url, removePicture() was never called with "last" being set. Change the interface to take a list of pictures to be deleted. This will allow us to make picture deletion smarter in follow-up commits. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-14Rename enum dive_comp_type to divemode_tGravatar Robert C. Helling
...as the usuage is not anymore about a computer but a momentary dive mode. Rename the end indicator as well. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-05-14Core: remove dive.h from files that don't need itGravatar Dirk Hohndel
Of course, quite a few of them indirectly get it through other header files. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14Core: introduce new subsurface-string headerGravatar Dirk Hohndel
First small step to shrinking dive.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-13Dive pictures: Update pictures when thumbnails are readyGravatar Berthold Stoeger
Connect the thumbnailer signal to the dive picture model slot. This needs some code-reshuffling in the dive picture model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Desktop: On dive edit from the dive list or map, switch to new stateGravatar Berthold Stoeger
If "Edit dive" is selected from the dive list or the map view, switch to a new mode, which shows the dive infos and the profile. After the edit, switch back to the previous state. Fixes #1213 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-11Fixed erroneous comparison of cylinders and weight systems.Gravatar Oliver Schwaneberg
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-10Removed a duplicate include in maintab.cppGravatar Oliver Schwaneberg
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-04Desktop: fix time format in main tabGravatar Dirk Hohndel
Fixes #1234 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-09Change taglist_get_tagstring to support 'unlimited' tag list sizeGravatar Jeremie Guichard
Previous taglist_get_tagstring signature/implementation did not allow handling of cases where inputted buffer could not contain all tags. New implementation allocates buffer based on pre-computed size allowing to insert all tags in the returned string. Added get_taglist_string in qthelper to handle conversion to QString Added TestTagList with tests for taglist_get_tagstring Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2018-03-19Cleanup: Initialize variable MainTab::lastSelectedDiveGravatar Berthold Stoeger
This variable was read before being set. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-14Cleanup: introduce copy_qstring() functionGravatar Berthold Stoeger
strdup(qPrintable(s)) and copy_string(qPrintable(s)) were such common occurrences that they seem worthy of a short helper-function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-14Cleanup: consistently use qPrintable()Gravatar Berthold Stoeger
Replace constructs of the kind s.toUtf8().data(), s.toUtf8().constData(), s.toLocal8Bit().data(), s.toLocal8Bit.constData() or qUtf8Printable(s) by qPrintable(s). This is concise, consistent and - in principle - more performant than the .data() versions. Sadly, owing to a suboptimal implementation, qPrintable(s) currently is a pessimization compared to s.toUtf8().data(). A fix is scheduled for new Qt versions: https://codereview.qt-project.org/#/c/221331/ Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-02Choose water presets from a qcombobox in planner, custom value possibleGravatar Oliver Schwaneberg
Add a combo box for water types with defaults for fresh water, sea water and the EN 13319. All values taken from units.h, where EN 13319 was added beforehand. Custom values can be entered through a spinbox. Also changed "Salinity" in TapDiveInformation.ui to "Water type". Translation required! Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-02-26Cleanup: remove two unused macros in tabwidgets/maintab.cppGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-24Use temperature_t for temperatures in struct stats_tGravatar Stefan Fuchs
Use struct temperature_t for temperatures in struct stats_t and use get_temperature_string() when printing these temperatures for statistics and HTML export. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-02-17Consistently use the famous l for liters in info tabGravatar Stefan Fuchs
For salinity in info tab change the l character to the famous Subsurface "ℓ". Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-02-04Do not remove seconds from duration input fieldGravatar Oliver Schwaneberg
This change deals with issue #554. If you enter a dive duration manually, the cell renderer cuts the seconds away when the changes are saved. I added the helper "render_seconds_to_string" as a counterpart to "parseDurationToSeconds". The helper keeps the seconds, if not null. The rendering of the cell is done at two places in the code, so I think it is cleaner to add a dedicated method for it. Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-01-01desktop: clear tags when hitting new logbookGravatar Jan Mulder
A very simple commit to start 2018. When hitting new logbook from a currently open logbook, and the current dive has tags filled in, they stayed around in the UI. Just clear them. Further, delete an unused variable. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-21Fix order of initilization list in MainTab constructor.Gravatar Berthold Stoeger
Besides being the right thing to do (code reflects reality), it silences a compiler warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Implement different zoom levels for dive photos tabGravatar Berthold Stoeger
This implements different zoom levels for the dive photos tab as suggested by Stefan Fuchs <sfuchs@gmx.de> in #898. The zoom level can be changed using a slider or CTRL+mousewheel. Zoom levels range from a third of the standard thumbnail size to thrice the standard thumbnail size. Thumbnails are cached in maximum resolution and scaled down on the fly. Because the profile widget took its pictures from the photo list model, an extra picture copy with a fixed size had to be introduced. The UI is still a bit crude. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-13Reenable picture tab when dive trip is selectedGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Dive picture widget: Allow pictures to use available space on resizeGravatar Stefan Fuchs
Small change to allow the dive pictures list to use the available space if one resizes the window or switches to different mainwindow view. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Use correct selection mode for dive picture viewGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-30Use better aliases for icons.Gravatar Martin Měřinský
Icon aliases were complete mess. Some icons had alias some didn't. Named with underscores vs. hyphens vs. camelCase. Lower vs. upper case. "ICON" prefix vs. suffix vs. nothing. With vs. without filename suffix. Some didn't make sence. Eg. mapwidget-marker-gray (I can see, it's grey, but what does it represent?) Some were duplicated, eg warning vs. warning-icon. Some were name after widget, which is wrong. Do not reinvent wheel. Use widely used naming scheme close to Freedesktop Icon Naming Specification. This will enable usage of common icons from current set in the future. Thus Subsurface will fit nicely to GUI. This changes icon aliases to one, easy grep-able style. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-30Use icons relative path.Gravatar Martin Měřinský
Icon paths are defined in one place only - application's embedded resources. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-12-01Disable specific tabs when dive trip selectedGravatar Stefan Fuchs
Disable tabs for equipment, info, pictures and extra info if a dive trip is selected. Remember specific tab selection for dives and dive trip to recover selection when browsing dive list. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01In maintab fix change of text between "notes" and "trip notes"Gravatar Stefan Fuchs
Old code was not functional. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-29Revert "Use icons relative path."Gravatar Dirk Hohndel
This reverts commit b0d98f6e269be9560de1b9c140855c85fecf1dd1.
2017-11-29Revert "Use consistent aliases for all icons."Gravatar Dirk Hohndel
This reverts commit 92e9c6606f6ef3ad16d2e31f9f9a8f5fa14f2c1a.
2017-11-29Use consistent aliases for all icons.Gravatar Martin Měřinský
Icon aliases were inconsistent mess. Underscores vs. hyphens vs. camelCase. With vs. without filename suffix. Lower vs. upper case. "icon" suffix vs. prefix vs. nothing. Some were duplicated, eg warning vs. warning-icon. Some icons didn't have alias at all. This changes all icon aliases to one, easy grep-able style which complies to Freedesktop Icon Naming Specification (Guidelines). Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29Use icons relative path.Gravatar Martin Měřinský
Icon paths are defined in one place only - application's embedded resources. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29Don't change visibility of depth and duration UI field when no diveGravatar Stefan Fuchs
After one selected a dive and then selects NO dive don't touch the visibility of UI fields for depth and duration. So if previously selected dive was a manually added dive, keep them visible. If it was no manually added dive keep them invisible. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-28Correctly handle dive notes in maintab.cppGravatar Stefan Fuchs
Remove duplicate and incorrect setPlainText call via macro for dive notes. Deal correctly with ASCII line breaks "\n" in dive notes with html markup (replace them with <br>). Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27After edit the cylinders of a dive copy the full samplesGravatar Stefan Fuchs
After editing the cylinder table (e.g. deleting a cylinder) and accepting the changes copy the whole dc samples for the dive edited. This is important because the sensor idx in the samples may have changed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27Use MAX_CYLINDERS consistentlyGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
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-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-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-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-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-10-20Silence random warningsGravatar Dirk Hohndel
None of these seem to point to actual issues, so let's quiet them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-19Use displayed_dc instead of current_dcGravatar Robert C. Helling
current_dc is a macro that determines the dive computer based on the current dive number. When the planner is started from an emtpy dive list, the dive number ends up being -1 and that doesn't produce a valid dive computer. Use the divecomputer of the displayed_dive instead. This is done via a macro that can also be used in two other places. Without this patch, the planner crashed when called on an empty dive list. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-17Tags for geo references: Nicer look, translations and warning messageGravatar Stefan Fuchs
For the geo references tags update the following: - Nicer look w/o "Tags:" text and brackets when inside location UI - Translation for "Tags:" - Warning message when no dive site layout categories are set Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-07Disable editDiveSiteButton without dive site nameGravatar Dirk Hohndel
Entering a name first creates and hooks up a dive site which we can then use in the edit dive site dialog to store modifications. This doesn't really fix these two bugs, but it might impact whether they can still be recreated See #633 See #636 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-04Change the signature of constructLocationTagsGravatar Dirk Hohndel
We actually want to be able to pass a specific divesite structure and not have it look that up by uuid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-01Use helper function dive_endtime() where apropriateGravatar Stefan Fuchs
Calculating dive.when + dive.duration doesn't always give the correct endtime of a dive especially when a dive has surface interval(s) in the middle. Using the helper function dive_endtime() fixes this issue. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-04remove Marble from the source treeGravatar Lubomir I. Ivanov
In desktop-widgets, remove globe.cpp, globe.h and also remove the NO_MARBLE macro usage. At this point the MapWidget will always be created and there will always be a map in the application. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>