aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/maintab.cpp
AgeCommit message (Collapse)Author
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-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-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-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>
2017-07-28maintab: use GlobeGPS / MapWidget abstractionGravatar Lubomir I. Ivanov
Based on NO_MARBLE, call the same methods in the two different classes. Later the dummy Marble GlobeGPS (for NO_MARBLE) should be removed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-05-06Save tags when manually adding diveGravatar Dirk Hohndel
Tags are handled differently from other fields, we need to call the special handling after the new dive was added and marked as the current dive. Fixes: #369 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to desktop widgetsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-26Fix saving table sizeGravatar Tomaz Canabrava
We need to make sure the model is avaliable for the table until it hits the destructor. Fixes #347 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-21Move extra info tab in main window to the very right side againGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-14Also translate tab headersGravatar Jan Mulder
After the restyle of the maintab code, the translation of some tab titles went missing. Corrected here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-06Aparently, remove a QXB warning.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06Clean up some widgetsGravatar Tomaz Canabrava
Simplify logic of handling the Message that this dive is being modified. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06Break down MainTab into smaller classesGravatar Tomaz Canabrava
Maintab is one of our most complex classes, and it's something I'm not actually proud of. But it currently works and the idea of splitting it was in my head for quite a while. This is the third or fourth tentative of splitting it, and this time I let the most complex part of it untouched, the Notes and Equipment tab are way too complex to untangle right now on my limited time. A new class 'TabBase' should be used for any new tab that we may create, and added on the MainTab (see the new lines on the MainTab constructor). Also, Extra Info, Information, Photos and Statistics where ported to this new way helping reduce the number of lines and functions on the MainTab quite a bit. Overall this is a step in the right direction for the future. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>