summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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-06qmake: change the folder structure assumed for LIBMARBLEDEVELGravatar Dirk Hohndel
LIBMARBLEDEVEL is now assumed to point to the install prefix used for a marble install (instead of into a mix of source and build trees as it did in the past). This makes it much easier to have Qt4 and Qt5 versions of this library and link to the right one as needed. Of course this requires a matching LD_LIBRARY_PATH when launching a such-built Subsurface. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-06Prepare for Qt4 / Qt5 cross builds of Windows binariesGravatar Dirk Hohndel
Admittedly I believe I'm the only one using this script (and related .nsi file), it still seems to make sense to keep it up to date in the repository. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-05Install HTML export theme files on Windows and MacGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-05Switch to the new gasmix structure in dump_planGravatar Anton Lundin
dump_plan wasn't updated when the switch from he/o2 to gasmix was done in the planner code, this makes it compile again. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-05Planner: Avoid bogus segments with 0 timeGravatar Robert C. Helling
Don't show a stop if we continue at this depth. This resolves a problem when there are more than two waypoints during deco at the same depth. This can happen at 6m when there is a gaschange to O2 and the last stop depth is 6m (which turns the 3m stop into another 6m stop). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-05Planner: Change 'lasttime' only if we printed something in the plan.Gravatar Robert C. Helling
This makes the 'segment' durations equal the runtime differences even when we don't display transitions in deco. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04Disclaimer included in the printed diveplanGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04Force TTS/NDL calculation off if things take too longGravatar Dirk Hohndel
This is kind of a random cut off, but if plotting the dive takes more than a second and TTS/NDL is on, we force it off. Because the algorithm for that is fundamentally quadratic in nature it can take a VERY long time - getting users to think something is broken. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04More tweaks to TTS calculationsGravatar Anton Lundin
Add a lager step value when walking the calculations forward. [Dirk Hohndel: this was sent ages ago and in all the discussions about the implications I apparently never applied this] Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04Make bigger steps when calculating TTSGravatar Linus Torvalds
[Dirk Hohndel: this was sent ages ago and in all the discussions about the implications I apparently never applied this] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04Planner: don't redo the plan after partial edits of GFlow/highGravatar Dirk Hohndel
In most cases this wouldn't really matter, but when planning very deep or very long dive with corresponding very long deco times, calculating the deco takes long enough to make this notable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04Fix typo that broke gas reporting in dive listGravatar Dirk Hohndel
The brainless idiot who implemented commit c539c8f86192 ("Remove the .used member of the cylinder structure") clearly worked on the basis of "it compiles, it must be perfect". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: only copy cylinders that were used in the template diveGravatar Dirk Hohndel
This was only semi-implemented the first time around. Now we really only copy the ones that are indeed used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03WhitespaceGravatar Dirk Hohndel
Enough said Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: more accurately track assumed cylinder pressuresGravatar Dirk Hohndel
This makes things more consistent. The equipment view and the sample view of the beginning and end pressure for each cylinder correspond (and the beginning pressures of each cylinder segment are correctly reflected in the samples). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Fix HTML export white space issuesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Remember selection of export HTML settingsGravatar Gehad elrobey
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-03Minor Fixes to the export dialog UIGravatar Gehad elrobey
- use heading "Style options" instead of advanced - choice of selected dives is the same as other tabs - changing the default font to 14 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-03Update install script: copy HTML theme directory to usr/shareGravatar Gehad elrobey
Updating the qmake file to check and copy the theme directory under usr/share. THIS needs to work on windows and mac. 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-03HTML: Create theme directoryGravatar Gehad elrobey
Create theme directory that contains the html templates copied to the exporting directory. - dive_export.html is the main html template. - light.css and sand.css are two separte themes. - list_lib.js is the main javascript 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-03Add HTML tab in export dialogGravatar Gehad elrobey
- 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-03Closing the window should behave like triggering QuitGravatar Dirk Hohndel
It seems odd to have different behavior depending on whether the window manager tells us that the user wants to close the window or whether the user hits quit or ctrl-q. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Dive edit: when asked ti quit while editing, offer to discard current editGravatar Dirk Hohndel
This is equivalent behavior to what we do when planning a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Dive edit: avoid memory leaksGravatar Dirk Hohndel
If we edit any of these fields, we create new strings via strdup (or a fresh tag_list). So if the edits are rejected, free all that memory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Dive edit: don't free the taglist of the master diveGravatar Dirk Hohndel
We do all of our edits on a copy of the dive - but the tag_list points to the tag_list of the master dive (based on how we create that copy of the master dive). So only free the tag_list if it is already different from the master dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Ask before discarding editsGravatar Dirk Hohndel
This is equivalent to what we do for the planner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03When calculating the maximum of unsigned values, use unsigned variableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03CCR code: Change to sample structureGravatar Willem Ferguson
1) All the variables in the sample structures are strongly typed 2) Two additional types were declared in units.h: o2pressure_t bearing_t 3) The following variables were added: diluentpressure o2setpoint o2sensor[3] 4) Changes to a number of files were made to chanf sample->po2 to sample->po2.mbar bearing to bearring.degrees Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Another futile attempt to keep whitespace consistentGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Do not plot pictures that don't have a timestamp.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Also hold a pointer to the struct picture on the model.Gravatar Tomaz Canabrava
Changes to hold a pointer to the struct picture on the model, so we can use it to determine the correct positioning of the image on the profile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add a method to plot the pictures on the profile.Gravatar Tomaz Canabrava
It plots in the wrong place for now, because I need to change the model a bit. But it shares the same pixmap with the other widget which is nice. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Connect & disconnect the PictureModel on the profileGravatar Tomaz Canabrava
Ignore the warnings for now, this patch connects and disconnects the (not done yet) plotPictures() method. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add a static 'instance()' member for the Photos model.Gravatar Tomaz Canabrava
This will make referencing it from a few places more easy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Fix linked list corruption, move code to C.Gravatar Tomaz Canabrava
The picture list is a single linked list where the pictures have a node to their next element. When adding the same picture to two dives, things got way way wrong and crashes were appearing. This will replicate the information (filename, latitude and longitude) for each dive that has the picture, BUT it still tries to save as much as possible on the actual pixmap. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add photo saving for the XML backend.Gravatar Tomaz Canabrava
This code correctly saves the added pictures on the xml backend. next: git backend. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Fix dive water temperature XML parsingGravatar Linus Torvalds
We parsed it rigth for dive computers, but not for the manually filled per-dive case. The git save seems to have gotten it right. I think this has been broken since the whole "move as much as possible to the dive computer sections", but I didn't actually check. Reported-by: roberto forini <forini.r@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Cancel dive edit when escape key is pressedGravatar Dirk Hohndel
Also seems intuitive. What's odd is that in the Planner you get a confirmation dialog while here you don't. We should be consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: reject plan if escape key is pressedGravatar Dirk Hohndel
This seems intuitive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Make most of the shortcuts widget specificGravatar Dirk Hohndel
Having the window specific means that you can't have a key do different things on different widgets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: fix editing the dive planner points tableGravatar Dirk Hohndel
The edit starts with the current value, but our data() function didn't return that in the edit role. Thanks Tomaz for explaining this to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: make the warnings visually stand out moreGravatar Dirk Hohndel
HTML is nice here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: add a few more line breaks in the html notesGravatar Dirk Hohndel
This looks much better now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: Show gas changes at the correct depth.Gravatar Robert C. Helling
Gas changes (can) have a bogus waypoint following at the same depth with 0 time. Those were confusing the decision whether to show a waypoint. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner: Show waypoints for gas changes but no double depthsGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Don't crash when looping over pictures for a null diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Planner note logic and layout improvedGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add print button to plannerGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Layout improvements to the dive planGravatar Robert C. Helling
Changed to html. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>