Change the name of the template "base" to "two_dives" as this name
describes it better.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Having a pointer to the printing_options struct, it should be
used to privide the selected options while printing.
Print options used ATM:
- number of dives per page
- template file name
- print in colors
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
As the print_options struct is needed by both TemplateLayout and Printer
class, it can be passed to their constructor.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This is a Grantlee template to show 1 dive per page.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Add another printing option to the print dialog.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
We render the dive profile over the QWebView to the QPainter. This helps
us not to save the SVG images to disk and then render them again to the
webview.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Odd number of dives needs extra space from the buttom, so that when we
scroll to the last page extra whitespace is shown under the last dive
frame, this is fixed by adding a default footer to the base template.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Check for NO_PRINTING instead of checking for NOT NO_PRINTING.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Enforce a minimum duration for gas switching in the planner.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the option for a minimum gas switch duration to the planner UI. This is not actually used yet.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way the newest dive gets shown first (which I think makes much more
sense) and the dives are in order as we show them in Subsurface.
I actually think we should toggle trips on by default - but I'm not sure.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I never ran into this because all of my computers have a global default
set for my name and email address. But if the user never uses git and has
no global settings there will be no such info. Instead of failing we need
to just set up a default ID and then try to get a best guess from the OS
(just as we used to do before libgit2 supported getting the git settings
for authorship).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is re-run every time we update the dive list model for the UI, but we
should run it a first time right after loading the dives so that this data
is correct even without the UI running - this way the data in headless
standalone applications like the HTML exporter is correct as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This brings up the satellite view when clicking on GPS coordinates and
sets a slightly better page title.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There where some issues with trying to access non-existing dom elements
when clicking them when showing trips.
Instead of fixing that issue, this actually makes them do something
useful, expanding and collapsing the trips.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We keep forgetting to remove include files after modifying the code in
ways that no longer requires them.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It appears the standard way to figure out what type of element is sending
the event is to use .target instead of .toElement - specifically, Firefox
doesn't understand .toElement and so the expansion of dives by clicking on
them didn't work in Firefox.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Save and load a usually unused copy of the preferences with the units that
were active the last time the dive list was saved to git storage (this
isn't used in XML files); storing the unit preferences in the data file is
usually pointless (that's a setting of the software, not a property of the
data), but it's a great hint of what the user might expect to see when
creating a backend service that visualizes the dive list without
Subsurface running - so this is basically a functionality for the core
library that Subsurface itself doesn't use but that another consumer of
the library (like an HTML exporter) will need.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we switch to a different remote (let's say we opened a local git repo
and want to save its content to the cloud storage) then don't check to
make sure that the branch stayed unchanged (because, duh, it's a different
remote, it will have changed).
This fixes the problem where you could open an XML file and store it to
cloud storage just fine, but opening a local git repository and then
storing that to cloud storage failed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The <ul> tag must be closed as defined by the html specs.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The previous Fix silly typo patch didn't quite work. This one should
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit e21cae2d46 ("Cloud storage: sync the remote after save") broke
regular git saving without any remotes: it would never initialize the
"remote" pointer, and then use that uninitialized remote pointer to see
if it was a cloud storage remote that it should try to sync.
Fix it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This got broken in a recent transition to more abstract models.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Switch the column order of the planner notes table so that duration is displayed before runtime. This is consistent with:
- the verbatim output order, e.g. "Stay at 12.0 m for 3:00 min - runtime 32:48 on EAN50"
- MultiDeco, e.g. http://www.hhssoftware.com/multideco/view_multideco.html
- Planner on the Shearwater Petrel
- How I have been taught to write out my dive plan in my wetnotes
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was a poorly implemented hack when we executed the reverse geo lookup
in the main thread and opening a V2 file could take a very long time. We
need to do the "Welcome" message quite differently.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This isn't perfect, but at least tells the user if we weren't able to
connect and are working just off the local cache.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is mostly a proof of concept right now; it shows that it is possible
to create a headless server application that exports a git repository
based data file as html.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to be able to initiate an HTML export from the core library we
need to separate the actual logic from the UI.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This seems quite convoluted to me but I can't seem to make a more straight
forward implementation work. The idea is that core code should never
directly call into the UI.
So instead the core code (this is C code) calls a helper function. That
helper function calls a member function of a class which in return emits a
signal. The UI code connects to that signal and acts accordingly when it
is received.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>