aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2014-07-17Hide gachange events in the first 30 secondsGravatar Anton Lundin
Back in 4.0 we hide all gaschange events during the first 30 seconds, not just gaschange events on second 0. Eg, the OSTC3 emits its gaschange event on the first sample, which can be 2, 10 or 30 seconds into the dive. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-17Use get_cylinder_index instead of get_gasidxGravatar Anton Lundin
Replace get_gasmix_from_event and get_gasidx with get_cylinder_index. get_cylinder_index actually knows about both types of gaschange events and the difference between them. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-17Add missing struct keyword in DivePlotDataModelGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-17Use plot_data cylinderindex instead of event dataGravatar Anton Lundin
For the info box, we can't use the event data, because its not 1:1 mapped to whats in the cylinder and what we actually switched to. Use the plot_data here we already calculated what we are switching to. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Store drop_stone_mode, bottomsac, decosac in prefsGravatar Gaetan Bisson
The values for drop_stone_mode, bottomsac, and decosac are typically the kind of personal data specific to a diver that is unlikely to change from one dive plan to the next. This patch stores/restores them to/from the preferences file. For this, it adds bottomsac and decosac to the prefs structure; drop_stone_mode was already there, though not stored/restored. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Translate velocity units in planner settingsGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Pick the correct timezoneoffset for the day in questionGravatar Dirk Hohndel
Calculating the timezoneoffset for the current date really makes no sense whatsoever when displaying a time that isn't "now". Fixes #605 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Desselects the trip before dive add / plan, and reselects it on cancelGravatar Tomaz Canabrava
When we had a trip selected, we ignored that and simply called the DiveAdd functions, but the mainTab code that deal with selections to show one or more dives or trips asked how many trips were selected to the DiveList, and since a trip was selected things go kabum. Fixes #606 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Force replot of selected_dive when canceling planGravatar Tomaz Canabrava
The profile was still the planner one, so we need to force a replot. Fixes #621 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Use 'this' instead of ::instance() when iside of same class.Gravatar Tomaz Canabrava
Do not use MainWindow::instance() inside of a non-static mainWindow method, that's just bogus. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Fixed creating recursion on the connectionsGravatar Tomaz Canabrava
Ugh. Each time you wanted to change a cylinder, a new connection was being created on this object, delaying the correctly setup of the item. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Complete the name of the first Cylinder on editGravatar Tomaz Canabrava
When you entered part of the name of a cylinder this was being treated as a new cylinder, and not selecting the first one. Fixes #628 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Added a 'use default file' button on preferences.Gravatar Tomaz Canabrava
Added a 'Use default file' button on preferences in a way that doesn't clutters the interface. Fixes #630 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Fix saving and storing the dive plan notes when there's html on itGravatar Tomaz Canabrava
We save an HTML table-based plan, so we need to get the text as html, not plaintext. Fixes #634 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Date picker l10n for profile and plannerGravatar Sergey Starosek
- set application-wide locale from preferences - use custom date format for display Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Rely on QNetworkReply finished() signal instead of AccessManager oneGravatar Tomaz Canabrava
The access manager is only one, while we can make requests from different parts of the application, so relying on the manager finished() signal to see if something was done or not was a not very good move. The QNetworkReply is created when a get() is invocked on the AccessManager and that's unique. connect it's finished() signal instead. bonus: code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16More strings to translate for statistics tabGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16pN2 » pN₂, pO2 » pO₂Gravatar Henrik Brautaset Aronsen
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Disable DC shortcuts on closing data fileGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Fix SearchBar growing vertically on window resizeGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Fix layout for User SurveyGravatar Sergey Starosek
- apply vertical layout to top-level dialog. This solves label clipping - call adjustSize() on dialog to fit all labels (translated text could be longer than original) Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Change in logic while aplying gps fixes to divesGravatar Salvador Cuñat
We were actually searching dives which match the dowloaded position fixes. So we're also trying to take into account if the fix is automatic or no based on a limited amount of predefined strings (bad idea, as the user can change in companion app settings the predefined string). This way, in actual implementation, if program concludes that a fix has been manually got or, simply, the user is unlucky enough to have all the position fixes out of the dive time, find_dive_n_near() function will pair fix and dive in an ordered way (1st fix -> 1st dive; 2nd fix -> 2nd dive ...) which is probably erroneous, except for manual position fixes. BTW actual implementation can't pair the same gps position with more than one dive, which would be the case, e.g. in repetitive dives while at anchor in the same point. The patch changes the logic: - Search positions for defined dives (instead of dives for defined positions) without care if position has manually or automatically been set. - Only take care of those dives that don't have a position yet. - It makes two assumptions: a.- If the position fix has been taken during the dive time, is correct. If there are more than one inside the dive time, takes the first one (closest to the DC's reported time). b.- If not during diving time, the correct one is the nearest fix before the dive begins (also the usual case if manually fixed from the smartphone just before jump into the water). But will work too if there is only one fix *in SAME_GROUP range* after the dive (another usual case). - Finally, as copy_gps_location() in dive.h is used only here, let it take care of naming the dive if user hasn't named it yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Improve handling of cylinders with identical gasmixGravatar Dirk Hohndel
In reality we have no concept for handling those, yet. But the UI doesn't prevent the user from entering multiple cylinders with the same gasmix, so we need to help the user to get rid of them as well. If the user attempts to remove a cylinder we check if there's a second cylinder with the same gas. If that's the case then we can proceed and remove the cylinder the user wants to get rid of without losing that gas for the dive. The only tricky issue is that we need to make sure that if we remove the first cylinder that one is actually replaced with one with the same gas. Fixes #622 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Correctly track the 'changed' status of the equipment widgetsGravatar Dirk Hohndel
updateDive() cannot reset the changed status - this is called while the dive is edited. Instead this status is reset when the user either accepts or rejects the changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Dive equipment edit - fix logic for applying changesGravatar Dirk Hohndel
We keep getting this wrong. First you check all selected dives that are not the current dive, make sure the equipment was the same before the edit and then apply the changes. Then, when you are done with ALL of them, then you change the current dive. Otherwise you cannot compare to the 'before' state anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Don't ignore equipment just because the dive list is emptyGravatar Dirk Hohndel
This was a fun little bug. Tomaz pointed me in the right direction. The UI restructure with the displayed_dive had another unintended side effect here. It is not valid not to set up the widgets just because the dive_list is empty. The displayed_dive isn't on the dive_list until it is saved - so while the user is adding or planning a dive, we still need to show the equipment widgets. Fixes #614 Fixes #601 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Planner: limit altitude and pressureGravatar Dirk Hohndel
Oh boy, this should allow for altitude in 'ft' as well. I set an arbitrary cutoff at 3000m (and switched things to increments of 10m for the altitude). Fixes #629 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-15Use QObject::tr instead of OurClasses::tr for functionsGravatar Tomaz Canabrava
This will make more easy to move code around in the future. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Save and restore Dive Planner SettingsGravatar Tomaz Canabrava
This patch adds the code that saves and restores the dive planner settings. Fixes #608 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Selects the delegate text on Cylinder editionGravatar Tomaz Canabrava
The text selection was not being set, bummer. See #628 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Do not create a backup for Q_FOREACH containerGravatar Tomaz Canabrava
Q_FOREACH will expand and already creates a copy of the contained container, so this is just a waste of cpu cycles and also increases a tiny bit the memory consumption. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Planner: don't allow the user to remove the last pointGravatar Dirk Hohndel
This causes all kinds of assumptions to go wrong - and it makes no sense. Move the point to where you want it or cancel the plan. Fixes #623 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Planner: when adding new waypoint at the end, use previous gasGravatar Dirk Hohndel
In commit b0da8c270736 ("When adding a waypoint, use the gasmix of the _next_ waypoint.") we default to air when adding a waypoint at the end of the plan by double-clicking. That seems silly since we could instead continue using the last gas. I wasn't able to reproduce the "gas list disappears" problem in bug #623, but I did get a silly air segment added which was equally wrong. Maybe I'm lucky and this fixes the problem that Henrik sees as well... See #623 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14Try to avoid inconsistent selection state after divecomputer downloadGravatar Dirk Hohndel
I cannot reproduce the problem, but adding one more call to unselectDives() should ensure that all dives are marked as not selected before selecting the last dive that was downloaded. See #620 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14Shrink YAxis when heart rate is on displayGravatar Lakshman Anumolu
This patch makes sure that YAxis is not expanded to cover heart rate when it is displayed on profile panel. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14HTML: Add dive photos to the detailed viewGravatar Gehad elrobey
Dive photos are copied to the photos directory on export. The photos section appears only if photos exist. C++ helper functions are added to copy images to the photos directory, Additionally the photos directory must be passed as a parameter to the write_one_dive function to save photos to it. Some options structure may be needed instead of passing many arguments. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14Remove warning about undeclared menuFilterGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14usersurvey: Add : for consistencyGravatar Anton Lundin
All the other statements there had : in them. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14profile2: remove unused varable diveComputerGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14Remove unused menu "Filter"Gravatar Anton Lundin
The filter menu wasn't connected to anything other than a debug print. This removes that menu. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-13Change default export tab to "General export"Gravatar Miika Turkia
I prefer that we show the first tab by default. Everyone should remember that Qt Creator changes the currently shown tab as default on save. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-13Typo fix Ave. => Avg.Gravatar Miika Turkia
Fixes #619 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-13Add tooltip for toggle picturesGravatar Miika Turkia
Fixes #618 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Rename event: correctly replace event with new oneGravatar Dirk Hohndel
I don't like that the event structure includes the variable length array. That really makes it a pain to change the name of an event (on the flip side, freeing events is easier I guess). Anyway, to correctly rename an event we need to actually remove the event from the correct dc and then add a new event with the new name. The previous code was insane (it only worked if the new name was of smaller or equal length, otherwise it had a beautiful buffer overflow). And of course we need to do this both for the current_dive and the displayed_dive. Fixes #616 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Fix inserting gaschange eventsGravatar Miika Turkia
Use a macro that works to get the current DC. Fixes #613 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Lower CCR setpoint min value in planner to 0Gravatar Anton Lundin
We signal a bailout to OC via setting the setpoint to zero. A setpoint between 0.2 and 0 would be really wierd, but i couldn't figure out any better way to keep the bailout deco planning. Note: The gas consumption of CCR dives are plain wrong, but this atleast lets you plan your deco for a CCR bailout plan. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Add step size in our SpinBox delegatesGravatar Anton Lundin
For the Set point spinbox, it was kinda hard just stepping by the default 1.0, so setting it to step by 0.1 makes much more sense. The int SpinBox got a step size parameter for consistency. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Use doubles in DoubleSpinBoxDelegateGravatar Anton Lundin
The previous code used qreals, but it feels clearer to use doubles when the name of the class contains the word double. The performance loss of using doubles instead of floats on arm is non-existent in this case. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Don't round range for DoubleSpinBoxDelegate to intGravatar Anton Lundin
This fixes simple copy-paste error that the DoubleSpinBoxDelegate range was stored as int, thus rounding min value from 0.2 to 0. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>