aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/maintab.h
AgeCommit message (Collapse)Author
2018-10-12Cleanup: remove unused function MainTab::showLocation()Gravatar Berthold Stoeger
The last caller was removed way back in 266e754d08499a4ed45024d4886c4e799e7951e7. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-12Edit: prevent not needed change markingGravatar Jan Mulder
While trying to understand more of the big change from PR 1528, I found that the divelist was marked changed while it was not changed at all. Reason is simple. The MODIFY_DIVES code assumes its called only for truly changed data. But in case of saving tagged strings, it was not. This fixes this. And I do not believe this has any visual effects. Further, the now broken indentation is fixed seperately. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-11Cleanup: remove ReverseGeoLookupThreadGravatar Berthold Stoeger
Fetching the taxonomy from GPS coordinates was implemented in a QThread. But the only access to the main function was a direct call to run(). Thus, the thread was *never* started. The function call was always asynchronous [it was using an event loop though, so the UI doesn't hang]. Notably this means that the signals connected to the thread would never fire. And the spinner would never be activated. Thus: 1) Turn the thread into a simple function. 2) Remove the spinner. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-11Dive editing: don't repeatedly loop through whole dive listGravatar Berthold Stoeger
On dive editing, for every changed field the code looped through the whole dive-list and modified the selected dives. Instead, get the list of selected dives once and use that. Whereas this may look like a gratuitous optimization, it will make things easier for subsequent commits. Notably, we can pass the list of selected dives to an "UndoObject". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-11Cleanup: let MainTab::updateDiveSite() take dive * instead of idGravatar Berthold Stoeger
Both callers have a dive * and transform that into an id, the callee transforms it right back to the dive *. Simply pass the dive directly. This will allow us to use the function for dives that have not yet been added. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-08Map: zoom on dive sites when flipping through dive site listGravatar Berthold Stoeger
The dive site list was connected to centerOnDiveSite(). Apparently, the currently selected dive site should have been shown in the map. Yet, this never worked, because the actual dive site of the selected dive had precedence in centerOnDiveSite(). It seems that centerOnDiveSite() had actually to purposes: 1) center on the passed in dive site 2) center on the dive sites of the selected dives Therefore, split this function in two separate functions for each of these use-cases. This allows us to remove some pre-processor magic (mobile vs. desktop) and to remove a parameter from the MainTab::diveSiteChanged() signal. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-31Filter: remove diveSiteAdded signal of MainTabGravatar Berthold Stoeger
Signals can be useful. In this case, a simple function call does it. Thus, remove the signal. It can be readded later at an more appropriate place. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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-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-04-29Add SPDX header to desktop widgetsGravatar Dirk Hohndel
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>