aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
AgeCommit message (Collapse)Author
2015-10-30Move qt-ui to desktop-widgetsGravatar Tomaz Canabrava
Since we have now destkop and mobile versions, 'qt-ui' was a very poor name choice for a folder that contains only destkop-enabled widgets. Also, move the graphicsview-common.h/cpp to subsurface-core because it doesn't depend on qgraphicsview, it merely implements all the colors that we use throughout Subsurface, and we will use colors on both desktop and mobile versions Same thing applies for metrics.h/cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-18Display divetime according to dive mode and translationGravatar Giorgio Marzano
Many time stats in maintab display also seconds in short freediving Signed-off-by: Giorgio Marzano <marzano.giorgio@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-14Mark dive type list for translationGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Fix font issue on Windows 10 in the weight widgetGravatar Lubomir I. Ivanov
Column headers were drawin in a smaller font. This fixes it for no apparent reason. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Clear date and time when no dive is shownGravatar Dirk Hohndel
So far we showed bogus date and time - whatever time it might be in UTC at midnight 2000-1-1 in your timezone. Instead we now show a discrete little "-" in both fields. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Move the algorithm to divesite.cpp fileGravatar Tomaz Canabrava
This shouldn't be on the maintab.cpp, this file is already too convoluted. [Dirk Hohndel: slightly refactored this commit and the next one to make the code actually work and make the split across the two commits more reasonable] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Be way more carefull when copying dive siteGravatar Tomaz Canabrava
I don't know how I was not shot regarding on how broken the old behavior was. The new behavior: 1 copy the old_dive_site on top of the current_dive_site only if the current_dive_site was actually a new uuid, created by that method. 2 if the current_dive_site is an existing one but it doesn't have gps coords, copy only the gps coords. This fixes existing dive sites copying notes and coordinates from the old_dive_site. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Remove unused codeGravatar Tomaz Canabrava
This was needed when maintab had to thinker every little aspect of the dive site selection, which has not been necessary for quite a while. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Make dive trip location edit work again.Gravatar Tomaz Canabrava
:D Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Hide trip location when launching SubsurfaceGravatar Tomaz Canabrava
It was ugly to show trip and dive location when no dive was selected. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Update the dive site location when editingGravatar Tomaz Canabrava
Simple. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Add a new QLineEdit to set the dive trip locationGravatar Tomaz Canabrava
This is different from a dive site, as it's not a dive site. It's just a normal string, while a dive site has gps coordinates. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-30Fix multi-dive edit regarding Dive SitesGravatar Tomaz Canabrava
Now it correctly sets the same dive site instead of creating a new one for each dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-30Make 'Choose dive site' work as 'Rename'Gravatar Tomaz Canabrava
But it will actually create a new dive site, not just rename the existing one. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-30Remove unused codeGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-29Delete unused dive sites after editGravatar Dirk Hohndel
This way they don't continue to clutter the globe. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-29Correctly handle updating the name of dive sites from GPSGravatar Dirk Hohndel
If the user downloaded the GPS data from the Subsurface webservice before naming a dive site, we run into a special case where entering a new name for a dive location should just update the name of the automatically named site which already has the correct GPS information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-27Do not set text on the Location LineEditGravatar Tomaz Canabrava
Since the location is only true with a valid uuid, set the uuid on it, it will search for a valid name and set there. this fixes a few inconsistencies handling the locations. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-27Center on the dive site also via keyboardGravatar Tomaz Canabrava
Now mouse and keyboard navigation over the list of current dive sites will update the marble globe position. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-27Change globe position when mouse over dive siteGravatar Tomaz Canabrava
When the mouse moves over the dive site list, the globe should show the current one under the mouse. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Dive edit: if the user didn't pick a dive site, don't mess with itGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Merge branch 'NewLocationEditDropdown'Gravatar Dirk Hohndel
2015-09-23Disable edit dive site if already in edit modeGravatar Tomaz Canabrava
If user selected a new dive site (a dive site that doesn't exists yet, to be created) and clicked in edit it would edit the *old* dive site. this is not optimal, but since it removes a severe regression it will be like this (I won't change it till 5.0) for a while, until I have time to actually code something not messy for that. The current dive location management is *much* nicer than the old one, code-wise. No more magic numbers, magic codepaths, magic constants, qt black magic. It's straigth-forward code simple to follow, simple to edit. This was something I was actually postponing for 5.0 but I managed to get a boost of subsurface time at work. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Handles Dive Selection gracefullyGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Code cleanupGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Much simpler code to set the dive siteGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Don't crash on new dive siteGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Set the correct dive site uuidGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Correctly fix the popup positionGravatar Tomaz Canabrava
When the message to 'This dive site is being edited' was being show while the popup to choose the dive site, the line edit was being covered. now it correctly moves to the correct place. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Removed a ton of dead codeGravatar Tomaz Canabrava
Unused dead code / hack for the old QCompleter Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Handle palette change for dive site selectionGravatar Tomaz Canabrava
If you select a dive site with a different uuid than your current dive.dive_site_uuid, you should get a different pallete to state clearly that something changed. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Stabilize the location model/proxy modelGravatar Tomaz Canabrava
Since I removed the old location edit from the UI, I also need to remove a bit of code from the UI that was calling it. fix a few crashes regarding the old location edit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Skeleton of the new LocationComboboxGravatar Tomaz Canabrava
This is the bare minimum skeleton of the new completer for the dive site management. Nothing works, yet, nothing is hoocked up, yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Hide a couple of debugging messagesGravatar Dirk Hohndel
They are useful to show when trying to figure out what's going on, so just move them behind a check for verbose. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16Make Facebook more user friendlyGravatar Tomaz Canabrava
The current way that facebook works is terrible: it's scattered around tons of files ( at least 4 different files and classes ) this moves things around a bit, add a disconnect button that was missing, cleans tons of code and fix inconsistencies. I will also redo this part for 5.0, but it's too late for 4.5 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11When editing a manually added dive, correctly update max depthGravatar Dirk Hohndel
The fixup_dive() function assumes that values that are set already in the divecomputer and dive structures come from a reliable source - sometimes dive computers are able to track a maximum depth continuously, so that value can be larger than the deepest sample and we need to honor that. But in the case of a manually added dive, the samples define the dive. So in this case we need to reset the values that were calculated when the dive was first added so that the user can then edit the dive and reduce the maximum depth reached in the profile and have that reflected in the dive list. Fixes #926 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29Fix edit & show of divesites for new and existing dives.Gravatar Sander Kleijwegt
The UI detects when it should refresh the loction after the user finished editting a divesite. Creating and editting divesites is now working even when the current dive is not saved yet. Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28Always show the dive site edit buttonGravatar Sander Kleijwegt
Update the tooltip and enable only when there is a divesite selected Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28Fix mouse clicks on divesite completer.Gravatar Sander Kleijwegt
Use clicked instead of activated signal on the completerList to handle the selection of a divesite. Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Keep the dive list disabled if editing a diveGravatar Tomaz Canabrava
When, in a dive edit mode user entered a dive site and went to dive site edit mode then finished the ds edit, the app would lose the disabled property of the dive list, making it possible to select a new dive when we where editing another one, complete mess. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Create a new dive site and edit it automaticallyGravatar Tomaz Canabrava
If the user clicks on the first or second option of the drop down list, subsurface will move him to the dive site edit panel automatically, since it's a new dive site and there's no information about it yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Move dive site list to its correct positionGravatar Tomaz Canabrava
When we are in display dive mode, and then edit the location text edit, going to edit dive mode, the location text edit will be moved a bit below of it's original position but the Dive Site List would be already opened, and stuck on it's original position, covering the dive list. This patch fixes that. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Get taxonomy from edit dive site widgetGravatar Tomaz Canabrava
Moved the get taxonomy button from the maintab to the edit dive site widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Turn the get taxonomy button into a manage dive site buttonGravatar Tomaz Canabrava
The get taxonomy button will be inside the manage dive site interface. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Make created dive site uuid deterministicGravatar Dirk Hohndel
Having random uuids seemed like a good idea, but there are several situations where they really cause problems. One is merging dive file imports from V2 logfiles. Another is testing such imports. Instead of making the uuid random we now hash the name and add the timestamp of the first dive associated with this dive site to the hash (first in this context is "first encountered" with no guarantee that it is the chronologically first). This way V2 imports create deterministic uuids but uuid conflicts are still extremely unlikely, even if the user has multiple dive sites with the same name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-03Make debugging cleanerGravatar Robert C. Helling
Don't try to connect the globe when NOMARBLE is active. Check exisistance before trying to open an image file. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Transform GlobeGPS in a static instance() classGravatar Tomaz Canabrava
This is needed to start easing the transition from the completely wrong and bogus MainWindow::instance()->globe() calls. this is still wrong, but with it I removed one level of indirection. I did that now because I wanted to not taint the location management when I use it to deal with the globe. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Correctly update the dive when the user edits dive_siteGravatar Tomaz Canabrava
We didn't correctly update the dive site as soon as the dive_site edit finished, and this time we are actually correctly updating things using signals instead of calling the mainwindow for everything. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Fix mouse interaction with the Location ListGravatar Tomaz Canabrava
paint methods should be used only to paint, not to trigger other widget behaviours ( we could got ourselves into a bad recursion bug from that ). Also, enabled mouse tracking to correctly track the mouse movement inside the widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Change API signature to act on dive_site, not uuidGravatar Dirk Hohndel
This way in the future we can pass in a pointer to a dive site that isn't linked in our dive site list yet (i.e., while we are editing). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>