D as in depth, T as in time and not another T as in temp.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the CSV import transformation is now parametrized and does not
have any defaults, we need to use the CSV import GUI. Thus give an error
message if one is opening CSV file directly.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As some CSV log files seem to contain multiple sample lines for a single
time, we'll just grab the first one of them to avoid duplicates.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Field variables for the CSV XSLT import have disappeared at some point
during developing GUI for the CSV import. So adding them to the XSLT for
the field selections to have effect.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
divelist.c:
get_dive_date_string()
get_short_dive_date_string()
get_trip_date_string()
MinGW support for *printf and parameter positions (e.g. %1$d)
is horribly broken. Instead of implementing *proper* support
for this feature Microsoft decide to ignore the standard (again)
and they implement new functions with the '_p' suffix,
such as 'sprintf_p', which seem to be available from a 2003 runtime.
To top that 'sprintf_p' is not really a 'sprintf' but rather
a 'snprintf'.
It seems that the MinGW people ignore the issue and do not provide
wrappers of any sort, or at least for the current recommended compiler
for Qt 4.8.5 on Windows - which is a 4.4.0. A note of warning;
inspecting how MinGW does certain things in headers such as stdio.h,
can ensue bad dreams or other negative effects on to the viewer.
This forces us to move the following functions from the 'back-end'
(divelist.c) to the 'front-end' (qt-gui.cpp) and use QString.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch implements GUI for importing CSV log files. One is able to
configure what columns contain time, depth and temperature fields.
Pre-configured log applications currently included are ADP log viewer
and XP5. (Both of these use actually tab as separator, so the field
separator currently hard-coded.)
[Dirk Hohndel: minor fixes]
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we convert time in seconds to mm:ss format, we do not want to round
but get floor instead.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Going through pixmaps for the profile was not needed and was making our prints
look very pixelated.
In Qt4, QWidget child classes are printed as bitmaps. So appart from
changing the code to print the tables to use a QGraphicsView instead,
there is nothing we can do, so the rest of the printing is still done as bitmaps.
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I'm still not 100% sure that this is the way to do it but ran out of time
- and right now the build complains that this file is missing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is necessary for out-of-source builds to work.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This sadly contains a very noisy .ts file diff as those files now are one
directory down from their original spot, so recreating them changed all
the source paths.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will prevent us trying to depend on a file that doesn't exist in
case someone goes on a detached HEAD. For example, this could happen
during a bisect.
(detached head) $ git rev-parse --symbolic-full-name HEAD
HEAD
(master) $ git rev-parse --symbolic-full-name HEAD
refs/heads/master
This will break on a packed ref, though.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Apparently qmake can't tell that #include "version.h" and #include
"libdivecomputer/version.h" are not the same thing. Instead of spending
another bunch of hours on fixing the buildsystem I decided to just cleanup
the spots where we actually use the version file and rename it to
ssrf-version.h.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch restores the ability to move the info-overlay panel on the
profile. For some reason the eventFilter wasn't working (and actually,
looking at the code, it really shouldn't, because I didn't see where I set
it to work, maybe someone (me) broke it a long time ago) well, it seems
fixed now at least. :)
Tested on XFCE, Gnome and KDE, with three different window managers.
[Dirk Hohndel: removed debug output]
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add units to the SAC in the print-out, reduce max depth in metric to one
decimal place, and leave some more characters of the notes to be printed..
Signed-off-by: Robert C. Helling <helling@atdotde.de
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't do "obvious cleanups" at 4 in the morning when you can't sleep because
of emotionally draining issues outside of your control... and if you do,
at least compile test them.
This was introduced by me in commit 2f9f46cb0253 ("Random white space
cleanup").
Sorry.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This Patch fixes the tab behavior on the QComboBox
delegate. For a QComboBox, tab was being treated as
'cancel' action on edit, but since it will send a
editingFinished() signal, and the Qt::Key_Return
will also send a editingFinished() signal, I couldn't
use that method and had to do a little hack around it.
The code is mostly clean and works.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Function is redundant as we should only render the profile
with a custom color table.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make the active font (fnt) use the 'size' member of the received
text_render_options_t. This allows changing the size of
certain text elements.
For the moment most text elements are set to 12px.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Because of varying font (screen) DPI we use pixel sized fonts
when printing. Apparently 8px does not look that good on Windows
default fonts, but kinda OK on Linux. We compensate by
increasing the font size and table rows to 9px.
Also decrease the padding between the table and profile to 5px.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There was a report that the depth and time texts were small
and require more contrast on the B/W print. Use BLACK1 for these.
Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The easiest way to do this seems to make it depend on the correct git
reference. qmake will do the right thing (and create a fixed version.h based on
the VERSION variable) if the user is working from a tar ball.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Let's see how many tries it will take me to get this one right...
The name of the .dmg needs to be determined when running make, not qmake.
Otherwise we'd have to force the user to run qmake every time version.h
changes. This looks better.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is what I get for trying to be smart and pushing a change from the Linux
box because the fix was 'obvious'. Duh. It was not. In order to get the real
full version including the git hash we always have to pass 'linux' to the
gen-version script, even on a Mac.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Custom widget frame styles such as 'Sunken' and 'Raised' which seem to
varry between OS will be captured as well:
http://harmattan-dev.nokia.com/docs/library/html/qt4/qframe.html#Shape-enum
So instead we temporarily set the profile frame to QFrame::NoFrame and
then restore it to the previous value.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are more details to it, but i decided to exclude them
as these seem situational:
- libraries tend to mostly fail to build from source on win32...
- libiconv may be required by an oddly pre-built libxml2 package
- pkg-config requires a CMD wrapper so that an extra CRLF line is
trimmed from stdout
If someone takes on this task, i guess he/she may pop on the
mailing list for questions.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This enabled a file selection dialog for selecting default log file
under the preferences.
[Dirk Hohndel: added missing declaration to .h file]
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
entry->ndl is computed and therefore should not be used for showing
the DC's ceiling. That made the DC ceiling jump to 0m when the computed
celing was at 0.
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
applicationDirPath() does not find the source directory (if build
directory differs from source directory). Using currentPath() allows one
to still run built Subsurface from the source directory and find e.g.
xslt_path.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
CylinderModels::setDive() and WeightModel::setDive() have
potential to pass the 'last' argument to beginInsertRows() as
a negative number which triggers an assert that 'last' cannot
be smaller than 'first'.
Patch attempts to fix that by only calling beginInsertRows()
when there is at least one row to insert.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
\$^ or $(DESTDIR_TARGET) do not expand for some reason,
but also we cannot use $$DESTDIR, $$TARGET, or $$DESTDIR_TARGET
because these are empty. So what we use is a hardcoded path
(debug/release) and a target with an .exe suffix on win32.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Looks like having $$ before QMAKE_HOST.os does not work.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The end pressure was appearing in the column headed "O2"
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
First, make sure we actually match /c/windows from the beginning, not
if it occurs in the middle of the path.
Second, make sure that directories containing the binaries are
searched first. Do that by using unshift (prepend) instead of push
(append).
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dive planner always showed the depth in our internal units, ie
millimeter, in the sidebar that showed the plan points.
That made little sense in metric mode, and none at all in imperial. The
_graph_ showed things in meter and feet.
So make the DivePlannerPointsModel always convert things to and from the
user units.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>