aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2014-07-10Place holder icon for network prefsGravatar Joakim Bygdell
Until we can get a proper one. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10Fix bug in Seabear QuirksGravatar Anton Lundin
By mistake i used memcpy to "fix" the samples, but the sample list was overlapping so i needed to use memmove. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Move drop_stone_mode setting to prefsGravatar Anton Lundin
There is no reason to treat drop_stone_mode different from the rest of the planner settings, so move it to our prefs structure. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Add quirk for Seabear CSV settingsGravatar Anton Lundin
The Seabear software stores its settings as two csv-rows in the same file as its samples. These settings got read as two bogus samples in the beginning of the dive. This kills those off and repairs the temperature damage they done. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Print: make the profile table font size 7pxGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Add quirk for Seabear CSV NDL/TTS in minutesGravatar Anton Lundin
In the Seabear CSV the NDL and TTS fields are in minutes, not seconds as their time field. This is an ugly quirk but it gets the job done. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Add support for importing TTS from CSV filesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Add support for importing NDL from CSV filesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Align CSVUnits with the other QComboBoxesGravatar Anton Lundin
The CSVUnits QComboBox wasn't in a layout and that made it look a bit weird. This adds a layout around it. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Initial stab at Seabear CSV importsGravatar Anton Lundin
This adds a preconfigured import setting for Seabear CSV files. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Printing: scale fonts when printingGravatar Dirk Hohndel
This seem to work better, but it misses a couple of items at times (for example the highest label on some of the axis). Needs lots more testing. See #590 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Printing: force redrawing of the profileGravatar Dirk Hohndel
If the first dive we end up rendering is the dive currently shown, the info overlay would end up being printed which looks really silly. See #590 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Remove HTML from translated stringsGravatar Dirk Hohndel
In some strings that won't be possible as the translation needs to be aware of line breaks, etc. But for these strings it seems like the right thing to do. 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-09Don't try to set a layout on PlannerSettingsWidgetGravatar Anton Lundin
It already got one from its ui-file, and this causes a warning when starting the application. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Refresh display after toggling backgas breaks.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Put a copy of the tags in the displayed dive upon save.Gravatar Tomaz Canabrava
I don't think this is the right approach, but it makes things work. The reason that it was not working before it's because upon save we are not copying the edited dive against the displayed dive for some reason, and I didn't find the place that should deal with that. This fixes one of the various issues around tags, but others remain. Fixes #587 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> 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-09Remove if to save or not save the tags.Gravatar Tomaz Canabrava
The way that we work with tags is a bit weird, we have a global tag_list pointer and every dive copy the tags from there. the problem is that the tags_changed() function looks at those two places ( the global and the dive-local lists ) to see if something was changed, but we shouldn't add anything at the global taglist untill a tag is really added, so that function is bogus. The correct way to check if something changed is to check all the strings in tags against the strings in the QLineEdit and see if they are the same, then we can add things to the tag_list. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-08Picture handling: make sure pictures are shown after they were addedGravatar Dirk Hohndel
We need to first replot() to get displayed_dive updated, then call refreshDisplay() so the picture model gets repopulated which triggers the pictures to show up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-08replot() needs to really force a replotGravatar Dirk Hohndel
So let's set forceReplot to true to make sure that happens. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-08make GPS coordinates autofilling really workGravatar Gaetan Bisson
Move the gpsHasChanged() call on selected dive when coordinates have changed *before* autofilling, otherwise it erases the autofilled values. Also update displayed_dive when autofilling, otherwise values are stored but not displayed immediately after saving. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-07Planner: don't allow negative depthsGravatar Robert C. Helling
This patch allows only non-negative depths in the divepoints table as negative depths confuse the planenr/deco algortihm. The spinbox appearing in the table should get a setMinimum(0) but I was not able to find the correct way to implement that. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-06UI restructure: remove the backupDive we no longer needGravatar Dirk Hohndel
Since we have a dedicated dive that we use to display things, we can simply get the information from the current dive and use it to setup said displayed_dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-06UI restructure: cleanup the code when canceling an editGravatar Dirk Hohndel
This was way too complicated because we used to edit a "live" dive that was on the dive list. All we really need to do is systematically make sure that all the widgets are in the correct state. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-05Show the gas mixing information only when neededGravatar Miika Turkia
Recreational divers, especially ones diving with air, do not need to be shown that their gas can be mixed with 0 liters of O2 and He. And similarly Nitrox diver does not need to know about 0 liters of He. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-05When adding a waypoint, use the gasmix of the _next_ waypoint.Gravatar Robert C. Helling
This corrects the logic of adding a waypoint actually meaning that a previous segment is subdivided into two. Both new segments should by default use the gas of the old one. Since the gas is stored in the waypoint (divedatapoint) at the end, we need to use the _next_ gas. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Add dive: don't throw away the pressure data enteredGravatar Dirk Hohndel
Previously we were trying to get rid of the tracked gas pressures that were added when using the plan infrastructure to create a dive. Now that this isn't the case anymore we can stop doing that which magically makes setting start and end pressure while adding a dive work as expected. Fixes #582 Fixes #553 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Planner: don't set cylinder start and end pressure when adding diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Don't add a close button to KMessageWidgetGravatar Dirk Hohndel
Commit 77a55db9d3e2 ("Use QDialogButtonBox in KMessageWidget") added a close button to all our uses of that widget. As much as I stare at the code I can't figure out why. For now I'll simply brute-force disable them... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Use QDialogButtonBox in KMessageWidgetGravatar Anton Lundin
QDialogButtonBox can auto-choose the order of the actions based on the current interfaces guidelines, but in this case its a guessing game. It does a half-decent job off guessing. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Make planner buttons consistent with MaintabGravatar Anton Lundin
Move the Save/Abort buttons in the planner to the top left and change them to Save/Cancel to be consistent with where our Save/Cancel buttons are in the Maintab. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04UI restructure: simplify setup of add and plan modeGravatar Dirk Hohndel
Recreate the helper function (which now does something fairly different) to share the common code between the two modes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04UI restructure: correctly setup planningGravatar Dirk Hohndel
I had tested this mostly with add dive and completely forgot to track the same changes in the planning routine. Oops. This allowed to get rid of a no longer useful helper as well. Fixes #594 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04UI restructureGravatar Dirk Hohndel
Don't clear out the model after we already set up the cylinders. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Planner: initialize drop_stone_mode as falseGravatar Dirk Hohndel
Otherwise it could be used uninitialized when adding dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: when adding a dive via displayed_dive it needs valid idGravatar Dirk Hohndel
Otherwise we have one (or - yikes - more) dives with id 0. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Small cleanupsGravatar Dirk Hohndel
Add commented out options to subsurface.pro that enable debuging the planner. Remove obsolete comment. Clean up the selection tracking. Force the re-sort of the divelist inside the reload instead of explicitly calling it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Autofill GPS coordinates for added dives.Gravatar Gaetan Bisson
Prior to commit 95cb4e, when a new dive was added with the same location name as a previous dive, the GPS coordinates for that new dive would be automatically set to that of the matching previous dive. This restores this feature, by duplicating code further down qt-ui/maintab.cpp that handles the case where multiple dives are modified at once. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: add back the missing plan dive notesGravatar Dirk Hohndel
This was removed in the big rewrite by mistake. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Planner: Add backgas breaksGravatar Robert C. Helling
If the corresponding checkbox is checked the planner does interrupt pure O2 deco after 12min for 6min on cylinder 0. To make this work for air I removed the gasmix_is_null logic. I guess that makes the planner feature complete for the next release. [Dirk Hohndel: trivial merge into latest master] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: use displayed_dive for add dive and plan diveGravatar Dirk Hohndel
This gets rid of the stagingDive and stops the constant adding and removing of dives from the divelist (that was an INSANE design, seriously). When adding or planning a dive all work is now done in the dedicated displayed_dive. Add dive mostly works - when the user clicks save the dive is added to the dive list and selected. Plan dive is mostly untested. It passed trivial "start planner, save" testing so it's not entirely broken, but I'm sure there's more work to be done there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: don't use random dives from the divelist for dataGravatar Dirk Hohndel
Everything should come from the displayed_dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: get rid of "current" pointer in cylinders and weightsGravatar Dirk Hohndel
Instead always display the display_dive. Now the only thing left to slay is the stagingDive... 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>
2014-07-03UI restructure: improve memory handling in maintabGravatar Dirk Hohndel
Free strings before overwriting them. Use copy_dive() instead of just copying the dive structure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: updateDiveInfo displays displayed_diveGravatar Dirk Hohndel
Instead of passing in a divenr of -1 to make it clear things this changes things to use an options "clear" flag. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: always display pictures for displayed diveGravatar Dirk Hohndel
The only time this is ever wrong is in print mode, so let's never show pictures in print mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: updateDiveInfo shows the selected dive by defaultGravatar Dirk Hohndel
So don't be redundant. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>