Implement exporting in UDDF format as was done in Gtk version. File menu
exports all the dives, right click on selection exports the selected
ones.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's not written purely in C anymore. There's quite a lot of C++ now,
not to mention Perl, XSLT, shell scripting, etc. :-)
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The popup menu entries should be all lowercase.
Also we should handle this the same as regular save and open when it comes
to remembering the last path.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds the 'Save As' option on the dive list,
very straigth forward, just simple and beauty.
tested and working.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This tracks the autogroup state remembered in data files. Toggling the
checkable menu item causes the divelist to be marked as changed. This
might actually be untrue - but that's really hard to track so this is the
"better safe than sorry" approach.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Marble had a bug on the way it treats zoom level, there's
no way for it to find out if it's user-input or algorithm input
and when a user clicks on a dive, it spins and centers on it,
but if the user clicks on another dive when it's still spinning,
it will get the zoom in the actual state ( spinning, usually zoom
is far away from the first position ) and continue the spin to the
other position.
This patch works by saving the first location and triggering a
helper function with a timer that will only update the zoom level
if the timer is not active ( and thus, will not get the bugged
zoom state set by the animation. ).
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is really nice to have when looking at specific parts of a dive.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
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>
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>
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>
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>
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>
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>
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>
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>
There are other models ( Tree Models and Model Items
) that are not affected by this commits, this is
already a good cleanup but it can be extended
to also fix those two other possibilities.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Second model converted to be less boilerplated,
there are right now 7 models that will need to
be ported. each model can remove around 30 to 40
LOC, so this is not such a bigger improvement,
but it's an 'keeping an eye on the future'.
Also fixed a bug where the returned value was dummy.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The Model View system in Qt is *very* verbose, this is the
beginning of a series of patches that will concentrate
the boilerplate somewhere and reduce the amount of lines
and will also try to make the code cleaner and easyer to
understand,
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
I just went thru all of subsurface code removing
some whitespaces issues and trying to make the
code prettyer, I also removed a few QString issues.d
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
There's a C++ way for it. And, for some reason, it wasn't defined on my
MinGW build:
qt-ui/profilegraphics.cpp:1006:57: error: 'MAX' was not declared in this sscope
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Patch enables the 'Profile on top' / 'Notes on top'
functionality in the print options dialog.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After selecting a dive or a series of dives, the "Stats" tab shows the
minimum, average and maximum stats for the selected dives. The "Depth"
section does not display the correct value for the maximum depth.
Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- remove the build flags and libraries from the Makefile / Configure.mk
- remove the glib types (gboolean, gchar, gint64, gint)
- comment out / hack around gettext
- replace the glib file helper functions
- replace g_ascii_strtod
- replace g_build_filename
- use environment variables instead of g_get_home_dir() & g_get_user_name()
- comment out GPS string parsing (uses glib utf8 macros)
This needs massive cleanup, but it's a snapshot of what I have right now, in
case people want to look at it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a helper function to unify the calculation of the
weight display string, instead of having the same calculation
in two places in the code.
Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>