aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.h
AgeCommit message (Collapse)Author
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-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-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-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>
2015-07-15Dive site handling: correctly handle the different scenariosGravatar Dirk Hohndel
- do not create dive sites unless the user has accepted the changes - all modification are tracked in the displayed_dive_site - when the user accepts the changes, the real dive site list (and the selected dives) are updated according to what is in the displayed_dive_site This adds quite verbose debugging messages and disables a section of code that has a special case for data created by the Subsurface web service. This code needs some re-thinking and should eventually go away. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14Remove quick edit dive site widgetGravatar Tomaz Canabrava
Voted down by common consent. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Move code that handles location to a sane placeGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Select right divesite on clickGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Get the selected dive site from the listGravatar Tomaz Canabrava
Hooked up an eventFilter on the QListView that displays our dive sites so it would filter the keys enter and space, storing the current dive_site uuid when that happens. Also it stores the uuid on clicks. Now we need to get that information when processing acceptedChanges() and check if the uuid stored there == displayed_dive_site.uuid and also if text != displayed_dive_site.name, because if the user didn't click on anything but only wrote stuff on the LineEdit no dive site would be selected and so uuid == displayed_dive_site.uuid (wich would mean 'no changes') Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Merge branch 'taxonomy'Gravatar Dirk Hohndel
2015-07-02Trigger reverse geo lookup by pressing the buttonGravatar Dirk Hohndel
This may not be the best UI, but for now it works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01Added again a QCompleter to show the possibilitiesGravatar Tomaz Canabrava
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01Correctly removes the Location Completion ModelGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27Dive site rewrite: mark location field as soon as editing startsGravatar Dirk Hohndel
Don't wait until the user switches focus to a different part of the tab to mark the location field. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: create a dive site edit dialog without bordersGravatar Tomaz Canabrava
Plan is to make it pretty later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: location edit on notes tab is again a LineEditGravatar Tomaz Canabrava
Hopefully we now have the UI semantics figured out. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.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-04Make the plus button work.Gravatar Tomaz Canabrava
This fixes a signal being emitted. 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-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-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-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-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-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-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-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-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-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-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-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>
2015-02-11Enable the location edit widget on mainwindowGravatar Tomaz Canabrava
Clicking on the 'Manage' button now brings you to the widget to manage it. Nothing has been added on it yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Add the first call to registerApplicationStateGravatar Tomaz Canabrava
This will be used to set the 'default' state. The other two possible states right now are plan and add; those will be created right next. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19Always updated the coordinates from the displayed_diveGravatar Dirk Hohndel
That's why it's called the displayed dive... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10Add setpoint events according to divetypeGravatar Robert C. Helling
When changing to a CCR dive, add a setpoint change to the default setpoint at the beginning of the dive. Otherwise add an explicit setpoint change to 0 . Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10Maintab combobox to set dive typeGravatar Robert C. Helling
still needs some work Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04Make sure we do not fall back to edit mode on acceptGravatar Miika Turkia
On Ubuntu 14.04 the edit mode does not exit successfully when applying the changes. It instead jumps back to edit mode (even though hiding the option to apply/discard changes again). So let's just have a flag to prevent faulty behavior. Fixes #786 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Show extra data in separate tab on MainTabGravatar Dirk Hohndel
This way any extra data probided by the dive computer is visible to the user (without other processing). This data cannot be edited by the user as it reflects the information given by the dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-05Always copy data in copy and paste modeGravatar Dirk Hohndel
While in a multi dive edit we want to apply our usual semantics (only edit things that are the same as in the current dive), when doing an explicit copy and paste that doesn't seem to make sense. So we manually override that behavior. Fixes #753 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20Recalculate the decompression if the date / time of a dive changesGravatar Dirk Hohndel
The pre-existing tissue load going into a dive can change if the start time of a dive changes. Therefore we need to recalculate the ceiling when editing start time (or date) of a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17Cut'n'paste for dive data: implement paste sideGravatar Dirk Hohndel
This should correctly set all the values and puts us in edit mode. Testing so far looks good for both single dive and multiple dives selected (i.e., you can paste into multiple dives). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Delete pictures from the Widget by pressing deleteGravatar Tomaz Canabrava
Select the picture, press delete, profit. [Dirk Hohndel: removed the stray hunk that snuck into this patch] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Maintab: fix trip location / notes editingGravatar Dirk Hohndel
Reusing the displayed_dive for this caused all kind of odd problems that were hard to reproduce, because the behavior depended on what was in the corresponding fields of the current_dive. Worse: the GPS location handling prevented us from reliably removing the location of a trip. The solution isn't ideal and certainly isn't elegant. Maybe we simply shouldn't reuse the widget here. But I think what I have now works - I tried hard to make it break again and couldn't. Fixes #659 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Remove uneeded functionGravatar Tomaz Canabrava
This method was being unused, rip it off. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Complete GPS coordinates on location focusout.Gravatar Gaetan Bisson
Introduce on_location_editingFinished() and move the GPS coordinates completion logic there. This simplifies acceptChanges(), but replaces the clever code for multidive completion by something a little more straightforward. Note the call to on_location_editingFinished() from acceptChanges(); without it, completion only happens *after* the dive has been saved. [Dirk Hohndel: trivial merge, minor changes for consistency] Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Correctly save the tags on the dive.Gravatar Tomaz Canabrava
Very good patch, lots of removed lines. :) Only try to add the tags when user accepts, discards the test to see if the tags were changed or not, delete the old list and copy the new one always. only bug that's appearing now: taglist is still empty after save we need to reselect the dive to make it appear, fixing that on the next patch. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: only switch to edit mode if user made changeGravatar Dirk Hohndel
With this patch a simple click into the main tab does not start editing mode. Only once a value is modified do we show the message box and disable the other widgets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: track if any data was modifiedGravatar Dirk Hohndel
Instead of comparing the dive structures (which doesn't work since the strings are actually copies), track if the user made changes. Cylinders and weights still need to be compared as they are handled in different widgets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>