summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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-03-11Planner: disable mouse interaction when zoomed inGravatar Lubomir I. Ivanov
When zoomed in, things like moving planner points is not possible, but if the user attempts that, replan() -> plotDive() is called and the zoomLevel should be reset to the default value (we don't really want that), but instead it's lost for some reason (as the user reports: "Somes times, it changes to 100% which is ok"). If moving points becomes possible eventually while zoomed in, we need to figure a way to replot without resetting the zoom level in plotDive(). Fixes #851 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11datatrak: some codings style fixes and fopen() usageGravatar Lubomir I. Ivanov
- subsurface_fopen() is needed - translated one puts("") message - sizeof(unsigned char | char) is always 1 - pointer symbol (*) location - padding fixes - braces fixes Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Trim CSV lines on importGravatar Miika Turkia
In practice this will sanitize Windows line terminations (discard the carriage return); Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Allow removal of manually added unused cylindersGravatar Joakim Bygdell
Fixes #832 Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Change the diveSiteMessage to show close or accept/rejectGravatar Dirk Hohndel
This gives us consistent behavior and allows closing the dive site management screen without editing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Clean up the UI when finished editingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Turn the toolbar back on after editing a dive siteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Don't call enableEdition() every time a change is madeGravatar Dirk Hohndel
We only need to do this once. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Don't enter dive site edit mode whenever the coordinates are set in the UIGravatar Dirk Hohndel
This function was missing the check if setting that field actually changes what's already in the data structure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Add notificationwidget to cmake buildGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Don't call UI functions from helper codeGravatar Dirk Hohndel
This may seem much more complicated but actually is much cleaner. Add each thread we start to the list of future results and add a new UI function that updates the UI once all of the threads have finished. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Import Datatrak/WLog filesGravatar Salvador Cuñat
Sequentially parses a file, expected to be a Datatrak/WLog divelog, and converts the dive info into Subsurface's dive structure. As my first DC, back in 90s, was an Aladin Air X, the obvious choice of log software was DTrak (Win version). After using it for some time we moved to WLog (shareware software more user friendly than Dtrak, printing capable, and still better, it runs under wine, which, as linux user, was definitive for me). Then, some years later, my last Aladin died and I moved to an OSTC, forcing me to look for a software that support this DC. I found JDivelog which was capable of import Dtrak logs and used it for some time until discovered Subsurface existence and devoted to it. The fact was that importing Dtrak dives in JDivelog and then re-importing them in Subsurface caused a significant data loss (mainly in the profile events and alarms) and weird location of some other info in the dive notes (mostly tag items in the original Dtrak software). This situation can't actually be solved with tools like divelogs.de which causes similar if no greater data loss. Although this won't be a core feature for Subsurface, I expect it can be useful for some other divers as has been for me. Comments and issues: Datatrak/Wlog files include a lot of diving data which are not directly supported in Subsurface, in these cases we choose mostly to use "tags". The lack of some important info in Datatrak archives (e.g. tank's initial pressure) forces us to do some arbitrary assumptions (e.g. initial pressure = 200 bar). There might be archives coming directly from old DOS days, as first versions of Datatrak run on that OS; they were coded CP437 or CP850, while dive logs coming from Win versions seems to be coded CP1252. Finally, Wlog seems to use a mixed confusing style. Program directly converts some of the old encoded chars to iso8859 but is expected there be some issues with non alphabetic chars, e.g. "ª". There are two text fields: "Other activities" and "Dive notes", both limited to 256 char size. We have merged them in Subsurface's "Dive Notes" although the first one could be "tagged", but we're unsure that the user had filled it in a tag friendly way. WLog adds some information to the dive and lets the user to write more than 256 chars notes. This is achieved, while keeping compatibility with DTrak divelogs, by adding a complementary file named equally as the .log file and with .add extension where all this info is stored. We have, still, not worked with this complementary files. This work is based on the paper referenced in butracker #194 which has some errors (e.g. beginning of log and beginning of dive are changed) and a lot of bytes of unknown meaning. Example.log shows, at least, one more byte than those referred in the paper for the O2 Aladin computer, this could be a byte referred to the use of SCR but the lack of an OC dive with O2 computer makes impossible for us to compare. The only way we have figured out to distinguish a priori between SCR and non SCR dives with O2 computers is that the dives are tagged with a "rebreather" tag. Obviously this is not a very trusty way of doing things. In SCR dives, the O2% in mix means, probably, the maximum O2% in the circuit, not the O2% of the EAN mix in the tanks, which would be unknown in this case. The list of DCs related in bug #194 paper seems incomplete, we have added one or two from WLog and discarded those which are known to exist but whose model is unknown, grouping them under the imaginative name of "unknown". The list can easily be increased in the future if we ever know the models identifiers. BTW, in Example.log, 0x00 identifier is used for some DC dives and from my own divelogs is inferred that 0x00 is used for manually entered dives, this could easily be an error in Example.log coming from a preproduction DC model. Example.log which is shipped in datatrak package is included in dives directory for testing pourposes. [Dirk Hohndel: some small cleanups, merged with latest master, support divesites, remove the pointless memset() before free() calls add to cmake build] Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Clear after accepting / rejecting the LocationEditGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Change color / mark widget as changed correctly on LocationEditGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Clone a bit of code to mark the Location Widget changedGravatar Tomaz Canabrava
This code is the same that is used on the MainTab, but since they are different objects, I can't just call it. so I'm duplicating them for the time being. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Remove redundant codeGravatar Tomaz Canabrava
Another snippet that shouldn't exist. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Remove dead code.Gravatar Tomaz Canabrava
This code used to trigger the edit mode a long time ago since now I'm re-reading the code to implement the same stuff on the Location edit mode, I realized that this is not needed anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Do not show the Edit mode message when entering location management screenGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-09Import subsurface-android build scriptGravatar Anton Lundin
Over one year ago i started with a crazy idea, "Wouldn't Subsurface on android be nice?" when i read about Android support in Qt. After playing around with it and doing some quite ugly hacks i got it to build and run. Now are all the patches upstream and this imports the quite crude build script, for others to continue on. This is a squash-import of what have have happened in https://github.com/glance-/subsurface-android during 2014. Signed-off-by: Anton Lundin <glance@acc.umu.se> CC: Joseph W. Joshua <joejoshw@gmail.com> CC: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-09Improve gas accounting in the pannerGravatar Joakim Bygdell
When using gasmixes where the difference is less than 2% the planner can't caclulate casconsumptions correctly. This sets the minimum gasdifference to 1%. Fixes #795 Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-09Fix building with NO_PRINTING for AndroidGravatar Anton Lundin
Back in 4867ee8ad87399f34a399f30def700b2fc045309 ("Move the Profile out of the mainwindow.ui") the way to access the PlannerDetails object changed. This does the corresponding change to the NO_PRINTING block, making it build on Android again. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-08Include upper case extensions on import dialogGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-08Ignore buddy pressures in Liquivision importGravatar Miika Turkia
Since we do not currently handle buddy pressure properly, let's just ignore that information for now. Unfortunately, this information is lost in this case, but if we include it, the pressure graph is going to be bogus. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-08Fix a crash on Liquivision importGravatar Miika Turkia
Without the patch, there is a crash if the dive does not have a location. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-08Add explicit setpoint change at t=0 when planning CCR divesGravatar Robert C. Helling
As we now have the logic that there is always an explicit setpoint at t=0sec for CCR dives, also the planner should honor that. This fixes a bug that when planning a CCR dive we later add a setpoint change this influenced the ceiling _before_ the setpoint change. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28Add ability to undo renumbering of divesGravatar Grace Karanja
Expand the undo feature by storing a list of renumbered dives' ids and numbers so that the original numbers can be restored if needed. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28HTML: Add Max. depth to dive view.Gravatar Gehad elrobey
Add Max. Depth feild to the expanded and main dive views. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28Show notification message while logs are converted from v2Gravatar Gehad elrobey
This is another long operation that needs showing a notification about importing the old format log files Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Show translated String.Gravatar Gehad elrobey
Translated notifications are always better. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Change the references to ShowError to the new notification object.Gravatar Gehad elrobey
Showing an Error message is better called from the Notification Object, So for consistency old references to showError is replaced by calling the notification object. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Creating a Notification widget in the Main Window.Gravatar Gehad elrobey
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-27UI to learn hashes of local image filesGravatar Robert C. Helling
This addes a menu entry for the user to select a directory that is recursively traversed to look for image files and compute the hashes of those images (for those images to be available to be displayed in dives according to their hash values). This traversal and hash computation happens in and independend thread and so far the only feedback to the user is that upon completion the dispayed images are updated. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Add hashes to imagesGravatar Robert C. Helling
Upon successfull reading an image file, this computes a SHA1 hash of the image and saves it with the picture tag in the log file. When a file is not successfully loaded (for example because the log was created on a different computer) we look up the hash in a dictionary that maps hashes to local file names. That dictionary (actually two for both directions), is loaded on startup and saved upon destruction of the main window. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-26qt-gui.cpp: fix imcomplete type errorGravatar Lubomir I. Ivanov
qt-gui.cpp:44:2: error: incomplete type 'QTextCodec' used in nested name specifier Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-25Display slowness warning before opening a V2 fileGravatar Dirk Hohndel
This is somewhat invasive as aborting the XML file read requires us to report things up the recursive parsing chain. What we really need to do here is to ask the user how they want to use the data from reverse geo lookup. But for now we only warn about the fact that this can take a while. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-24Cmake build now contains iconsGravatar Patrick Valsecchi
Fixed the icon problem Dirk found. We really should choose between qmake and cmake. I wouldn't care about cmake if qmake was building the UTs... From 8eeea28a523fd6ef588d81b82ab904d4512b3d7a Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi <patrick@thus.ch> Date: Tue, 24 Feb 2015 09:06:37 +0100 Subject: [PATCH 3/3] Cmake build now contains icons Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-24Fix Ubuntu compilation error.Gravatar Patrick Valsecchi
Ubuntu has git minor version 20 which has less parameters in git-remote-fetch. From ac9516984e4fbc787635b0dfd76649c8e43fab83 Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi <patrick@thus.ch> Date: Tue, 24 Feb 2015 08:45:21 +0100 Subject: [PATCH 2/2] Fix Ubuntu compilation error. Ubuntu has git minor version 20 which has less parameters in git-remote-fetch. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-24Fixed cmake build.Gravatar Patrick Valsecchi
Non parallel build was broken because qthelper.cpp was depending indirectly on a QT generated file and no cmake dependency was enforcing the file to be generated before. I've removed the not needed #include that was introducing this dependency. In cmake, {FOO STREQUAL ""} is TRUE only if FOO is defined and empty. Fixed a couple of bad usages. Made the required libraries actually required in cmake. From ef5ab90f258c5754d3022a023c28050cbafed3d5 Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi <patrick@thus.ch> Date: Tue, 24 Feb 2015 08:38:49 +0100 Subject: [PATCH 1/2] Fixed cmake build. Non parallel build was broken because qthelper.cpp was depending indirectly on a QT generated file and no cmake dependency was enforcing the file to be generated before. I've removed the not needed #include that was introducing this dependency. In cmake, {FOO STREQUAL ""} is TRUE only if FOO is defined and empty. Fixed a couple of bad usages. Made the required libraries actually required in cmake. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23Move helper functions aroundGravatar Dirk Hohndel
We had a ton of helper functions in qt-gui.cpp which really didn't make much sense. So I moved them all into qthelper.cpp. Also moved the UserAgent helper that didn't belong in the UpdateHandler to begin with - that's a generic helper used in many places... With this we can successfully build using cmake again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23Add LIBGITDEVEL support to CMakeLists.txtGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23Add new files to CMakeLists.txtGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23Add LIBMARBLEDEVEL support to cmakeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23Add support for more GPS coordinate formats.Gravatar Patrick Valsecchi
As requested in the user forum and in the mailing list, now support: - 46.473881 6.784696 (format used in XML files) - 48 51.491n 2 17.677e I was not able to handle the XML format in a generic way without making the code too ugly. So I've added an exception. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22Include DC information on Cobalt importGravatar Miika Turkia
Note that I use the serial number as device ID as is done with the Suunto DM5 import. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22Ignore deleted dives on Cobalt importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22Start building packages for vividGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22Update Qt4 patchGravatar Dirk Hohndel
This time really just the patch Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22Revert "Update Qt4 patch"Gravatar Dirk Hohndel
This reverts commit 762315e7eef47c1a5357e9c8691676707e3c630e. Oops, this was supposed to update the patch, not update and apply it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22More flexibility when linking statically against libgit2Gravatar Dirk Hohndel
Allow static or dynamic linking against libssl and libcrypto. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>