Commit graph

8577 commits

Author SHA1 Message Date
Gehad elrobey
42b9d0d047 Printing: add a "one dive per page" template
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>
2015-06-19 21:41:57 +03:00
Gehad elrobey
17470f6822 Printing: add a "one dive per page" option
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>
2015-06-19 21:41:57 +03:00
Gehad elrobey
cd30e11672 Printing: render the dive profile on top of QWebView
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>
2015-06-19 21:41:56 +03:00
Gehad elrobey
1040f0d4e5 Printing: fix rendering bug for odd number of dives
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>
2015-06-19 21:41:56 +03:00
Gehad elrobey
c152314790 Printing: fix "if" condition clause in cmake file
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>
2015-06-19 21:41:50 +03:00
Rick Walsh
845030a8ad Enforce planner minimum gas switch duration
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>
2015-06-19 09:15:51 -07:00
Rick Walsh
4dfdea1e1d Add planner minimum gas switch duration option
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>
2015-06-19 09:15:09 -07:00
Dirk Hohndel
ab90375c19 Use remote transport parameter instead of comparing strings
We pass it in, we might as well use it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-19 07:31:15 -07:00
Dirk Hohndel
c765fb5961 Windows support: correct helper function name
Apparently no one ever tried to build with an old libgit2 on Windows...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 23:37:22 -07:00
Dirk Hohndel
293569cb19 HTML export: before showing the dive list, sort descending by dive number
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>
2015-06-18 22:04:11 -07:00
Dirk Hohndel
f5510892a6 HTML export: cosmetic change to show 20 dives by default
10 just seemed a little... low.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 22:03:13 -07:00
Gehad elrobey
d23e71e99a HTML: Fix spelling mistake
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 21:31:18 -07:00
Dirk Hohndel
89ca3c69c1 Git storage: don't abort if there is no default user/email set
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>
2015-06-18 14:12:01 -07:00
Dirk Hohndel
bd6e75a49f HTML exporter: don't try to write to NULL file descriptor
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 12:23:58 -07:00
Dirk Hohndel
6ad3453af0 HTML standalone exporter: use Subsurface dive numbers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 12:23:30 -07:00
Dirk Hohndel
d11b3743eb HTML standalone exporter: give up if parsing the input fails
There's no point in trying to export after not being able to read the data
in the first place.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 12:23:15 -07:00
Dirk Hohndel
c96ee6159b Fix potential crash if the existing filename is NULL
Should have used same_string() anyway...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 08:09:27 -07:00
Dirk Hohndel
b63b656c1f Make sure cylinder related data is filled when dives are read
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>
2015-06-17 17:58:31 -07:00
Dirk Hohndel
b39e478c57 HTML export: corretly show weird imperial tank sizes
It's not enough to convert the wet volume - you need to multiply in the
working pressure.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 17:25:44 -07:00
Dirk Hohndel
9f5207fc0d HTML exports: minor cosmetic improvements
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>
2015-06-17 17:04:16 -07:00
Anton Lundin
b052d63789 Hide the dive-related controls when showing trips
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 16:38:11 -07:00
Anton Lundin
cfd001702f Make the expand/collapse buttons usefull on trips
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>
2015-06-17 16:38:03 -07:00
Anton Lundin
00db47b19e Remove old timing of function
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 16:37:58 -07:00
Dirk Hohndel
befa8cf32e HTML standalone exporter: don't setup preferences
We don't need them and they can cause the application to crash when called
in a git hook.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 12:39:40 -07:00
Dirk Hohndel
b345db0a64 HTML export: better Google maps link
This way we get an actual place marker

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 12:38:24 -07:00
Dirk Hohndel
243a9e5840 Remove some include files from qthelper.cpp
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>
2015-06-17 11:47:59 -07:00
Dirk Hohndel
c897b857fb We don't really need a long to count the dive sites
At least I hope not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 11:42:15 -07:00
Dirk Hohndel
de586331b2 Add missing package to INSTALL file
This way lupdate is present on Ubuntu

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 11:41:49 -07:00
Dirk Hohndel
a922e52b8f HTML Exporter: make JS work on Firefox as well
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>
2015-06-17 10:15:08 -07:00
Dirk Hohndel
3778f94f6f Remove the references to QtPositioning from INSTALL file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 10:12:03 -07:00
Dirk Hohndel
11f457403f Use saved units in the HTML exporter
Also update the exporter to match the latest changes in the Subsurface
code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 09:48:10 -07:00
Dirk Hohndel
ff4b5478b5 Store the user's unit preferences in git storage
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>
2015-06-17 09:48:10 -07:00
Dirk Hohndel
7cf3ebc2f7 Git storage: only check git_id if saving to the same remote
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>
2015-06-17 09:45:39 -07:00
Gehad elrobey
5d09244c0f HTML: fix the unclosed <ul> tag.
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>
2015-06-17 09:29:39 -07:00
Rick Walsh
a5a9462820 Re-fix silly typo
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>
2015-06-17 05:27:18 -07:00
Linus Torvalds
eff3fd3261 git save: fix crash with no remote
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>
2015-06-16 21:40:31 -07:00
Robert C. Helling
eca7d998e1 Set up signalling to display notes in planner again.
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>
2015-06-16 20:33:07 -07:00
Rick Walsh
f66ea4cbb0 Show duration before runtime on planner notes table
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>
2015-06-16 20:32:40 -07:00
Dirk Hohndel
d9b39efeb7 Fix silly typo
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 20:30:06 -07:00
Dirk Hohndel
ccc9d80015 Remove all the no longer necessary code that aborts read of first V2 file
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>
2015-06-16 14:41:56 -07:00
Dirk Hohndel
bd11988f74 Cloud storage: warn the user if we are not online
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>
2015-06-16 14:09:37 -07:00
Dirk Hohndel
226e9a7e85 Implement a standalone HTML exporter
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>
2015-06-16 14:09:21 -07:00
Dirk Hohndel
0692e24036 Separate initializing Qt from initializing the UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 14:05:09 -07:00
Dirk Hohndel
6a0e1cd9f6 HTML export: separate UI and logic code
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>
2015-06-16 14:04:41 -07:00
Dirk Hohndel
a2c546152e Don't crash with NULL string in settings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 09:33:22 -07:00
Dirk Hohndel
854f55fd89 Move checking the cloud connection into its own files
This isn't UI related and shouldn't have been in a file full of UI
functionality.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 06:08:31 -07:00
Dirk Hohndel
0fa0eb2879 Code cleanup: implement window title update via signal
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>
2015-06-16 06:04:34 -07:00
Dirk Hohndel
c593dea119 Cloud storage: use preference member instead of hard coded strings
This creates the basis to allow other backends to be used with the cloud
storage infrastructure.

So far this should all just transparently continue to work. A user would
have to manually add the cloud_base_url entry to the CloudStorage section
in their config file in order to use a different backend server.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-15 10:22:00 -07:00
Dirk Hohndel
617b105458 Cloud storage: create preference entry for base URL
This just deals with the mechanics. There is no UI to enter / change this
URL (and that's intentional), neither is it used, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-15 09:56:11 -07:00
willem ferguson
b144518a85 Add libcurl to the default library dowloads for debian/ubuntu
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14 21:57:05 -07:00