aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-06-20Added the new Date Widget on the MainTab.Gravatar Tomaz Canabrava
the new date widget still needs a bit of work, but the design is working already. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Added a Partly Functional Date Picker widget.Gravatar Tomaz Canabrava
This widget shows a date in a better way that it was done in the old widget, much more elegantly. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Simplify codeGravatar Tomaz Canabrava
If a class inherits QObject, it doesn't needs to call QObject::tr for the tr function. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Fixed compilation for CMake.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Added a background for the ShowDate widget.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20planner: Switch to QSpinBox for SACGravatar Anton Lundin
QSpinBox is nice to see how different sac rate would affect our dive plan. "Hey, What would happen if I would be stressed and my sac goes up by 50%?" Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18CNS doesn't increase when PO2 is below 0.5 atmGravatar Anton Lundin
When chasing other bug in CNS code i found this. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18Enable Info box in the planner again.Gravatar Anton Lundin
Its great to be able to see the planned "turn pressure", EADD at different points and so on. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18Fix building with NO_MARBLE againGravatar Anton Lundin
Back in 708f19830e2a ("Planner: New plannerSettingsWidget") the Globe widget handling changed, and this updates the NO_MARBLE build option to work after that. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18Clean up SubsurfaceSysInfo by inheriting QSysInfoGravatar Thiago Macieira
Most of the mechanics are already in QSysInfo, we only need to add the extra details that were missing until Qt 5.4. This greatly simplifies the code and will allow us to update it more easily from upstream. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18Disable the Q_PROCESSOR_xxx macros in Qt 5.0Gravatar Thiago Macieira
We don't want to redefine, we just need what Qt 5 already has. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18Don't use std::string in our codeGravatar Thiago Macieira
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-18Use __typeof__ instead of typeof in the headerGravatar Thiago Macieira
This allows us to compile Subsurface with strict C or C++ mode. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-15HTML: move between dives in detailed view.Gravatar Gehad elrobey
Move between next/prev dives in detailed view, and be able to go back to the list. Also fix the initial state of the sorting by number. (its already exported in ascending order) 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: remove theme file if already exist in the export directoryGravatar Gehad elrobey
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-15HTML: fix the exporting dialogGravatar Gehad elrobey
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-15HTML: Dynamically loading an external JavaScript or CSS fileGravatar Gehad elrobey
This enable the HTML template from linking JS and CSS files dynamically when starting. This helps to recognize the folder name where js and css where exported dynamically. The HTML template will succesfully find the attached files as long as they exist in a directory named as the HTML 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: Show dive profile embedded in HTML5 canvasGravatar Gehad elrobey
Plot samples from dive computer (depth,time) with HTML5 canvas. Add very small API for curve drawing and coloring. Add the dive equipment to the detailed dive view. in the dive list when a dive is expanded you can show the dive profile,equipments and dive information by clicking on 'show more details'. Fixing the two themes to work well with the new div added that carry detailed dive information. 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: define the visited array type to booleanGravatar Gehad elrobey
The boolean array must be defined explicitly, to prevent type casting. 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: 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-14OS DetectionGravatar Joshua Joseph
--001a113a374080d8af04fbd33a62 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, Jun 15, 2014 at 1:07 AM, Thiago Macieira <thiago@macieira.org> wrote: > Em s=C3=A1b 14 jun 2014, =C3=A0s 15:05:24, Thiago Macieira escreveu: > > > Also, please keep the original copyright headers from the files you copie= d. > -- > Attached patch adds Qt copyright to both files. --=20 Thanks, Joshua <div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jun 15, 2014 at 1:07 AM, Thiago Macieira <span dir="ltr">&lt;<a href="mailto:thiago@macieira.org" target="_blank">thiago@macieira.org</a>&gt;</span> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Em sáb 14 jun 2014, às 15:05:24, Thiago Macieira escreveu:<br> <div class=""><br> <br> </div>Also, please keep the original copyright headers from the files you copied.<br> <div class="HOEnZb"><div class="h5">--<br></div></div></blockquote><div><br></div><div>Attached patch adds Qt copyright to both files. </div></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Thanks,</div><div> Joshua</div><div><b><br></b></div></div> </div></div> From 092bea260da8b02437c54eac51fd4fa044069e0e Mon Sep 17 00:00:00 2001 From: "Joseph W. Joshua" <joejoshw@gmail.com> Date: Sun, 15 Jun 2014 01:20:12 +0300 Subject: [PATCH] Include Qt copyright headers in SubsurfaceSysInfo Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14OS Detection: Use QFile when reading /etc/os-releaseGravatar Joseph W. Joshua
Improves and simplifies reading of /etc/os-release on linux system to read the PRETTY_NAME value. The previously used method is unnecessarily lengthy and too complicated. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14User survey: force running the survey from command lineGravatar Dirk Hohndel
This way people can test the dialog much easier. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14User survey: small updatesGravatar Dirk Hohndel
Just make it behave a little more sanely - support Ctrl-W and Ctrl-Q - remove the silly placeholder text for system info - add language and version information Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14Make system detection compile on MacGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14OS DetectionGravatar Joseph W. Joshua
Implements automatic OS and architecture detection. This code has been taken from the Qt repositories for Qt 5.4 (LGPL) and slightly modified into the SubsurfaceSysInfo class. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-13Start a user survey dialogGravatar Dirk Hohndel
The idea is that a week after the user starts using Subsurface we ask them if they would like to submit a survey response. If you are running a development build, don't wait seven days. This patch doesn't do anything with the user's selections, doesn't submit anything to our server, etc. It's just a placeholder to tune what we should ask, etc. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-13Prevent using uninitialized variableGravatar Dirk Hohndel
numberOfPictures was be read before it is written. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12Fix tank size displayGravatar Dirk Hohndel
In commit 11380a5deb07 ("Really display liters with script el") I inadvertantly broke the display of cylinder sizes in the imperial case. This patch restores that and also tries to give slightly more useful guidance on the number of decimals to display. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12Correct pO2 formula in CNS calculation.Gravatar Robert C. Helling
In commit e58f54cac1d0 ("Fix ATM-vs-bar confusion") Linus broke the CNS calculations; The partial pressure is fraction of gas times ambient pressure, not divided by. [Dirk Hohndel: identical patch sent by Robert and Anton; I combined the commit messages and added the ACK from the perpetrator] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Anton Lundin <glance@acc.umu.se> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12Don't copy the current dive ontop of editedDive after edit has startedGravatar Dirk Hohndel
If you switch to edit mode by making a change to cylinders or weights, then the data in the editedDive was changed and afterwards the current dive was once again copied into the editedDive - even though we already did that earlier when setting up the display. Fixes #539 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12Much needed clean on the HTML export dialog code.Gravatar Tomaz Canabrava
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-12Delay loading of some settings until laterGravatar Dirk Hohndel
This early in init_ui() the settings may not be available, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12Planner: don't show the planner panes by defaultGravatar Dirk Hohndel
With commit 708f19830e2a ("Planner: New plannerSettingsWidget") we suddenly started out showing the planner widget. Not useful. So let's switch us back to the default screen :-) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12Planner: update tabstop order againGravatar Dirk Hohndel
Robert's commit 708f19830e2a ("Planner: New plannerSettingsWidget") moved several of the widgets from the maintab area to the new planner settings widget. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12Planner: New plannerSettingsWidgetGravatar Robert C. Helling
In planner mode, this replaces the globe with the dive plan and introduces a new plannerSettingsWidget in the diveListPane. All new fields are still disfunctional. This is WIP. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Add beginning of pretend CCR XML fileGravatar Dirk Hohndel
Note that we are missing code to write out the new attributes, so saving this test dive back to a file loses them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Simplify codeGravatar Dirk Hohndel
Since trimspace() null terminates the string, we can simply use strdup() here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Provide for a dive_computer_type variable within dc structureGravatar Willem Ferguson
This patch lays the foundation for differentiating between open-circuit(OC)dives and rebreather dives (CCR). The following were done: 1) In dive.h add an enum type dive_computer_type 2) In dive.h add two more fields to the dc structure: a) dctype (an enum field indicating dc type) b) no_o2sensor (indicating number of o2 sensors for this dc) 3) In parse-xml.c add a function trimspace that strips any whitespace from a string. This is used by two functions: utf8_string as well as by get_dc_type, described below. The pointer to buffer is not changed in order to ensure consistency when the buffer is freed. 4) In parse-xml.c add a function get_dc_type. This parses the dc_type string from xml and assigns an enum value which will later be returned to the function that parses the dc variables. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Change the QDialog for html export to getExistingFolderGravatar Tomaz Canabrava
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-11Fix layout of Dive ExportGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Fix layout of import CVSGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Fix uninitialized memory warningGravatar Dirk Hohndel
It's kinda bogus, but since we add it to the Vector, we might as well initialize all of it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Have explicit "%s" format strings in printf style statementsGravatar Robert C. Helling
Not having a format string that explicitly references the arguments is considered a potential security issue in code. This gets rid of a compiler warning that turned into an error on Fedora 21. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Allow the user to delete a dive computer from a diveGravatar Dirk Hohndel
This can't be the only dive computer, of course. Goes nicely with the ability to reprder them. Fixes #551 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Profile: add a flag to force redrawing the profileGravatar Dirk Hohndel
This is needed if something has changed that requires a redraw, but the plotDives() function can't tell (for example when a dive computer has been deleted and there's now a different DC in the same spot, with the same number - see next commit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Qmake: make clean failed on Windows cross buildsGravatar Dirk Hohndel
For some reason the docclean rule wasn't included in the Makefile when cross building for Windows on Linux. Doing some searching into the issue I found a much easier way to handle the make clean stage and sidestepped the actual problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11ENABLE_PLANNER is obsoleteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>