aboutsummaryrefslogtreecommitdiffstats
path: root/save-html.c
AgeCommit message (Collapse)Author
2015-06-21HTML export: need to work harder to find the picturesGravatar Dirk Hohndel
Simply looking at the filename in the picture structure isn't enough (now, arguably one might say that it should be and that that data structure should be updated, but that's not how other parts of Subsurface have implemented things so I don't want to break that assumption here). So instead we look up where the pictures actually was loaded from and then copy that file into the right location. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Move helper declarations into a better header fileGravatar Dirk Hohndel
This way the helpers can be more easily used by other modules. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18HTML exporter: don't try to write to NULL file descriptorGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17HTML export: corretly show weird imperial tank sizesGravatar Dirk Hohndel
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-03-14Make exporting photos with HTML optionalGravatar Gehad Elrobey
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-11HTML: fix the value of cylinder gas in trimix divesGravatar Gehad elrobey
Value of He must be showed in trimix dives, also fixes the format of the dive events table. Gas change should be something like O2: 50 - He 0 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Change from locations to dive sites in save-html and worldmapGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25Consitent punctuation of shortened wordsGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20HTML: Save data with user selected unitsGravatar Gehad elrobey
Edit the HTML exporter to export data fields with user selected units. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14Export to DiveShareGravatar Salvo 'LtWorf' Tomaselli
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-09-18Bring save html capitalisation in lineGravatar Tim Wootton
Converted save html to use same capitalisation style as the rest of the application Changed references to equipments to equipment. Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-28HTML: export valid JSON.Gravatar Gehad elrobey
Remove the trailing commas from the exported JSON file as some json parsers just don't like it. The file 'file.json' is valid acording to the JSON spesification. Note: its a javascript file containing a JS variable 'trips' and not a JSON file. Because loading a pure JSON file from local disk is not accepted by the web-browsers itself. Actually I think changing the file extension to .js is now makes more sense. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27HTML: Save divecomputer data to the HTML exportsGravatar Gehad elrobey
Save divecomputers data to the JSON files. and show them in the HTML dive detailed view. Fixes #711 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17HTML: change empty O2 Value to Air.Gravatar Gehad elrobey
-Change column name to 'Gas' as changed in Subsurface. -Replace '--' with 'Air' to empty tanks. 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-17HTML: Don't export others trip if no dives are selected.Gravatar Gehad elrobey
Don't export 'others' trip unless there is really at least one dive to be inserted into the 'others' group. 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-17Fix and simplify get_file_nameGravatar Thiago Macieira
This function created a QFile that it didn't need and it returned a dangling pointer (the std::string object was destroyed at the end of the function). The function now returns a pointer that the caller must free. For that reason, it's easier in copy_image_and_overwrite to just go for the QFileInfo call. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14HTML: Add coordinates to the HTML exportsGravatar Gehad elrobey
- Export dive coordinates (if exist) to JSON file. - Add dive coordinates to list view and detailed dive view. - Add hyperlink that opens the dive location in a new tab viewed in Google maps. 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-14HTML: export selected dives in trips.Gravatar Gehad elrobey
When exporting selected dives, traverse the trips and export the trip if it contains at least one selected dive then search for all selected dives in this trip. Exporting selected dives only must contain trip infromation. 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-11White space fixGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11Fix typo on HTML exportGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11HTML: export Translated strings to JSON files.Gravatar Gehad elrobey
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-11HTML: export dive duration value to the detailed view.Gravatar Gehad elrobey
Dive duration value is missing in the dive 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-08-04HTML: add weight systems to the dive equipments section.Gravatar Gehad elrobey
Add weights systems to the dive equipment list. 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-04HTML: Fix event value fields.Gravatar Gehad elrobey
- The gas event values can contain o2 and he mix in gas change events. - Give a '-' value for events that don't have any sensible values. - Show event value if event type is heading or gaschange. 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-25HTML: add event value to the detailed view.Gravatar Gehad elrobey
Event value is important in case of gas change and heading events. The value information show: mix and direction. 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-25HTML: Add notes variable to the JSON file even if notes don't existGravatar Gehad elrobey
if dive notes don't exist, notes variable must be added to the javascript containing empty value "--", this is more friendly than just showing 'undefined' 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-25HTML: don't add photos or dive status if exporting list onlyGravatar Gehad elrobey
If export list only option is chosen, photos and dive status must not be added to the export. 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-14HTML: Add dive photos to the detailed viewGravatar Gehad elrobey
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-14HTML: display dive status in detailed viewGravatar Gehad elrobey
Add dive status in the detailed dive view. 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-11Corrects start and end pressure in HTML exportGravatar Rick Walsh
The start and end pressures were reported the wrong way. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04HTML: add events to detailed profile viewGravatar Gehad elrobey
Export events to detailed dive view and add events to the profile. Events names must appear on mouse hover. 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-30HTML: Show nice values when pressure is not availableGravatar Gehad elrobey
Show nice values instead of the undefined when the pressure is not available. 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-30HTML: Add temperature and pressure curves to the JSON data.Gravatar Gehad elrobey
Add more dive sample details to the JSON data. This is not so optimized some zero values can be ignored. 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-30HTML: export dive events to detailed viewGravatar Gehad elrobey
Add table of dive events to the dive detailed view. This should view each event, its type and the time this event took place. 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-24HTML: Add export list only optionGravatar Gehad elrobey
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-23Be more consistent in partial pressure namingGravatar Henrik Brautaset Aronsen
Lets just use pO₂ instead of PO2, ppO2, ppO₂, PO₂. They all mean the same, but it's better to be consistent Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-15HTML: Write cylinder data to the JSON files.Gravatar Gehad elrobey
Iterate the cylinders in each dive and write cylinders data to the exported JSON files. Moving the write attribute function to the top of the 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-06-15HTML: export DC samples to JSON format.Gravatar Gehad elrobey
-Export Dive computer samples to JSON format, for dive profile plotting. -Add maxdepth and duration to attributes of the JSON dive object. 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-15HTML: Report saving to file errors.Gravatar Gehad elrobey
Use subsurface report_error function in save-html and worldmap-save instead of the ridiculous print to standard output. Also use subsurface_fopen for the sake of different platforms. 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-06HTML: Better quoting to the export stringsGravatar Gehad elrobey
Move the quote function to membuffer.c and adding wrappers that call it from both xml and html exporters to get rid of redundancy. Quote the location, buddy, suit, tags and notes This prevents js code from crashing. [Miika Turkia: minor whitespace and code fix] 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-01Remove some unused variablesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29HTML: Quote the '<' and '>' operators before inserting break tagsGravatar Gehad elrobey
The smaller than and greater than operators should be quoted before inserting the <br> tags in HTML. Otherwise breaks will be quoted which corrupts the format. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Small whitespace fixesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Need to quote some more HTML charactersGravatar Miika Turkia
Double quote will break HTML export when it is e.g. within notes. Similarly < and > characters are treated as HTML tags unless quoted properly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-29Export tags in json arrayGravatar Gehad elrobey
This will help in searching based on tags Also some minor coding-style fixes 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-29Fix json exporter outputGravatar Gehad elrobey
The note is prefixed by a colon Fix the output of Null values of dive master, dive suit, location and buddy. 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-29Some fixes for the json exporterGravatar Gehad elrobey
- check for zero Kelvin degrees temperature - show dives in group of trips - show the number of dives starting from 1 as in subsurface application. - produce localized output as selected in the user's preferences. - use &lt; and &gt; on the arrow buttons in the HTML file. - Call the translation functions for text strings 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-29HTML list exporterGravatar Gehad elrobey
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>