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>
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>
.. otherwise the dive tags generally end up cleared when you download a
duplicate dive from another dive computer.
This uses MERGE_NONZERO, which means that if one of the dives has tags
set, we'll prefer those tags. If both dives have tags set, we take the
tags from the first ("preferred") dive.
We could do a "just or all the bits together" too. But this way we at
least take a set of tags that are consistent (ie we don't get both
"boat" and "shore" set unless one of the original dives already had that
inconsistency)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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>
Thiago showed me how to find out which style is in use and if we see a
user is running gtk+ we simply switch Subsurface to Oxygen (using the
old plastique in the previous patch was a result of reading an old Qt
book, I guess).
Solved-by: Thiago Macieira <thiago@macieira.org>
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>
I'd much rather be able to check if it is using the Gnome style and only
then force plastique but I haven't been able to figure out how to do
that.
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>
The default build will now create the HTML documentation (only the HTML
one) and the install rule will install it.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
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>
There was already a code for that on the maintab.cpp, but
since I moved all labels to groupboxes, the code stopped
working, and I tougth it'd better to kill the code since
it's faster and safer to use the interface builder for that.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This is a redesign-tryout of the info panel, it's not the way
that I want to do, actually - I think that textual representations
are quite boring, and we can do much better if we use better widgets,
for instance, a Calendar to show the date, a Termometer to show
the temperatures and so on. This version has a fixed layout, but
I'll most probably try to make it more dynamic in the future.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Press CTRL+F and a line edit will appear, whenever you write on that will
be used as a filter against all columns. The results are maybe somewhat
surprising in trip mode, but when sorting by another column this shows
some potential.
Hit ESC to remove the filtering.
I need to find a better position to put the Widget, but it's a proof of
concept.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This small patch enable maintab to be in 'Document Mode', this means
basically that it size is smaller and there's not a line separating
the widget anymore, giving the user a more smooth experience.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Following Dirk's commit ae2c132, add support for custom google sat
data in a MacOSX app bundle
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The download already worked, but we didn't display the new dives. This
introduces a new slot for MainWindow that updates what is displayed in
Subsurface after files were imported.
With this change we can successfully download ONCE - but when trying to
download a second dive the dialog doesn't appear to get refreshed the
right way - the OK button doesn't appear to work anymore (Cancel however
does).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
First try if Google Sat is already installed as a provider (and just use
it if it is). Then use the executable path to make an educated guess where
these files might be found as part of Subsurface.
We now install the necessary directory tree under
$(DESTDIR)/usr/share/subsurface/marbledata
Still far from perfect - but this should work at least on Linux. MacOS
will need a different modifier for the path and Windows I haven't even
thought about, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Makes it easier to open them using Ctrl+k in Qt Creator.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>