We will however create a new dive site when the user clicks on the add
button - creating it here would led to strange behavior.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
setLocationId will filter the dives, so ignore the visual changes when
accepting / rejecting, it will only be triggered again when we are showing
this dialog again.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We should only set the dive_site on the dive site management widget when
we are going to use that information, this is because the dive_site
management widget will filter all dives on the dive list.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The suit field should take up all the remaining space and the stars should
be vertically centered with the text.
This looks much better
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The parent here should have been the mainwindow, but we create this dialog
on the stack instead of the heap and because of that we don't set the
parent to prevent a double free.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch makes the export dialog more consistent with the rest of
Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the single filter dialog - the spacing is much better, but when
activated it seems cluttered, this is because the outer layout (the one
that encapsulates everything) has the wrong layouting - I need to find and
fix that. I'll actually change that to a splitter, it will provide a more
flexible resize of the widgets.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also, added tooltips to the Tab Texts.
I need to fix the layout issues of the Equipments, but that's not inside
the UI. Things are much more sane now.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I seem to have found a sane way to create layouts:
If it's the 'outer' layout, the one that encapsulates everything:
- Horizontal Spacing: 5
- Vertical Spacing: 5
If it's a vertical inner layout that is grouping items like label +
control:
- Spacing: 0
This way the label will be 'touching' the item, without empty space, so
you know that the label refers to that widget.
If it's an horizontal inner layout:
- Spacing: 5
Different from the Vertical Layout, we don't want to make horizontal items
touch each other, a bit of space is fundamental to the eyes.
If it's a Grid Layout:
- Vertical Space: 0
- Horizontal Space: 5
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this worked for a bit, it was very error prone as it relied in
layout having specific names, and layouts in the .ui files are treated as
substandard items. Every time a 'break layout' command is issues (and it's
issued quite a lot when trying to reorganize the items on the widget) all
layout items are removed and new ones are added later, without any of the
names.
Since the new layout can be different the old names are not usefull
anymore - and a clean compilation won't trigger a single warning either:
the name resolution is done at runtime and not at compile time, so it
would just fail silently.
Instead of brute-forcing each layout to have 0,0 or 5,5 margins, we should
put the correct values on the .ui files.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I`m now clearing the code for all use of Qt < 5, since Qt 5 was released
for quite a while and making two versions of Qt to work together is a bit
painfull.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a bit aggressive as it changes the globe with every single
character that's entered, but it's better than what we had before.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We still don't respond correctly to a user changing them (i.e., the map
doesn't change), but at least once they change the dive to a different
dive and back to this one things get done correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a field to the units preferences to have GPS coordinates
show as decimals (as for example Google maps does it).
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
so it affect no longer the previous leg but all the following ones
with the same gas (i.e. until the next gaschange).
This makes the add dive/planner behaviour more consistent
with the rest of the program regarding gas changes.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We shouldn't allow the user to change the location when we are probing
the web for the correct places if we are updating an old file from
Subsurface. This makes use of a pleasant spinner that works beautifully.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
'enable' and 'disable' is too generic, and we are only
blocking the geolocation edit.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Open dive file. Click Location-manage. Pick a site. Click close. Click
Location-manage again. BOOM.
This seems to make sense, but since not a lot of the code is hooked up
yet, I'm not sure this is what we want in the end. But for now it prevents
an easily reproduced crash.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The SimpleWidgets file was getting too big, and location information will
also need a new model - a good way to do not mix everything is to put
things in a new file.
[Dirk Hohndel: added missing include of stdint.h]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a few interface items to handle location editiing, a combobox to show
everything, and three buttons: add, edit, delete.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The layout was just plain ugly; this fixes that and also adds the
possibility to insert new controls that will be userfull for managing the
Locations.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The maintab should be disabled when the geolocation thread is
running - but if you changed the dive, it would reenabled it.
(actually this should be only on the location widget, I'll send
another path later)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I don't know what happened to me, I connected to some signals that didn't
exist at all.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For free dives (corresponding to dive mode or duration shorter than
15min), the display format for duration is changed to display minutes
and seconds.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this worked on Linux, on the Mac we didn't have an input field to
enter the file name. With this we explicitly declare that this is a file
save dialog and that the user can specify a non-existing file name.
Fixes#872
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So just like tags do "differential editing". Figure out what (or in this
case, who) was added / removed from the displayed dive and do the same for
all other selected dives.
This does seem a bit over top for divemaster, but this is more consistent
and therefore should make more sense to the user - assuming we ever have
one who runs into this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As a side effect this changes the signature of plan(): Before it
returned an int that was supposed to be possibly an error but
we never bothered to check it. So now it's bool indicating if the
planner did add stops.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The initial selection change signal seems to potentially be sent
before the listview is even visible when we do the first "scrollTo()"
to the currently selected dive.
That, in turn, seems to result in that when the listview is actually
shown, it will be scroll the trip description off the visible area,
and force the current dive to be shown at the very top of the
divelist. Which is not very nice: we do want to scroll to the current
dive, but we don't want to hide the current trip in the process.
Ignoring the selection change if the listview isn't even visible seems
to fix things for me.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes Collapse All only visible when its needed, and it
also fixes a crash when invocking collapse all when there was
nothing to collapse.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch unclutter the menu by hidding collapse all
when all dives are collapsed, and expand all when all
dives are expanded.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes Subsurface usable faster for those without a good internet
connection when they are opening an older data file.
While parsing, we are only feeding an vector of locations, after the
parsing is done, we traverse the vector searching for the information on
the web.
I need to also add a way to stop if there`s no internet connection - but
this will be another patch.
Also, fixed two small memory leaks from the old imp.
[Dirk Hohndel: cleaned up the whitespace mess]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
... but discard an old disclaimer and runtime table if present.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is to avoid visual clutter when replanning logged dives.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If there are more than 100 samples, average some of them so we end up with no more than 100.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old behavior was kind of crude. Just smack the tags that were on the
displayed dive on all selected dives.
This seems to make more sense. We figure out which tags were added to the
displayed dive and add them to all selected dives. And we remove all tags
that were removed from the displayed dive from all selected dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old behavior was kind of crude. Just smack the tags that were on the
displayed dive on all selected dives.
This seems to make more sense. We figure out which tags were added to the
displayed dive and add them to all selected dives. And we remove all tags
that were removed from the displayed dive from all selected dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Oops, we left the (UEMISSDA) in the path. This can never have worked
without the user manually correcting it to just show the drive letter.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we run out of space in the Uemis filesystem we return an error. The
user could reasonably unplug the SDA, insert it again and then retry to
continue the download (that's what we tell them to do). In that case we
need to make sure we start at the correct dive otherwise the same dives
keep getting downloaded over and over again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dialog didn't accept "OK" and store the dives downloaded / selected so
far if there had been an error. Especially with partial downloads from the
Uemis SDA this is something that is quite reasonable to want to do, so
allow exiting the dialog with OK even after an error.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of writing each dive out to a file and reading that file back in,
let's just use the internal helper function that places the dive as XML
into a membuffer.
So much simpler, so much faster.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Previously we simply failed silently without showing the user any
indication that something went wrong. That seems wrong.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This disables planner UI elements in recreational mode that have no function
in that mode.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive context menu:
After the addition of the item "Add image(s) from web" the item
immediately above is "Add images". It is proper to specify now:
"Add image(s) from file(s)" to make the distinction clear. I also
change "Shift times" to "Shift dive times".
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a new divelist context menu entry which asks for a URL. The file
is retrieved and if it is an image it is added to the cache and the url
is associated to dives as with local files.
NB this currently only works with URLs pointing directly to images. But it
should not be too hard to add the possibility to add a direction via an html
file and its image tags.
To test: open dives/test43.xml and delete the image and then add the URL
http://euve10195.vserver.de/~robert/wreck.jpg
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use more explicit variabel names and make the get timestamp function actually
return the timestamp rather than getting a pointer argument
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we delete a cylinder the gas changes in that dive may have to be
adjusted. We didn't do this at all in the past. With this commit we should
be doing this right for a single dive that is being edited.
This does NOT handle multiple dives being edited at the same time (or more
specifically - if you have multiple dives selected and delete a cylinder,
the dives that had the same set of cylinders (other than the displayed
dive) will get that particular cylinder deleted, but won't have their gas
change events (and sensor data in the samples) adapted.
Possibly we should simply prohibit deleting cylinders when more than one
dive are selected.
See #834
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now the way to edit the profile of a manually added dive is really
counterintuitive: you have to first make some random change to the dive
information, then the profile switches in to editing mode.
This commit adds a simple context menu entry on the profile that is only
shown when the a manually added dive is displayed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
XSLT conversions create V2 XML files, but we shouldn't abort when we parse
those without having the user informed about the potential slowness - all
XSLT based imports are slow, anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Oops, that was embarrassing. Just setting it on displayed_dive doesn't
gain us anything if it isn't transferred to the selected dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We assumed that a trip was selected when all of its dives were selected
instead of just remembering if the trip itself was selected. I'm sure
there was a reason for that but I cannot think of any. But a side effect
is that if you have a trip with only one dive in it and have that one dive
selected and edit it, after saving your changes you end up on the trip
(which is now also selected) and are no longer on the dive. And that seems
quite wrong.
The new code simply remembers that the trip was selected. And selects it
again if it was.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we run out of space in the Uemis filesystem we return an error. The
user could reasonably unplug the SDA, insert it again and then retry to
continue the download (that's what we tell them to do). In that case we
need to make sure we start at the correct dive otherwise the same dives
keep getting downloaded over and over again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dialog didn't accept "OK" and store the dives downloaded / selected so
far if there had been an error. Especially with partial downloads from the
Uemis SDA this is something that is quite reasonable to want to do, so
allow exiting the dialog with OK even after an error.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the functionality to undo/redo removing of dives from trips. The
code calling remove_dive_from_trip has moved to the UndoCommands class.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planned dives must be replanned while manually added dives must be edited.
Show error messages to handle wrong user input.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since most regulators have an intermediate pressure of 10bar
the minimum value is 10 while the max is 99.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With the addition of gas reserves in recreational mode
we need to make sure that the first leg is short enough
that we have more gas left than the specified reserve
even when using small cylinders like LP72.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
OSTCTools is a windows based software by Robert Angeymar which performs
configuration upgrade, memory analysis and download tasks for H&W OSTC
devices.
Downloaded dives are stored in files (one archive each) with the raw
binary data heavily padded at the begining of the file, and some other
data not included in H&W dive header protocol as the device's serial
number.
The import function simply takes the raw data part of the file and lets
libdivecomputer do the parseing.
Then adds some additional info as OSTC reported dive number and serial
device number.
Please note that OSTCTools is *not* a real logging software, it simply
gets the DC raw data, so there isn't any information about dive site,
equipment and so.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adopts the planner to the needs of the recreational diver. Rather than immediately
starting to ascent doing deco stops this mode, this mode stays at the last manually
entered depth for the maximal time before mandantory stops appear (NDL). It does not
change gas but keeps using the last used cylinder.
TODO: * Grey out unused UI elements of the planner in this mode
* Start ascent before gas runs out (or into reserve)
* Do a 3min @ 5m safety stop.
Fixes#840
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Once a manually added dive is part of a trip and this trip
is edited, applying the modifications leaves the dive profile
in edit mode (e.g. points can be dragged and gas swapping can
be applied).
The issue can be viewed from another angle. Why enable
profile edits of a manually added dive which is in a trip,
while the trip is being edited in the first place?
If there are more than one manually added dives in said trip
we are enabled to edit one of the dive but probably
it's not intended to modify all manually added dives after the
changes are applied for the trip.
This patch disables the functionality in question and it also...
Fixes#864
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
once the manual added dive is added it can't be edited directly, This
can be fixed by adding an edit button to the log menu, this will be
consistent with the plan/replan buttons.
Fixes#847
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds to the prefs struct the variables last_stop, verbatim_plan,
display_runtime, display_duration, and display_transitions from the
planner so their values are saved from one session to the next.
The widgets for some of those settings had default values in
plannerSettings.ui; remove them since the new code in
subsurfacestartup.c takes care of initializing them.
Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Non-static class member recalc is not initialized in the constructor
Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Non-static class member multipart is not initialized in the constructor
Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This add support for Seabear's new import format that is used by H3 and
T1. In the future also the Hudc should switch to the new format. The
main difference to the old one is that time stamps are no longer
recorded in the samples, but intervali is specified in the header.
The header contains other useful information as well that we should
build support for. E.g. surface pressure, gas mixes, GF, and mode might
be useful additions later on.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When an user opened the "Save as" dialog and pressed the
cancel button a null string was returned. Therefore the
file_save_as function returned an error which was lately
shown when the file_save function was called.
Now the function checks if the cancel/exit button was
pressed and returns.
Fixes#844
Reported-by: longjohnsilver
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
test case:
1 - make sure that you DO NOT have anything selected on the 'Dive list;
2 - in the menu bar, click on 'Log'->'Re-plan dive';
3 - crash!
Fixes#858
Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The current code is dereferencing the null pointer 'profWidget'.
It can cause a segmentation fault.
Signed-off-by: Marcos Cardinot <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Even that most (or all) tables have the remove button at the section 0, the method defaultColumnWidth should not assume that it will always be true.
This patch will consider the title width of each section, instead of using a static width (which cause problems when the language is not en).
Signed-off-by: Marcos Cardinot <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>