The GTK version seems to be bugged on this, since the dialog
doesn't save the dive computer nickname that I setted, but
the Qt version shows less dive-computers than the GTK one on the
same dive. I want somebody to do a quick review of my code too. :)
I also plan to remove the 'OK' and 'Cancel' buttom, they seem to
be overrated on this dialog - fairly uneeded.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Created a new dialog, Edit Divecomputer, it will currently only lists
the divecomputers that are used on the xml file. I used the same method
that the gtk version used, but only 2 divecomputers got visualized in the
dirk dive data. I'll assume that it's correct and will fix it in the next
couple of commits.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
I guess we should support de-selecting dives this way too, but right now
the interfaces only do selection.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit 4b405caa2c ("Clean up divelist dive selection") made the sort
model variable in headerClicked unused, so get rid of it. Fix a speling
eror closeby while at it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Hoocked up the apply button - Didn't tested ( as I frankly don't know
what the expected result should be. ). but the app is not crashing, yey.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The XML is now being correctly parsed, Clicking on Help
will open the browser pointing to the api site, and clicking
on cancel will cancel the download.
Clicking on Apply still doesn't apply, but that's next. :)
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added initial support for download dive info from subsurface web service,
the current code only downloads and output the xml downloaded in the debug
area. Now I need to parse things up and plug the unplugged stuff.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Don't call refreshDisplay() after preferences change. This strangely
somehow leads to a situation where I need to move the mouse over the dive
list before changes to the units are reflected.
When calling reload() do not force layout change / resort unless that is
the intention.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Getting closer to the way this should work. Adjusted the call to reload
to not switch back to tree view and resort (oops).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems that this is the way this is supposed to be done - instead of
manually looking at what kind of click we get, Qt decides when to create
a context menu for us - this way things like the Windows Menu button
will work automagically.
As an example I also implemented the "remove dive from trip"
functionality, which exposes some other bugs (like the fact that the
dive that isn't part of a trip ends up being sorted at the very end of
the dive list).
This commit contains a "testSlot" implementation to remind me how to
figure out which dive / trip we are on.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some users might want to really see nothing but trips, others might want
to be able to keep the trip with the selected dive open.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far we support "expand all" and "collapse" all. This still needs to
be restricted to only be shown when in trip / tree mode.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we have a "selectDive()" method, let's just use it rather than
opencoding it. Similarly for "unselectDives()".
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These changes should be correct - but they still don't fix the problem
that after we click 'OK' on the preferences (regardless of whether any
changes were made), the first dive is set as current dive and shown in the
map window.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We'll want to enhance this: better logic for which dives are near the
selection, and it's probably best to have a "control-click" that adds
the dives to the selection rather than deselecting all the old ones.
But it's already useful.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Not showing them at all was a little too blunt of an instrument. There
likely are dive spots with the same name at different resorts. And even
at the same resort you could have multiple morings for the same dive
site.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The check to only update the dive if there were already dives selected
before seems bogus. I'm sure I put it there for a reason but it seems
flat out wrong.
This gets triggered when you select a trip by clicking on the trip
header. In that case all dives get unselected (amount_selected = 0) and
then we try to select the first dive in the trip - which fails because
of this check.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added a new widget, MinMaxAvgWidget, a simple widget
that displays values in 'min, max, avg' fashion.
it has a setMaximum, setAverage and setMinimum
methods, that is userful for setting the minimum,
maximum and average of stuff. Ah, it also shows
the minimum, maximum and average of things.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This function was supposed to take the default_prefs into account but
clearly wasn't.
Now it should be much more readable and maintainable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This helper wasn't called as intended - but because of the syncSettings
call which emits settingsChanged this only became visible for the
default_filename.
Next I need to clean up what is called for the settingsChanged signal.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Things got broken. Again. We no longer kept track of the selected dives in
our structures which broke statistics.
This attempts to fix that, but appears to still have a bug when selecting
trips. Sometimes this results in 0 dives being selected according to our
data structures, while Qt happily shows all dives of the trip as seected.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code so far had completely ignored Metric / Imperial. Turning this
into a three way radio box seemed to make much more sense.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a feature that had been requested a few times in the past and when
debugging my "show only used gases" commit I realized that this would have
been extremely useful to have...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The keyboard movement wouldn't scroll to the newly changed selection.
Similarly, when sorting the dive list, we'd end up losing the currently
selected dive (and generally collapsing the currently exposed trips).
This adds the scrolling/exposing logic for those cases.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The hardcoded position we previously had would make the text invisible
if a ceiling was drawn during the middle of the dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The equipment tab will still show all defined gases, but the info for
the dive should only list the ones used.
Also change the name of the two gas related boxes to better reflect the
data that is shown.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply renaming all the elements with name conflict. None of these names
appear to be referenced anywhere so this seems like a rather odd thing to
happen - why doesn't the tool just rename them for me when I open and
close the file in designer? Or at least warn about it?
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a helper function to determine the Subsurface data directory
(are we running from build directory? installed on Linux? installed on
Mac? - still need to add support for Windows). This same function is
then used by both the setup for Marble and for the help browser.
This assumes that the user-manual.html file has actually been built and
installed (which we don't do by default with the current Makefile).
Right now there are rendering issues with our manual in the help browser
widget - I'm sure this can be fixed...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added a preliminary support for a manual display widget,
it's a very basic HTML text-browser, so it can have
hyperlinks, images and everything that a 1995 browser
has.
The long term plan is to subsittute this manual by
a more modern 'help' using QGraphicsView, that will
interact on the application level.
See #121
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
In commit b8d31d8534b ("Show ceilings for individual tissues") Robert
inadvertently broke the connection from dc_ceilings to red_ceilings and
also didn't correctly enable the checkbox for all_tissues when
calc_ceilings was already set in the preferences before the dialog was
created (and therefore the connection in the .ui file isn't run).
There's also a simplification / cleanup to the code deciding whether to
show all the tissues.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I think that displaying tissue loadings either as pressure or as
percentages is not very intuitive but that it makes much more sense when
translated to ceiling depths.
This change enables just that for the 16 tissues in our calculated ceiling
and visualizes this in the profile graph.
There is a checkbox in the preferences to turn this on. If enabled, all
tissues having non-trivial ceilings are also shown in the info box.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since I already put the center-allign label on the interface designer,
this was just dead code. getting rid of it.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This moves the contents of the statistics tab to groupboxes,
so it's similar to what we had in GTK, but a bit prettier.
it's not what I plan to do in the final form, since I think
that a few 'min max avg' can be in it's own widget ( and maybe
a cute graph showing the values would also be nice. ) but its
an improvement from what we had.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>