Section 3 is quite a long section. Ten of the screen shots are replaced.
Large numbers of typos and inconsistencies are corrected.
A few sentences are included e.g when dealing with the Subsurface Companion.
Section dealing with creating libdivecomputer dump files has been reorganised
slightly.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds the optional --win32console command line option.
It does nothing on OSx and Linux, while is only useable on Win32.
On Win32 if the application was built as GUI (not console),
there is no way to view stdout and stderr. With windows.c's
subsurface_console_init() we are able to either redirect
stdout and stderr to the terminal from which subsurface.exe
was started (always happens; --win32console does nothing in
this case) or if --win32console is explicitly added to
a shortcut, create a dedicated console window and monitor
the output there.
if set, WIN32_CONSOLE_APP is a condition that will make the
subsurface_console_init() and subsurface_console_exit()
functions NOP on Windows. The definition will be created if
the user passes 'CONFIG += console' to qmake.
Fixes#436
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the user passes 'CONFIG += console' to qmake, we define
WIN32_CONSOLE_APP that will be used in the source code
to determine if this is a console or a GUI application on Win32.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manipulating cylinders, especially changing the exact gas content (o2,
he), changes the pp02, ppHe graphs. This patch simply replots the profile
in case of cylinder change at time of saving.
Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In bf205726 DEPTH/Switch at was disabled by commenting out that code.
This puts it back behind ifdefs
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The added characters by auto-completion "for the last item"
isn't saved when using Return to save it "works well with
tab"
Fixes#469
Signed-off-by: Yousef Hamza <jo.adama.93@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We didn't care about system default fonts and sizes, we just used the Qt
default font.
Due to how QFont is constructed, there was need to split font and font
size.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Changeset a90818671 introduces a small inconvenience. The pp graphs at
startup are not shown according to the visibility settings. Requiring to
toggle the icons to show the desired pp graph.
Trivial fix.
Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds the current dive time and the adjusted time to the time
shift window. I added a function to dive.c to get the timestamp of the
first selected dive.
This will view the time of the first selected dive only even when multi
dives are selected but it does change the times for multiple dives
properly.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Changeset ee2e43f introduced a small bug. The default dive file as set in
the Prefences is not opened, requiring manual opening. This patch
reshuffles a little code, allowing first the preferences being set, and
than using it.
Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The handling of keyboard is broken on Qt inside QComboBoxes.
I'm trying ( and losing ) to make it less broken. This patch makes the
code work reasonably well if you press Key_down or Key_up after having
displayed the filter popup, which is different from the combobox popup for
some reason.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should make the layout work better on smaller screens.
Fixes#458
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The only place on the code that the y() position didn't accompanied the
dive-depth was this one, so let's see if this patch fixes it.
See #455
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we create, then set the value of a variable, we are wasting cycles
and making the code more verbose.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Let's not be evil by creating "" as empty strings inside of the code,
really.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch removed the use of copy-constructors on the QString to use the
const-references. Even knowing that the QString is a refcounted class,
let's not get that bad habit.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The offending code is line-by-line equal to the completion highlited
method, so why make it duplicated? Call that method instead.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When I'm on a dive trip i usually download dives multiple times to start
logging them while i still remember them. When i have already created a
trip and downloads new dives they needs to be able to be added to the
already existing trip, without relying on autogroup.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes the git object save logic also check out the changes in the
working tree and index if the branch we save to is checked out. It used
to be that we would just update the object store (and the branch ref, of
course), but leave any checked-out state untouched.
Note that if the working directory is dirty (ie you have made changes by
hand and not committed them), the checkout will skip any dirty files and
report it as a warning to the user. However, the save still succeeds
(since the _real_ save goes to the backing store).
NOTE NOTE NOTE! Both loading and saving very fundamentally work on the
git object store level, and if you are working with a checked-out branch
and make modifications to the working tree, saving will not touch those
dirty files (so that you can try to recover your edits manually in the
working tree), but it's worth pointing out that subsufrace loading state
will totally ignore the working tree.
So the only way to make subsurface *see* your changes is to commit them.
Having edited state checked out in the working tree will only confuse
you when subsurface first ignores it on reading, and then refuses to
touch the checked-out state on writing.
Put another way: working with a checked-out branch is now _possible_,
but you need to be aware of the limitations.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When some arguments like --help and --version are passed to the
executable, we don't need to create the UI at all.
This patch separates the QApplication creation which is at first
only needed to parse the arguments and then if exit() is not
called from subsurfacestartup.c, we can call some of the
"init" methods such as setup_system_prefs(), fill_profile_color()
etc.
At this point init_ui() can be called which no longer needs
to accept the command line argument list.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt5 uses different widths for some of the poly. lines
in the profile. Setting an explicit value fixes that.
Tested-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When using Up/Down arrows to scroll the tag list it always selected the
first item in the list and doesn't scroll.
Fixes#468
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After editing values in cylinders or weights hitting save will not save
the changes to save the edit one must move the focus to a different
field first this is fixed by losing the focus before saving the changes
Fixes#412
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When building and running subsurface out of tree, marbledata was
inaccessible to subsurface.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
display.h: dc_number is unsigned int, thus a couple of warnings
may pop-out.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After the dive log has been closed, the ProfileWidget2 does not clear
the pn2 po2 and ph2 gas line.
This patch cleared the three lines after dive log closed.
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Hugle <wulong@comp.nus.edu.sg>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are no utf8 in those strings, and we can translate them as
everything else with tr() instead.
QApplication::UnicodeUTF8-part is deprecated and removed in Qt5.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The text for these two sections has been corrected and updated
in order to be ready for the release of V4.1. The very first
paragraph of the manual is expanded substantially.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The selection logic was a bit random: some places would return NULL if
the dive computer index was out of range, others would return the
primary dive computer, and actually moving between dive computers would
just blindly increment and decrement the number.
This always selects the primary computer if the index is out of bounds,
and makes sure we stay in bound when switching beteen dive computers
(but switching between dives can then turn an in-bound number into an
out-of-bounds one)
Fixes#464
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I had intended to amend the previous commit with this before pushing it
out. This changes the comment that pointed out the bug that the previous
commit fixed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Turns out we unconditionally set all events as visible when redrawing the
dive - even with a comment that this should take into account if the event
is visible. Oops.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A new figure is included to reflect the actions of the new profile buttons
on the calculated ceilings.
A number of small edits on sections 4 and 5 of the user manual are done.
These sections are now finalised for the new release.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This got lost when we switched to the new profile.
Remove event works. Hide events does call hide() on the DiveEventItem but
for some reason it stays visible. I'll hope for one of the more
experienced Qt people to fix that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the user tries to delete a cylinder that is in use and that action is
rejected, the cylinder widget (and the whole dive) should not be put into
edit mode. After all, nothing changed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add simple test dive to show the erroneous pp graph in case of
multiple periods of high p02. See commit aa0cd792bb for the fix.
Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We always checked if the tank was in use by the planner / dive editor -
even if we were not in dive edit mode.
With this patch, when not in dive edit mode, we check our cylinder "used"
flag instead.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
commit d681bdcb63 ("Only use default cylinder for first one") has a
stupid bug in that it only calls get_tanksize for the first tank. That's
of course completely bogus.
Thanks to Linus for catching this.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When downloading from a divecomputer it makes little sense to assume that
all tanks are the default cylinder.
There's a good case to be made for having a default first cylinder (you
always dive with your own cylinder, or you are always on a dive boat with
AL80 tanks), but in multi-cylinder situations this is much more likely to
cause unintended harm; for example for those dive computers that always
report their maximum number of cylinders, even if some of them aren't
used. Here setting a default cylinder turns those entries from obviously
empty into something that appears to have meaning (i.e., cylinder type is
filled in) even though this was just a default added by Subsurface.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We used to fall back to an AL80 default cylinder, but that meant that a
user who doesn't want a default cylinder at all had no way to indicate
that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Especially in O2 decompression parts of a dive, the pp02 is typically very
close to the threshold value (normally 1.60 bar). The old implementation
of the pp profile graphs assumes that there is exacty 1 consecutive set of
samples that needs to be in the "warning color". This results in an
erroneous display of the mentioned graphs, connecting multiple episodes of
too high pp with bogus lines in between.
This fix generalizes the pp graph logic to allow for multiple segments of
high pp, each to been drawn seperately in the "warning color".
Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This reverts commit e70bbb637e
Linus' solution in commit 27c36ec4cf ("Improved handling of git syntax
names with no git repository") is much better and makes my hack
unnecessary.
This makes "is_git_repository()" return non-NULL for all file names that
match the git name pattern, even if we don't find an actual git
repository there. That way, we won't fall back to writing out an XML
file with an odd filename.
If there is no actual git repository, we return a special invalid dummy
pointer, and then the git reading and writing routines will catch it and
return the appropriate error.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>