A custom tag widget has been added to MainTab.
Tags are seperated by a comma ",". The implementation
supports escaping a comma by using "\,".
While typing, the widget supports the user by suggesting
tags using a QCompleter.
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
This enables undo for the edit mode on added dives, it uses the
premade backup to fill the old dive with data. :)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Changed the backup implementation of the samples on EditDive,
it's way cleaner now what's happening, and it's also better for
the cancel edit.
Next: The Cancel Edit.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
This patch enables editing a dive that was manually entered,
it doesn't cover dive plans yet because on the plan I need to
figure out what are the 'user-entered' points, and what are
the algorithm point. and I feel lazy. =p
One last thing that's missing is to revert the dive to the
previous condition if the user cancels the edition, currently
canceling and applying ok is the same thing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Added a new option to edit the dive in the profile view. The option
will only be visible if the dive was manually entered or if the dive
is a plan.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
We cannot use tr("").toLocal8bit().constData(); on a function
that expects a char* because the object will be deleted on the
next line, so a strdup is necessary.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
This adds alt-f shortcut to access file menu as well as other similar
alt based shortcuts for other menu items.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The setupSplitters method was created quite a while ago
to deal with the splitters when I didn't used a more sane
approach. I forgot to delete it back them, removing now.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This patch does the hooking up to show the dialog of the
divelogs.de window when the user selects it on the menu.:
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This patch moves around a few items on the menu to a new submenu
downloads/uploads. I think it's not the best way, but it already
fives a bit more of 'unverbosity', because the old menu had
'Download from Dive Computer', 'Download from Webservices', and
now we would introduce a new 'Download from Divelogs.de'
I tougth it was better to have a 'parent' named 'Download' and
put all children inside. this can grow quite big as soon as I implement
the plugin system for that.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the skeleton code for the Download / Upload from Divelogs.
de webservice. Now I need to hoopup things from the .ui side and
do the actual implementation of the code.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The setting was 'webservice', but this is too wide, since we are
supporting more than one. changed it to 'subsurface_webservice_uid'
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Created a WebService dialog that will handle download and upload
from all child based webservices. Also, ported the currently - only
- one webservice to use the new dialog.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
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>
This patch fixes some unsane values that was being retrieved
by the ui-files on first time opening. it creates a basic layout
of the application using the current desktop size.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Some columns are a nice addition, but not a must have,
and thus are hidden-by-default, uncluttering the user interface.
This was discussed with a few designers before writting the code,
and also discussed with dirk on irc.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
"Weight" was misspelled "weigth" in several places in the code
and comments.
Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subsurface stores weight values in grams. When displaying lbs,
the dive list was not rounding the converted weights up, but
rather truncating the value at the decimal place. The equipment
list was rounding the converted weights up. This gave two
different displayed values for the same weight value.
Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Those preferences removed ( basically the ones about visibility of
the List View of the Table ) are now managed by the Qt Settings
system, and thus there's no need to have them there. wich gave us
a pretty good cleanup.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Some people (free divers) are loving ft/s or m/s units for vertical speeds.
Now they can choose between /min or /s in the configuration (only Qt UI).
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For a new installation, subsurface will now start on fullscreen,
this fixes the bug where subsurface would start using the interface
file ( mainwindow.ui ) configured size, and that silly monster
always changes when editing something.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The first time the user loads subsurface, the default_filename
is not configured yet, but yet the software tries to load "",
sending an error message that this file doesn't exists.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Taiane Ramos <exhora.tat@gmail.com>
If we #include "qt-ui/ui_anything" from anywhere, the Makefile rules
will blow up.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When straight decoding the event, it failed to handle older
SAMPLE_EVENT_GASCHANGE(11), the ones without he-part correctly. This was
shown clearly when it printed the 21/35 in dives/test20.xml as air.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We don't use any of the Standard Library features or classes in
Subsurface, except for three uses of std::sort, for which I added the
necessary #include.
It's always a good idea to include directly the headers you want,
without relying on indirect inclusion
On my machine, the build time dropped from 16.96s to 13.38s or a 12%
improvement.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Still don't like the order dependency - but at least this seems to work
and correctly build after make confclean.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This means we don't have to new/delete them, which is a waste of
overhead.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This means we can also remove the forward declarations.
This is the first step in removing the memory allocation for the ui
sub-classes. Without the second step, this commit is just making the
compilation time increase for no good reason :-)
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
PrintLayout::printTable():
- hide the QTableView widget border using a stylesheet
- add a guard to fix the last column extending post the page width
due to rounding
- use 1 extra pixel instead of 2 when grabbing the page region
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a couple of classes and some other modifications
in PrintLayout that handle the printing of tables under a profile.
models.h : ProfilePrintModel
The class uses a 'struct *dive' to output all required data
for a certain dive at specific rows and columns. It also handles
font formatting and text alignment.
modeldelagatates.h : ProfilePrintDelegate
The class is used only for drawing a custom grid for profile tables.
PrintLayout::createProfileTable()
The function is used to create and setup the profile table object
PrintLayout::printProfileDives()
The function now has correct padding of dive profiles on a page
and also the printing of actual tables below them.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adding +30 (seconds) to the position works fine for long dives but
when zoomed in on short dives, 30 seconds are a lot.
This commit sets the offset to +10 px regardless of the scaling.
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
The toolbar adds two buttons to the profile.
The user can now toggle the scaling (zoomed to dive/round up to 30 mins)
and adding /removing ruler to/from the profile using this toolbar.
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
This patch adds a ruler QGraphicsItem which can be dragged
along the profile. The ruler displays minimum, maximum and
average for depth and speed (ascent/descent rate). Also, all used
gas will be displayed.
This also adds a new attribute to struct plot_data to store the
speed (not just as velocity_t).
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
printlayout.cpp(h):
This patch cleans some test code and adds the function
printProfileDives() that accepts a number of dives
per rows and columns. It can technically fit any number
of dives on a page given the page size allows it. Both
landscape and portrait layouts are supported.
It now replaces the old methods:
printTwoDives()
printSixDives()
Space is reserved for data tables that will be placed
bellow profiles on a later stage.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Gtk+ style on the Gnome shell is somewhat broken on Qt for
some reason. This hack pokes the system, checks if it's running
gnome-shell, and if the current style is gtk+ ( I couldn't just
check for gtk+ since it worked on XFCE and other Gtk based enviro
ments. so a double check is needed. ) then I changed the Pallete
of the affected widgets by hand.
not a pretty hack but worked.
[Dirk Hohndel: redid the patch to be simpler and more consistent]
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix the positioning of the `add` button when on Gtk style,
in my XFCE install (and thus, may differ a bit from the
Gnome3 one ) the Plus button to add cylinders and weigths
got really strange placements, this seems to fix this,
I also tested on Oxygen and nothing broke there.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This patch fixes the cylinders and weigth edition
by keypress. I don`t know when I broke this and linus found,
most probably when I added the code for showing the
cylinder size and working press while moving the mouse
around the list - sorry guys.
So, now this *seems* fixed, tested for a fairly good
amount of time and everything seemed ok.
I was unable to reproduce the behavior that linus got
on two value overlapped on each other, tougth.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This patch fixes the display of subsurface in smaller
screens by creating ScrollArea containers that are
now englobbing each of the Tab-pages and the Planner
Widget. Some of those widgets were pretty big by the
amount of things on it and it was too big for small
( 14" and 15" ) screens.
This seems to fix it, and looks good both on Gtk+ and
Oxygen styles.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>