aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-10-03Make the classes generated by uic be real members of our classesGravatar Thiago Macieira
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>
2013-10-03Include the ui_*.h headers in the main headers.Gravatar Thiago Macieira
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>
2013-10-03Fix unitialized variable useGravatar Patrick Valsecchi
I ran subsurface with valgrind and it found a few errors. [Dirk Hohndel: split this out from a much bigger patch that is still under review] Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Bugfix typo in get_gas_usedGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Importing salinity and atmospheric pressure from DC.Gravatar Patrick Valsecchi
One cannot expect #ifdef to work with enum values. So the code for getting the salinity was basically never compiled in. And it was putting it in the wrong location anyway (in the dive struct instead of the divecomputer struct where it is expected). I took the opportunity to add the reading of the atmospheric pressure as well. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Sample dive from APDLogViewerGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Print: small adjustments to table printingGravatar Lubomir I. Ivanov
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>
2013-10-03Print: provide means to print profile tablesGravatar Lubomir I. Ivanov
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>
2013-10-03Profile: use a 10px font when printing profile textGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Helpers: add get_cylinder_used_gas_string()Gravatar Lubomir I. Ivanov
get_cylinder_used_gas_string() retrieves used gas per cylinder with optional units display. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-02Added 3L Pony tanks to the list of default tanks in equipment.cGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-02Test dive for CSV importGravatar Miika Turkia
This test dive follows the format of APD Log Viewer but contains only the currently used data (time, depth, and temperature). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-02Add AL40 to list of standard tanksGravatar Benjamin
Fixes #191 on the bug tracker list Signed-off-by: Benjamin Fogel <nystire@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-02Initial code to import CSV log filesGravatar Miika Turkia
This patch implements basic functionality to import CSV formatted log profiles to Subsurface. The import includes time, depth and temperature from AP Logviewer based on one sample log file I have received. It is assumed that dive time is the first parameter and depth second. Temperature is given as a parameter from C source (hard coded currently to field 15) but we should have a GUI implemented for selecting the wanted fields. The two different sample logs of CSV dive log export I have received use tabulator as field separator. I assume the possible GUI should have option for the FS as well to be given as parameter to the XSLT. [Dirk Hohndel: small fix to the error string malloc] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01Added a spacer at the bottom of the dive info and stats gridsGravatar Patrick Valsecchi
Fixes #204 Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01Fix weight adding in the Qt UI & fix the header height for tablesGravatar Patrick Valsecchi
Fixes #203 Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01Ascending/descending speeds are usually expressed in x/minGravatar Patrick Valsecchi
There is debate on this one, as free divers WANT the xx/sec values. This needs to become flexible depending on whether you are in freedive mode or not. Fixes #202 Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01Make the renumbering of dives accept numbers up to 99999Gravatar Patrick Valsecchi
Fixes #201 Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-27Merge branch 'toolbar-ruler-rb' of github.com:mguentner/subsurfaceGravatar Dirk Hohndel
2013-09-27correct the placement of pressure markersGravatar Maximilian Güntner
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>
2013-09-27Added a toolbar to the profileGravatar Maximilian Güntner
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>
2013-09-27Added a ruler which can be dragged along the profileGravatar Maximilian Güntner
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>
2013-09-27implemented zoom actionGravatar Maximilian Güntner
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-27plot seconds with a fixed width of 2Gravatar Maximilian Güntner
before: 0:50 1:0 1:10 after: 0:50 1:00 1:10 Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-27Print: provide means for profile layoutingGravatar Lubomir I. Ivanov
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>
2013-09-27Hack to make the subsurface work on Gnome3 shellGravatar Tomaz Canabrava
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>
2013-09-26Fix the positioning of the `add` button when on Gtk styleGravatar Tomaz Canabrava
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>
2013-09-26Fix the edition of cylinders and weigths by keypressGravatar Tomaz Canabrava
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>
2013-09-26Fixed the display of Subsurface in Smaller ScreensGravatar Tomaz Canabrava
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>
2013-09-26Only set documentMode on tab if in Oxygen style.Gravatar Tomaz Canabrava
This is much better looking in the Oxygen style, and on the other styles it looks like crap - so let`s not use that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26More cleanup for the Gtk+ StyleGravatar Tomaz Canabrava
This patch eliminates 18px offset from the MainWindow main layout, making the window feel less spacy. Good on the Gtk+ style, but seems to also make a good work on the Oxygen one. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26Cleanup the prettyness of subsurface on Gtk+ style.Gravatar Tomaz Canabrava
Fix some stuff concerning the pretyness of subsurface while running on Gnome and XFCE enviroments. This is the kind of stuff that I really didn`t want to put on the code but sometimes it`s for the best. this makes the MainTab much more bearable. There are still things to fix, like the size and positioning of some of the icons. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26Code Cleanup, less magic indexes.Gravatar Tomaz Canabrava
This patch removes the magic indexes used to control the mainwindow display of the profile and planner by an enum. a bit more verbose but hard to miss. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26Set the Cylinder/Weigth even if it's the same old value.Gravatar Tomaz Canabrava
Since the cylinders and weigths have other data attached to it, like size and working pressure, one could mess the other data and want it to revert to the cylinder / weigth defaults, but for that the user had to choose another item, then go back to the previous one, so the cache would be clean. This patch fixes that by reverting the values to the it fixes linus bug n2, where he had invalid data on the other fields and had to go back and forth for it to be fixed. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Make the Qt ComboBox behave in a Better WayGravatar Tomaz Canabrava
So, the ComboBox is a beast, and when used on a Delegate it's very hard to get things right, wich is a pitty, because I overly like qt. So: 1 - Combobox needs to show the popup when user press ↓ and ↑ keys 2 - Combobox needs to select when user press enter, not twice. 3 - Combobox neesds to select when user selects from the mouse, not pressing enter after. 4 - Combobox needs to not mess with stuff when moving around. Everything that I listed there works on a non-delegate combobox, but for some reason, a delegate missed those, so I reimplemented all. not nice, but now we have a code that will work, I hope. *fingers crossed* Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Hook 'Add' from cylinders and weigths to enable EditionGravatar Tomaz Canabrava
This code hooks the plus button on both cylinders and weigthsystem tables to trigger the enableEdition() and thus the work done when you click on + will be saved / discarted when the user cancels the plan or accepts it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Code cleanupGravatar Tomaz Canabrava
Fixes a couple of whitespace issues. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Set the Cylinders and Weigths to all selected dives after pressing 'Accept'Gravatar Tomaz Canabrava
This bit of magic actually performs the save on the dive list for the changed weigths and cylinders, it will set the cylinders only if there's a change on the cylinder model, and it will set the weight only if there's a change in the weigth model. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Code cleanup - create a method for cleaning the Palette.Gravatar Tomaz Canabrava
Code cleanup, create a method for cleaning the palette, less code is better in this case. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Only mark dive list as changed if 'Accepted' was clicked.Gravatar Tomaz Canabrava
The old code marked the dive list as changed on any of the changes in the model, this was incorrect since the user could just cancel the edition, wich means that the divelist shouldn't be marked as changed at all. when the user clicks on'accept', and the item is indeed changed on the dive list, then we mark_divelist_changed to TRUE Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Added a 'changed' member on Cylinder/Weigth models to know when to Apply a ↵Gravatar Tomaz Canabrava
change. Added a 'changed' member on Cylinders and weigth models to mark when one was changed or not. Only the changed data should be inserted on the selected dives, so if the user changes the cylinders on a multi edit, there's no need ( and it will actually break things if we did that ) set the weigths too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Enable Edition by clicking anywhere on the Cylinders and Weigths.Gravatar Tomaz Canabrava
This patch enables edition on the selected dives as soon the user press delete or any other column on the Cylinder / weigthsystem. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Revert to the old values of Cylinders and Weigthsystems on cancelGravatar Tomaz Canabrava
This patch enables canceling the edition of cylinders and weigth systems, as soon as the user press cancel, the old values are re-populated on all selected entries. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Created a placeholder for the Equipment Edition.Gravatar Tomaz Canabrava
This creates a placeholder for the equipment edition, it will ease the 'revert' and 'apply' when editing multi dives. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Added more wildcards to the GitignoreGravatar Tomaz Canabrava
Gitignore is now ignoring callgrind files and kdevelop projects, this was annoying me. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-24Disable info widget when canceling 'add dive' for a first diveGravatar Dirk Hohndel
One more corner case that we cover correctly. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24Only offer to merge dives if they are consecutive in the divelistGravatar Dirk Hohndel
You cannot merge dives if there is another, unselected dive "between" them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24Much easier way to detect if more than one dive is selectedGravatar Dirk Hohndel
Instead of getting data from Qt just use our internal notion of the number of selected dive to decide if more than one dive is selected (and therefore if we need to show the 'merge dives' option in the context menu). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24Document MaxOSX DBUS workaround in the READMEGravatar Robert Helling
This documents the temporary workaround for the libmarblewidget (and plugin) issues on MacOS in the README. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-23Add "merge selected dives" to dive list popup menuGravatar Dirk Hohndel
This is fairly straight forward. What I dislike is the check for the magic number of "14 indeces". I'm sure there's a better way to tell if more than one dive is selected... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>