Commit graph

55 commits

Author SHA1 Message Date
Gehad Elrobey
ec202890b7 Make exporting photos with HTML optional
This adds the ability to choose either to export photos or not.
Patch is attached.

--
regards,
Gehad

From 6476e1227b72d8297f9aecc2e6cc6f70d07f87ae Mon Sep 17 00:00:00 2001
From: Gehad elrobey <gehadelrobey@gmail.com>
Date: Fri, 13 Mar 2015 15:31:24 +0200
Subject: [PATCH] Make exporting photos with HTML optional

Add the option to enable/disable exporting photos with the HTML.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:18:08 -07:00
Gehad elrobey
90d68ead31 Show translated String.
Translated notifications are always better.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27 06:31:12 +01:00
Gehad elrobey
59ab849854 Creating a Notification widget in the Main Window.
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>
2015-02-27 06:31:06 +01:00
Dirk Hohndel
2866a604b4 Revert "Update Qt4 patch"
This reverts commit 762315e7ee.

Oops, this was supposed to update the patch, not update and apply it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22 08:30:34 -08:00
Dirk Hohndel
762315e7ee Update Qt4 patch
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-19 21:52:41 -08:00
Gehad elrobey
9470be0a77 HTML: Fix Null values in yearly statistics export.
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>
2015-02-15 05:56:01 -08:00
Gehad elrobey
d2990aea6f HTML: Fix exporting themes in multilingual environment
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>
2015-02-15 05:55:42 -08:00
Gehad elrobey
ad60ca84ee Export the XSLT based exports in a new thread.
The XSLT based exports can consume long time while applying the xml format.
This time can make the GUI unresponsive. Simply call the export functions
in a new Thread.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 10:15:12 -08:00
Miika Turkia
6b3e361e90 Write depth unit for current dive not previous
The unit was stored to the variable after it was used, thus we need to
delay the print of the unit slightly. (In practice the depth unit for
first picture was null before this fix.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:18:35 -08:00
Miika Turkia
f70a83667b Fix segmentation fault on exporting picture depths
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:18:11 -08:00
Dirk Hohndel
02d8dd5d13 Clean up the header files
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 23:00:43 +13:00
Miika Turkia
5d68c7d4a1 Use unit selection for XSL transformation on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:12:20 -08:00
Miika Turkia
adb5cc5d30 Highlight that this CSV export is about dive profile.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:25:33 -08:00
Miika Turkia
175ee84cc5 Description of CSV detail export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:25:28 -08:00
Dirk Hohndel
74f5842f0c Add second CSV export with dive details
This is intended to export all the details that someone might copy from a
paper logbook. We need a matching import template to make this simple.

This hasn't been well tested, I'm sure it will break when elements and
attributes are missing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-21 21:51:54 -08:00
Robert C. Helling
a2f9f0c8bf Compare image times and sample times as signed ints
The problem that we were comparing signed and unsigned ints was originally
found by Lubomir. As image times can be negative (and the comparison should
fail in that case) we need to compared them as signed.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:39:00 -07:00
Lubomir I. Ivanov
0778e3e18c divelogexportdialog.cpp: fix a 'uninitialized variable' warning
DiveLogExportDialog::export_depths()

We set a default value of 'unit' which will silence the warning itself.
Then hope that the compiler will respect the argument order i.e. call
get_depth_units() (which sets 'unit') before using *unit as the last
argument passsed to put_format().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:36:28 -07:00
Gehad elrobey
fae86eb4ce HTML: Export unit preferences to settings file
Working on HTML exports to support imperial and metric units and also
custom selected units based on subsurface preferences.
User selected units is exported to settings file that will be mainly used
by listlib javascript file.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:04:01 -07:00
Salvo 'LtWorf' Tomaselli
4cdb80c4cd Export to DiveShare
Adds the possibility of exporting dives to DiveShare.

Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:33:46 +02:00
Robert C. Helling
2282035a4d Add export for depths of images taken
This adds an option to the export dialog to write an ascii file containing
filenames of image files a tab and the depth at the time of the image
taken.

[Dirk Hohndel: whitespace cleanup]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 08:03:45 -04:00
Gehad elrobey
3925aed5ea HTML: Changing the files extensions to js
These are actually javascript files containing js objects and not json
files.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-28 07:43:18 -07:00
Gehad elrobey
3a46657f4c HTML: export Translated strings to JSON files.
First step towards multilingual export. Use the existing translation API
to translate and save words to JSON file.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:19 -07:00
Gehad elrobey
108fc892ca HTML: Don't export total statistics value if not chosen
Don't export total row in yearly statistics unless exporting the
statistics is checked

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:15 -07:00
Gehad elrobey
10e70336c6 HTML: Remember General Export Settings.
Set Default values and remember user selected general HTML export
settings.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:13 -07:00
Gehad elrobey
3ebb62f153 HTML: Add total row to yearly statistics table.
Add new row to the yearly statistics table containing the total. Total
values are calculated to some columns only, it doesn't make any sense to
add the total value to other columns (Temperature cols for example).

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:03 -07:00
Gehad elrobey
93a15d471c HTML: Make export statistics optional.
Make exporting statistics to the HTML page optional.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:20:55 -07:00
Gehad elrobey
5076e431d5 HTML: export yearly statistics to JSON files.
Save Yearly statistics as JSON data to the stats_files.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04 10:03:12 -07:00
Dirk Hohndel
ebdeddb9b9 When exporting to XML and no extension given, default to .ssrf
See #646

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-31 10:38:36 -07:00
Gehad elrobey
6f05194b02 HTML: Add dive photos to the detailed view
Dive photos are copied to the photos directory on export. The photos
section appears only if photos exist.

C++ helper functions are added to copy images to the photos directory,
Additionally the photos directory must be passed as a parameter to the
write_one_dive function to save photos to it. Some options structure may
be needed instead of passing many arguments.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:22 -07:00
Gehad elrobey
e5c5ee74f0 HTML: fix profile labels
Fix labels view in dive profile.
Add Jqplot css file to the exports.
The css files fix the view and enahnce the plot.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11 06:59:00 -07:00
Tim Wootton
2db9c97530 Add diveloexportdialog explaination strings for translation
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 16:26:54 -07:00
Tim Wootton
8e7b7fafda divelogexportdialog capitalisation consistency
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 16:26:41 -07:00
Miika Turkia
38403f6c98 Fix exporting all dives in Subsurface format
Exporting in Subsurface format saved only selected dives even if user
attempted to save all dives.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 08:15:48 -07:00
Gehad elrobey
023187a73e HTML: Use jqplot to draw profile.
Use jqplot to draw dive profile, Depth and pressure curves. add the
library Javascript files under the theme directory and editing the
exporter. Load them to the HTML template dynamically with
synchronization as they are dependant on each other.
Also Adding min version of JQuery that is needed by the library.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30 07:56:47 -07:00
Gehad elrobey
0deee63b5e HTML: Overwrite all template files if exist
Template HTML files must be overwritten when exporting if already exist.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-24 21:40:26 +08:00
Gehad elrobey
33fa8bdf96 HTML: user export options ask for numbering
Ask if you want the exporter to rearrange the dive numbers starting from
1 or use the existing numbers in subsurface. one may need to have the
dives exported in the same number to reference them easier.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-24 21:39:58 +08:00
Gehad elrobey
e9c4259db4 HTML: Add export list only option
Exporting small dive list only or choose to export the dive list with
all the dive details like the profile, Bookmarks, dive equipments and
statistics.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-24 21:39:10 +08:00
Thiago Macieira
ee11e1540e Don't use std::string in our code
This also explicitly states the encoding. It's just a file name and it's
always ASCII for us, but it's clear now.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18 04:44:59 -07:00
Gehad elrobey
d363722c16 HTML: remove theme file if already exist in the export directory
as QFile:copy doesn't overwrite files by default, we must check before
copying if file exist and remove it.

We must be able to overwrite files here, user is already notified and
choosed to replace them.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-15 09:25:37 -07:00
Gehad elrobey
262472c9de HTML: fix the exporting dialog
export HTML into the file name choosen and export additional files into
a subdirectoy beside the html file, called htmlfilename_files

This is to follow the convension and doesn't create additional
directories to wrap the exports.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-15 09:25:17 -07:00
Tomaz Canabrava
748198891d Much needed clean on the HTML export dialog code.
Correct usage of QFile, QString and code cleanup.

[Dirk Hohndel: plus whitespace cleanup and removal of qDebug() calls]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12 12:42:35 -07:00
Tomaz Canabrava
6a9c4097c0 Change the QDialog for html export to getExistingFolder
The QDialog for html creates a folder, we need to choose a folder, not a
file. getSaveFileName was wrong. ;p

Fixes #533

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 14:28:19 -07:00
Dirk Hohndel
439c2e0473 Correctly test QString for being empty
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-08 07:53:22 -07:00
Gehad elrobey
7c9e6cac2e HTML: export to system dependant path separator
This will make the exporting path separators platform dependant

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-06 10:08:09 -07:00
Miika Turkia
a89533bf37 Fix HTML export white space issues
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 21:16:11 -07:00
Gehad elrobey
197bd76f16 Remember selection of export HTML settings
Add a new QSettings group "HTML" to save the HTML exporting settings and
restore them later.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 21:09:44 -07:00
Gehad elrobey
e21032c99b Add HTML tab in export dialog
- Separate the export dialog into two tabs general exports for other
  exports and HTML export.
- Save HTML settings to JSON file
- Copy HTML templates to the exporting directory

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 21:07:45 -07:00
Gehad elrobey
a3dbb5865c HTML list exporter
Exporting the raw dive list into JSON format for later viewing with html
and js files.  Also some worldmap code organizations.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29 07:24:17 -07:00
Dirk Hohndel
3a2ceed33d Add Subsurface XML export to Export dialog
Also be consistent about the default folder we use when opening the file
dialog.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24 07:12:03 -07:00
Dirk Hohndel
18fa359b48 Rework the Export dialog
The UI design looked too tight in my screen.
The explanation texts were a bit inconsistent (and in one case simply
wrong).
The explanation for the initial selection wasn't shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24 06:42:10 -07:00