aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
AgeCommit message (Collapse)Author
2015-02-10Remove the Globe from the mainwindow.uiGravatar Tomaz Canabrava
Now it's started from mainwindo.cpp and it's part of the new states Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the DiveList from the mainwindow.uiGravatar Tomaz Canabrava
It's now set up from the mainwindow.cpp file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Only update tags in the selected dives if they were changedGravatar Dirk Hohndel
If current_dive and displayed_dive still have the same tags then we shouldn't touch the tags of other selected dives. Fixes #826 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-02Do not go to edit mode if nothing changedGravatar Miika Turkia
Fixes #804 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31Update ceiling when changing dive modeGravatar Robert C. Helling
Without this patch, the user effectively cannot change the dive mode as any change is overwritten by replot copying current_dive over displayed_dive. The way out is not to call replot but only update the deco ceiling directly. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30Don't go to edit mode if the dive notes field didn't change.Gravatar Gehad elrobey
The maintab view should be consistent; some fields just go to edit mode whenever they acquire focus and most of them wait till their values are changed. Change the dive notes field to be consistent with the other fields and only enter edit mode if its value is changed. [Dirk Hohndel: changed to use same_string()] Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28Let notes expand to full with fbsupport offGravatar Anton Lundin
This hides the whole QWidget with the share-to-fb button in it. This lets the Notes field expand to the full width. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19While editing the coordinates we need to compare to the displayed_diveGravatar Dirk Hohndel
Comparing to the master dive only made sense when we immediately modified a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19Don't just change the location when double clicking on the globeGravatar Dirk Hohndel
Instead be consistent with other parts of the code and put us in editing mode so the user can accept / reject the change. See #800 Fixes #801 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-18Clean up the header filesGravatar Dirk Hohndel
Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Make Facebook support a config optionGravatar Dirk Hohndel
By default it is turned off, turn on by calling qmake with CONFIG+=FBSUPPORT. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Minor PSCR fixesGravatar Robert C. Helling
Update O2 metabolsim rate and adopt default gas switch depths to pSCR oxygen drop. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-11Don't use current_dc unless you know there's a current_diveGravatar Dirk Hohndel
This will crash if for some reason current_dive is invalid. And in general, when displaying information, we want to use the correct dc in the displayed_dive, not the current_dc, which references the current_dive... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10Refactor dctype -> divemodeGravatar Robert C. Helling
... and repair a failed rebase (sorry). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10Replot after changing divetypeGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> 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-04Initialize edit hack variableGravatar Miika Turkia
The accepting mode variable must be initialized to false to allow editing of dive data. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> 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>
2015-01-04Trip editing: zero out potential previous editsGravatar Dirk Hohndel
This was silly; if we rely on this to be zero to indicate no change then we better zero it out when we start editing. Fixes #805 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03When editing trip data, only copy actual changesGravatar Dirk Hohndel
We zero out the displayedTrip and only copy changed data into it; so a NULL value is not deleted text, it means there was no change. Fixes #805 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02Fine tune some spacingGravatar Dirk Hohndel
Now that we set the margins everywhere, the manual corrections here aren't needed. At the same time, the spacing for the labels looks better if it is a tiny bit more generous. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Facebook integration: Always ask for a folder before sending the photoGravatar Tomaz Canabrava
This way we are sure that the upload was made in the correct folder. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Move the Facebook send profile buttonGravatar Tomaz Canabrava
Move from the Dive List context menu to the Dive Info tab, it will only appear when connected to Facebook. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-23Carefully create some forced marginsGravatar Dirk Hohndel
We don't want to waste space, but we don't want things to be too crammed together, either. Especially not having horizontal margins for text can look very awkward. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25Match agreed captalisation styleGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-23Make the button labels for apply / cancel of edits more consistentGravatar Dirk Hohndel
Before you could 'Cancel' the edit and then would be asked if you wanted to 'Discard' your changes or 'Cancel'. So clicking 'Cancel' cancelled the action of having clicked 'Cancel'. That's so confusing, it's even hard to explain. Yes, it uses "typical" language for user interaction and kind of makes sense, but it's not easy to understand for the non-technical user. With the new labels the user is asked to whether they want to 'Apply' the changes or 'Discard' them. And when they choose 'Discard' the verification question is still 'Discard' or 'Cancel'. That seems much more consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17Clarify the meaning of the values in the stats tabGravatar Dirk Hohndel
Extend the tooltips to be shown both on the labels and the values and add tooltips for all min/avg/max elements. To avoid confusion when only one dive is selected, no longer show min SAC or max SAC or min duration or max duration. Fixes #694 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17Add the ability to modify the cylinder use in the UIGravatar Dirk Hohndel
Thanks to Tomaz for writing a first draft of the delegate. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17When editing cylinders, copy all relevant dataGravatar Dirk Hohndel
Maybe it would be better to just copy the whole structure and then clear the things we don't want to copy? This seems fragile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17Correctly copy weight systems on editGravatar Dirk Hohndel
We copied the string pointers instead of copying the strings. Once those got freed, things went downhill. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17727 fixedGravatar Tomaz Canabrava
--047d7b8737f87ede8e050803e6b2 Content-Type: text/plain; charset=UTF-8 <div dir="ltr"><br></div> From 3db4a422485374801ca2f6233ec23b8671a8656d Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <tomaz.canabrava@intel.com> Date: Sun, 16 Nov 2014 23:22:58 -0200 Subject: [PATCH] fix 727 - position correctly the popup. When the user entered a tag and that made the message box display the popup with the possible choices was still in the old position hidding the line edit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11maintab.cpp: use copy_string() instead of strdup()Gravatar Lubomir I. Ivanov
The .location and .notes fields can end up being NULL, in which case copy_string() is safer. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08Reorder initializers to be more c++-strictGravatar Anton Lundin
c++ have some idea about in what order things should be initialized. This makes us comply with that order. Signed-off-by: Anton Lundin <glance@acc.umu.se> 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-11-04Change tank editing behavior for multi dive editGravatar Dirk Hohndel
Previously we only applied the type of tank (description, volume, working pressure) to all selected dives where the tank description matched. With this patch we also copy the gas mix into all matching cylinders. Additionally this addresses the issue that we should have a separate copy of the cylinder description string for each dive. Fixes #754 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03Delay replot of dive so changes aren't overwritten too earlyGravatar Dirk Hohndel
When changing tanks we triggered a replot - but that overwrote the displayed_dive with the current_dive before the remaining data from the displayed_dive was used to edit the current_dive. So now we delay this until later in the function, this way copy of paste of both tanks and weights works. Fixes #753 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01Don't call strdup on NULL by mistakeGravatar Dirk Hohndel
Hunting down a different issue I managed to cause a crash here when trying to copy a string that ended up being NULL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30After editing tags, get the right tags into the displayed diveGravatar Dirk Hohndel
We forgot to clear out the pre-existing tags. We did this for the actual selected dives that were being edited, but not for the displayed_dive, so deleted tags showed up again on screen (even though they were correctly deleted from the selected dives in the dive list). Fixes #732 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-10-20Correctly edit dive date/time when editing manually entered divesGravatar Dirk Hohndel
While the existing code worked fine for editing that start date or time of dives downloaded from a dive computer or imported from some other source, for manually entered dives this did not work and the date or time was always reset to the original time once the changes were saved. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18Report CNS in dive info tabGravatar Gaetan Bisson
This adds a maxcnsText widget under infoTab and populates it. Note that I manually edited maintab.ui to display CNS and OTU next to each other and right after gas data. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-23Re-enable the edition of the Date after editing a trip.Gravatar Tomaz Canabrava
Since we can't edit the trip date, we need to remember to re-enable it after we disable it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21Fix selection logic when manually adding a diveGravatar Dirk Hohndel
This was an interesting bug. When adding a dive that would end up in the middle of the dive list, the newest dive in the dive list would end up marked in the dive structure as selected - even though it wasn't visualized as selected by Qt. Bad things happen if the user then made changes to that dive without selecting something else first, for example by either editing the dive or doing things to it like removing it from or adding it to a trip. The same operation would also be applied to the newest dive in the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18Planner: assign a dive number if the right number seems obviousGravatar Dirk Hohndel
Use the same logic as we do for newly added dives. As a side effect this patch appears to fix the issues with getting the newly planned dive selected. Fixes #692 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-16Dive edit: allow the user to explicitly clear a GPS locationGravatar Dirk Hohndel
If the GPS coordinates for a dive were incorrect for some reason and the user wanted to clear them in order to then re-download / apply GPS information from the Subsurface webservice, prior to this patch we would always match the location name and re-populate the GPS coordinates, making it impossible to clear a GPS location without also changing the location name. This patch fixes this - but if you have multiple dives with the incorrect name / GPS location pair, the next edit to a dive that had the GPS coordinates cleared will re-populate the GPS coordinates (at that point Subsurface can no longer tell that this was intentional). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-07Reload the dive list after accepting changesGravatar Dirk Hohndel
So far we only did it when we added a dive or modified a manually added dive. But the reality is that an edit of any dive could cause changes that require the dive list to be reloaded. Fixes #698 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>