aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
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>
2014-07-03UI restructure: plotDive: plot current dive by default & use displayed_diveGravatar Dirk Hohndel
No longer use the dive structure that is passed in but instead always use the displayed_dive to display things. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: add helper function to copy and clear a diveGravatar Dirk Hohndel
This way we can safely copy around dives (specifically, copy the dive to be displayed / edited into the displayed_dive). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-02UI restructure: plotDive should just take one diveGravatar Dirk Hohndel
We don't have a concept of what to do when plotting multiple dives, so let's not pretend and remove all the messing around with lists. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-02UI restructure: use a global variable to hold the dive we show / editGravatar Dirk Hohndel
There is massive confusion about what we display when and where and which dive structure (or pointer to a dive structure) contains which information at which stage. This is the first step towards restructuring all of this. This creates a global variable displayed_dive which at any point in time should be what is displayed on screen (both in the profile and in the maintab). It removes the editedDive concept from MainTab. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01Don't show gaschange events at the beginning of a diveGravatar Linus Torvalds
The initial gas change event is really special - it just specifies the gas mix from the dive computer. So don't show it as an event if that already matches the initial gas. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01Add dive: remove cylinder pressures from samplesGravatar Dirk Hohndel
These cylinder pressures are actually just artefacts of the way we track gas consumption in the code shared between planner and add dive. We don't want them in the actual dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01Equipment edit: for some reason we need a local copy of indexGravatar Dirk Hohndel
Calling enableEdition appears to corrupt the index that is passed into this slot. This doesn't fix the problem that we can't edit the cylinder start and end pressure of a manually added dive, but at least we no longer try to edit and invalid index. See #582 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01Maintab: fix tab stop orderGravatar Dirk Hohndel
This keeps getting screwed up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01Planner: use the traditional date widgetGravatar Dirk Hohndel
Much as I love the calendar, that meeds a little more tuning, so switch back as we did for the maintab. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01Implement a cache for the scaled imagesGravatar Dirk Hohndel
No point in scaling them every time the user looks at the dive. Over time this may waste some memory (especially if people have a ton of pictures and let the process run a very long time). For now I won't worry about that. Fixes #577 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01Show subsurface logo in dive plan print outGravatar Robert C. Helling
A little bit of CI: Print our logo on the print out dive plan. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-01fix tab step order in planner settings.Gravatar Joakim Bygdell
--f46d04426a604016a404fd1cd218 Content-Type: text/plain; charset=UTF-8 Tab step order should follow a logical order, top to bottom, left to right and not jump around. -- //Jocke <div dir="ltr">Tab step order should follow a logical order, top to bottom, left to right and not jump around.<br><br clear="all"><div><br>-- <br><div>//Jocke</div> </div></div> From e8ff7986f858403fb4f5277741c9fa528962f9bc Mon Sep 17 00:00:00 2001 From: Joakim Bygdell <j.bygdell@gmail.com> Date: Tue, 1 Jul 2014 09:28:23 +0200 Subject: [PATCH] Fix tab step order in planner settings. Tab step order should follow a logical order, top to bottom left to right. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Main Window: start showing dive list and globeGravatar Dirk Hohndel
Fixes #571 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Only replot the dive if maxDepth > oldMaxDepth on plan / add mode.Gravatar Tomaz Canabrava
This fixes the "impossible to work with" planner with the mouse now the dive will only grow and not shrink untill you release the mouse. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Better colors for Add and Plan modes.Gravatar Tomaz Canabrava
Those are ligther colors and it should be a better choice a way better choice is to ask for a designer wich color to use but most of my minions are busy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Revert Date widget to default in QtGravatar Tomaz Canabrava
The new one, while it's prettier, doesn't fit into the current layout in a good way, we need a better layout for it. So it's code will continue as dead code for a while. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Selects the dive date before showing it up.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Added a shortcut 'ESC' to close the calendar widgetGravatar Tomaz Canabrava
This hides the calendar widget when the user press esc when it's running. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>