summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
AgeCommit message (Collapse)Author
2015-06-10When done reverse geocoding, hide the notificationGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09Fix building with NO_MARBLE issueGravatar Gehad elrobey
We can't build with -DNO_MARBLE after some previous commit broke globe.cpp - centerOnCurrentDive() is still existing in the code while removed from header in 6b81fb49d09. - Some referenced to MainWindow::instance()->globe() even if we are building with no marble. - include stdint.h Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Select the correct dive in EditAddedDive modeGravatar Tomaz Canabrava
If we added two dives, and then tried to edit the first added one, the current 'added dive' set on main_tab would be the second one, so when we got to the accept() part of the call, it would reselect the last added_dive that we had. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Always send the UUID of the coordinates to the globeGravatar Tomaz Canabrava
We were relying in the current_dive to display the globe coordinates correctly - but this is not always the case: you can be inserting a new dive site and it isn't yet inside of the dive until the user presses accept. So always pass the uuid of the dive site that we want to display. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Connect the signalsGravatar Tomaz Canabrava
Connect the signals and slots so we can use the stuff I programmed. Sorry for the noise on the patch - most of this is whitespace fixes done by the QtCreator. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Remove broken methodGravatar Tomaz Canabrava
This method was written a long time ago, now we need to use the new versions of it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Do not trigger a dive site change when setting a diveGravatar Tomaz Canabrava
When setting a dive, we fire the dive site change a few times after the index of the QComboBox is changed; we don't need that - fire just once. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Don't clear the underline model of the comboboxGravatar Tomaz Canabrava
Clear was the right method to call when we used a line edit, and the line edit didn't had a model to provide data. Calling clear() on a QComboBox will delete all itens inside of it, and what we wanted was to choose an invalid index - and that's -1 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Remove commented out codeGravatar Tomaz Canabrava
This code was commented out when I started to port the locations to new code, and it's harmless to remove it now. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Don't rely on current_dive to get the dive site idGravatar Tomaz Canabrava
Since we are modifying the dive site inside of the dive, we can't ask the dive for the new one, and we also can't use the name of the dive site, as there's the possibility that two or more could have the same name, so rely only on the index of it to get the uuid. The index is variable since we will sort the dive_site_table alphabetically, but this doesn't matter since we are using it only temporarely to get the uuid, and this one never changes. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Update KMessageWidget to KF5Gravatar Tomaz Canabrava
The KMessageWidget that we used was from an ancient version of KDE4, KF5 is out for quite a while, so it's good that we also update our software that uses parts of KDE. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01Simplify model handling and crashes fixesGravatar Tomaz Canabrava
So, there's only one crash left (that I put a big TODO: on the maintab.cpp about) and I'll fix it tomorrow as it's quite late here and I'm almost sleeping at the keyboard. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01Create a new DiveSite when user clicks on addGravatar Tomaz Canabrava
Also reorganized a bit of the code, and renamed a few misleading methods. [Dirk Hohndel: remove some C++11 code] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31Fix crashGravatar Dirk Hohndel
With no dive sites we dereference a NULL pointer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31Don't ask for a GeoCoordinate when editing a diveGravatar Tomaz Canabrava
This should be asked when we are in dive_site_edit mode. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31We are not using a completer for location anymoreGravatar Tomaz Canabrava
So, remove it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Correctly set the dive site id on the diveGravatar Tomaz Canabrava
When changing the index of the combobox we were discarting the dive_site_id. This fixes it. Now I need to understand what's happening to the globe. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Fix the connections for the Location EditGravatar Tomaz Canabrava
The LocationEdit now correctly connects to the QComboBox signals, not the QLineEdit signals. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Update DiveLocationModel when thread finishesGravatar Tomaz Canabrava
This patch updates the DiveLocationModel when the GeoLoockupInformationThread finishes, and also selects the correct index for the displayed dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Change the Location from a LineEdit to a ComboBoxGravatar Tomaz Canabrava
And hook up every method that was changed. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move DivePictureModel to qt-modelsGravatar Tomaz Canabrava
This class will surely be used on the mobile version, and it was very tangled inside divepicturewidget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Fewer rebuilds triggered by changes in models.hGravatar Tomaz Canabrava
Models.h now is quite minimal, I'll keep it like that for now, until it grows huge again. I've also cleaned a bit the headers that are using it so only the ones that actually need the stuff that I've left behind will actually include this file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move ExtraDataModel to qt-modelsGravatar Tomaz Canabrava
Another attempt to make it easyer to create the mobile version. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move WeightModel to qt-modelsGravatar Tomaz Canabrava
One more step to make it easyer to port the app to Mobile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move DivePlannerModel and CylinderModel to qt-modelsGravatar Tomaz Canabrava
Still trying to make it easier for the Mobile Port: This patch is a bit bigger than I hopped, but it was the smallest that I could get. A lot of TODO items where added where I broke the code because the current implementation would break the QML implementtion on the designer. I'll most probably fix those myself when I finish the transition to the models to the new folder. I only moved both models at once because there's an interdependency between them (seems inevitable, tough, but I'll take a better look at it later). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28Correctly save dive rating after changing itGravatar Salvador Cuñat
Corrects typo in ebaa7d1fd which impeded that changes in dive rating were saved after editing. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-21Fix typoGravatar Paul-Erik Törrönen
Loockup -> Lookup Signed-off-by: Paul-Erik Törrönen <poltsi@777-team.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17Use the QtWaitingSpinner instead of blocking the MainTabGravatar Tomaz Canabrava
We shouldn't allow the user to change the location when we are probing the web for the correct places if we are updating an old file from Subsurface. This makes use of a pleasant spinner that works beautifully. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17Better name for the disable/enable geolocation editGravatar Tomaz Canabrava
'enable' and 'disable' is too generic, and we are only blocking the geolocation edit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17Don't enable the widgets before finishing the threadGravatar Tomaz Canabrava
The maintab should be disabled when the geolocation thread is running - but if you changed the dive, it would reenabled it. (actually this should be only on the location widget, I'll send another path later) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17Fix signal connectionsGravatar Tomaz Canabrava
I don't know what happened to me, I connected to some signals that didn't exist at all. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11Multi dive edit: treat buddy and divemaster as tag listsGravatar Dirk Hohndel
So just like tags do "differential editing". Figure out what (or in this case, who) was added / removed from the displayed dive and do the same for all other selected dives. This does seem a bit over top for divemaster, but this is more consistent and therefore should make more sense to the user - assuming we ever have one who runs into this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-02Improve multi dive tag list editsGravatar Dirk Hohndel
The old behavior was kind of crude. Just smack the tags that were on the displayed dive on all selected dives. This seems to make more sense. We figure out which tags were added to the displayed dive and add them to all selected dives. And we remove all tags that were removed from the displayed dive from all selected dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-23When deleting a cylinder, adapt gas changesGravatar Dirk Hohndel
When we delete a cylinder the gas changes in that dive may have to be adjusted. We didn't do this at all in the past. With this commit we should be doing this right for a single dive that is being edited. This does NOT handle multiple dives being edited at the same time (or more specifically - if you have multiple dives selected and delete a cylinder, the dives that had the same set of cylinders (other than the displayed dive) will get that particular cylinder deleted, but won't have their gas change events (and sensor data in the samples) adapted. Possibly we should simply prohibit deleting cylinders when more than one dive are selected. See #834 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22When editing the location, make sure it gets applied to the divesGravatar Dirk Hohndel
Oops, that was embarrassing. Just setting it on displayed_dive doesn't gain us anything if it isn't transferred to the selected dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-30maintab.cpp: fix editing dive profiles from tripsGravatar Lubomir I. Ivanov
Once a manually added dive is part of a trip and this trip is edited, applying the modifications leaves the dive profile in edit mode (e.g. points can be dragged and gas swapping can be applied). The issue can be viewed from another angle. Why enable profile edits of a manually added dive which is in a trip, while the trip is being edited in the first place? If there are more than one manually added dives in said trip we are enabled to edit one of the dive but probably it's not intended to modify all manually added dives after the changes are applied for the trip. This patch disables the functionality in question and it also... Fixes #864 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16Correctly create a dive site with the name entered on the Notes tabGravatar Dirk Hohndel
The char pointer was out of scope by the time we created the dive site. Also remove the misleading comment above - it really makes sense to do nothing in that function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Remove redundant codeGravatar Tomaz Canabrava
Another snippet that shouldn't exist. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Remove dead code.Gravatar Tomaz Canabrava
This code used to trigger the edit mode a long time ago since now I'm re-reading the code to implement the same stuff on the Location edit mode, I realized that this is not needed anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14Rename the tab "Dive info" to "Info", and "Dive notes" to "Notes"Gravatar Henrik Brautaset Aronsen
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13When updating the dive site name, show this on the maintabGravatar Dirk Hohndel
If we accept a change on the dive site management screen, it needs to be reflected on the Dive notes tab right away. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13maintab change for get_dive_site_uuid_by_nameGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Remove coordinates from main tabGravatar Dirk Hohndel
It seems to make sense to only have them on the dive site screen. For the main UI they were redundant (we have the map) and not all that useful. The only time people would want them is if they wanted to manually add GPS coordinates for a dive, but that should now be done via the dive site UI. There are a couple of FIXMEs in the code and a few code blocks that have been commented out as they will be needed in one form or another once this GPS handling is done on the dive site UI, which right now it is NOT. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Switch components for cut/paste dive to dive site logicGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Correctly connect the maintab to dive site managementGravatar Dirk Hohndel
We now have a working uuid - use it. And populate the fields accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Make editing a location work with dive sitesGravatar Dirk Hohndel
Not sure if this is the final implementation, but at least for simple cases it works now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Clear the location if we have no dive siteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Show GPS coordinates based on dive site on MainTabGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Show location based on dive site on MainTabGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Pass a fake dive site UUID to the callback.Gravatar Tomaz Canabrava
This is the start of the preparations to edit the dive site, passing a uuid so we can retrieve it later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>