aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divelogimportdialog.cpp
AgeCommit message (Collapse)Author
2015-04-24Add suit field for CSV importGravatar Miika Turkia
Fixes #853 [Dirk Hohndel: fixed test compile] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22Handle XSLT based imports correctlyGravatar Dirk Hohndel
XSLT conversions create V2 XML files, but we shouldn't abort when we parse those without having the user informed about the potential slowness - all XSLT based imports are slow, anyway. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-23Import support for new Seabear formatGravatar Miika Turkia
This add support for Seabear's new import format that is used by H3 and T1. In the future also the Hudc should switch to the new format. The main difference to the old one is that time stamps are no longer recorded in the samples, but intervali is specified in the header. The header contains other useful information as well that we should build support for. E.g. surface pressure, gas mixes, GF, and mode might be useful additions later on. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15CSV import: average depth name fixGravatar Miika Turkia
Field name changes should change all the occurrences... We ended up with field index of -1 for average depth due to mixing field names. Signed-off-by: Miika Turkia <miika.turkia@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-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-19Update Qt4 patchGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the ProfileWidget from mainwindow.uiGravatar Tomaz Canabrava
It is now in mainwindo.cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-07Select the known import for APD automaticallyGravatar Miika Turkia
If the filename has extension of .apd, then set the known import automatically. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01Fix crash if one selects incorrectly Seabear CSVGravatar Miika Turkia
Fixes #814 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31Fix maximum depth on CSV importGravatar Miika Turkia
Commit d329420d5549e02e32ff4673513329f9dc30650f changed the name of the header from "Max depth" to "Max. depth", so we need to use that in the code as well. (The dive profile is not drawn if we do not have max depth.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-29Make sure the index is validGravatar Dirk Hohndel
There are reports that the replace calls can cause the application to crash. This doesn't seem to make sense, looking at the code - this change shouldn't make any difference. But it makes it even more clear that there shouldn't be any possible scenario in which we call replace with an index that's out of range. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27divelogimportdialog.cpp: remove extra line at EOFGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27divelogimportdialog.cpp: more capitalization of acronymsGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26Typos, punctuation and capitalisation.Gravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25Typos: capitalize TTS, CNS, NDL in diveloginportdialog.cppGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25Typos: use subscript for pO2 in divelogimportdialog.cppGravatar Lubomir I. Ivanov
[Dirk Hohndel: also fixed the "detph" typo] Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Match ₂ to 2 and cylinder to cyl. on CSV importGravatar Miika Turkia
This improves the column name matching so our own columns are properly supported. See #814 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Switch Subsurface CSV import to use tab separatorGravatar Miika Turkia
As changing the export to use tabs, we need to switch the import to do that as well. However, we also need to support comma separation as older exports use that. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Block the signals properlyGravatar Miika Turkia
It seems that at least in this occasion, the signal blocking requires the UI element to be given. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Limit the row count properly when displaying CSV fileGravatar Miika Turkia
The import dialog now displays only a maximum of 10 lines of the CSV file to be imported. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Enable importing of dive profile from CSV filesGravatar Miika Turkia
This assumes that we have either dive details or dive profile, not combined log files. Before the change in the import UI, user selected the import type by the tab on import dialog, now we make an educated guess based on whether sample time field is available. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Fix the support of APD Log Viewer CSV importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24CSV import, fix known import handling with tab separatorGravatar Miika Turkia
When we have the separator as tab, we need to use the proper tab character instead of the string for known imports. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Known import fix for XP5Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24Fix segm fault on known CSV importsGravatar Miika Turkia
If the header line is not set up properly, the known imports assignments will index out of the array. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23Set the known import selection for Seabear importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23Use proper sample headings for Seabear CSV importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-22Use correct case for string matching on CSV importGravatar Miika Turkia
As the string was changed in our CSVApps array, we must change it here as well. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-22Fix string that is used as XML tag nameGravatar Miika Turkia
We use the human readable name here as XML tag name so it cannot contain spaces. Note that currently some of the names can have spaces in them as they are special cases and not used as XML tag name. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-22Fix order of CSV field separatorsGravatar Miika Turkia
Unfortunately we are referencing these separators with index, so they need to be on same order as used in XSLT files. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-22Special handling of Seaber CSV filesGravatar Miika Turkia
These files contain a bit of extra data before the actual CSV part, so we need to skip there to show sensible information to users. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Clean up the header filesGravatar Dirk Hohndel
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-08No need for a new variableGravatar Dirk Hohndel
We already have provider in a local variable. The lookup and "model" variable is redundant. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CSV import: make predefined imports work againGravatar Dirk Hohndel
We need to reparse the file when the known type changes and want to make sure that we only try to guess the separator and the columns if the user hasn't told us otherwise. For the predefined imports this then looks up the correct columns and places the correct headings there - and then allows the user to modify them if needed. This has been lightly tested, there may be dragons. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CSV import: first steps to enable the preset types againGravatar Dirk Hohndel
With the new infrastructure colum numbers are 0 based, so the indices had to change. This commit also adds the column names for sample based formats (and ends up re-indenting parts of that code). This doesn't make things work, yet, but it's a step in the right direction. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CSV input UI: if we detect columns, set type to "manual" for nowGravatar Dirk Hohndel
We still need to re-implement the other presets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CSV import UI: Minor update to stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CVS import UI: mark the column names in blue as wellGravatar Dirk Hohndel
And make the bubbles slightly larger. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CVS import UI: mark the drop row in blueGravatar Dirk Hohndel
That way it is distinct from the rest. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CVS import UI: better message if some columns were matchedGravatar Dirk Hohndel
If we automatically matched the columns this might already be correct. So the standard text is confusing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CSV Import UI: Prettifications, hide headers, code cleanup.Gravatar Tomaz Canabrava
Just a few cleanups. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07Fix moving columns around when one of the columns is emptyGravatar Tomaz Canabrava
I used to compare strings, but since there can be more than one empty column, this was a very sad choice, now I'm comparing indexes. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07Draw a nice rounded rect around the avaliable column namesGravatar Tomaz Canabrava
This drawns a nice rounded rect around the avaliable column names, using antialiasing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07Give the items a bit more spacing / enable the delegateGravatar Tomaz Canabrava
Enable the new delegate on the view, and give the items a bit more spacing, so we can draw things around them. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07Add delegate skeleton for the drag columnsGravatar Tomaz Canabrava
This new class is the responsible to draw the columns that can be dragged from the top bar to the bottom one. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CVS import UI: use my own match functionGravatar Dirk Hohndel
This makes the code simpler and allows us to do a much better job matching the column names. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CSV import UI: First step towards recognizing column headersGravatar Dirk Hohndel
This doesn't do a good job of matching the titles, but it works for some of them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07CSV import dialog: try to guess the separator based on the fileGravatar Dirk Hohndel
This is taking a very simplistic approach. It picks the predominant potential separator. If there is no clear winner, it uses the UI default and makes the user pick (and either way, this can always be overwritten by the user). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06Adjust capitalization to our styleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>