This code is the same that is used on the MainTab, but
since they are different objects, I can't just call it.
so I'm duplicating them for the time being.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code used to trigger the edit mode a long time ago
since now I'm re-reading the code to implement the
same stuff on the Location edit mode, I realized that
this is not needed anymore.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When using gasmixes where the difference is less than 2% the planner can't
caclulate casconsumptions correctly. This sets the minimum gasdifference
to 1%.
Fixes#795
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Back in 4867ee8ad8 ("Move the Profile out
of the mainwindow.ui") the way to access the PlannerDetails object
changed.
This does the corresponding change to the NO_PRINTING block, making it
build on Android again.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Expand the undo feature by storing a list of renumbered dives' ids
and numbers so that the original numbers can be restored if needed.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is another long operation that needs showing a notification about
importing the old format log files
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Showing an Error message is better called from the Notification Object,
So for consistency old references to showError is replaced by calling
the notification object.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The main error message bar can be used to show exporting information and
other notification.
So a new Notification handler object is created in the main window
<NotificationWidget> that inherits <KMessageWidget> that shows different
type of notifications, ex. (Warning, Error and information)
Also this class contains a QFutureWatcher object that is set to handle
the QFuture variable returned from the exporting thread. this will allow
the UI to be updated when the thread finishes execution.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This addes a menu entry for the user to select a directory that is recursively
traversed to look for image files and compute the hashes of those images (for
those images to be available to be displayed in dives according to their hash values).
This traversal and hash computation happens in and independend thread and so far
the only feedback to the user is that upon completion the dispayed images are updated.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Upon successfull reading an image file, this computes a SHA1 hash of the
image and saves it with the picture tag in the log file. When a file is
not successfully loaded (for example because the log was created on a
different computer) we look up the hash in a dictionary that maps hashes
to local file names.
That dictionary (actually two for both directions), is loaded on startup
and saved upon destruction of the main window.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is somewhat invasive as aborting the XML file read requires us to
report things up the recursive parsing chain.
What we really need to do here is to ask the user how they want to use the
data from reverse geo lookup. But for now we only warn about the fact that
this can take a while.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We had a ton of helper functions in qt-gui.cpp which really didn't make
much sense. So I moved them all into qthelper.cpp.
Also moved the UserAgent helper that didn't belong in the UpdateHandler to
begin with - that's a generic helper used in many places...
With this we can successfully build using cmake again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This could cause problems if the user tries to compile with
Qt versions between 5.0 and 5.2.
Reported-by: Michele Fabi <fabiemme@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
version.c is now object code which is recompiled each time
ssrf-version.h changes, while the interface file version.h
remains that same at all times and files which include it
will not need to be recompiled.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The intention had been all along to use the 5.4 QSysInfo API, but due to
a silly mistake in the QT_VERSION check, it never got enabled for 5.4.0.
On 5.4.1 it does get enabled and, unfortunately, causes compilation
errors because the API changed between the time we backported to
Subsurface and the final version.
This commit backports the final QSysInfo API from Qt 5.4 into
Subsurface, which includes the renaming of a few functions. Since the
prettyOsName function no longer exists in the Qt API in that form, I've
reimplemented it using the API that does exist.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes prefs.display_unused_tanks also relevant for the planner.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Null values should be handeled nicely instead of showing NULL or Nan.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't compare to static english string, must translate first.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adds the ability to undo shifting of dive times. The change is captured
at simplewidgets.cpp and an undo command is created.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we accept a change on the dive site management screen, it needs to be
reflected on the Dive notes tab right away.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the user clicks on manage (or double clicks on the globe) and the
displayed_dive doesn't actually have a dive site associated with it (e.g.
because we are adding a dive or because it was imported or downloaded
without dive site information, then we need to make sure that there is an
empty dive site that we can make changes to.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And hook things up when double clicking the globe.
The user experience isn't consistent with what we do on the main tab
(i.e., no coloring of fields that are changed), but it seems to work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a bit awkward now. We are downloading what looks like fake dives
in the v2 format. So we create a dive site for every single fix.
After we merge those new dive sites into the existing dives we need to
throw away all the dive sites that weren't used.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems to make sense to only have them on the dive site screen. For the
main UI they were redundant (we have the map) and not all that useful. The
only time people would want them is if they wanted to manually add GPS
coordinates for a dive, but that should now be done via the dive site UI.
There are a couple of FIXMEs in the code and a few code blocks that have
been commented out as they will be needed in one form or another once this
GPS handling is done on the dive site UI, which right now it is NOT.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This simply tracks the names - if we have multiple dives sites with the
same name but different other data (e.g. different GPS), we could easily
get this right (well, somewhat easily, it's a UI question), but for that
we'd have to filter for dive site uuid instead of for dive location name.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>