aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-02-14Refactoring sqlite import supportGravatar Miika Turkia
Move the opening of DB connection to occur before DC dependent code. This way we can try to detect log software before calling the DC dependent import function. This prepares for adding support for Shearwater sqlite database. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-14Align Right side of Cylinder Pressure Text to the Left.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-14Left-Align the last Temperature Text.Gravatar Tomaz Canabrava
The last temperature text used to have the same align flags as all the other texts: Right. this makes it much more appealing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-14Show the last temperature on the graph.Gravatar Tomaz Canabrava
The code shamelessy copied from the old profile introduced a bug where the old temperature was not correctly shown. I'v added a new member to the class that will store the last valid temperature, and use that to calculate if there's a reason or not to display it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-14Removed the 'Unused Tanks' from the toolbar.Gravatar Tomaz Canabrava
Just removed the unused tanks from the toolbar, since it's just a removal of something on the ui related code, it's good to see how much verbose the xml to generate the UI is. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-13Updated user manual html fileGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-13User manual: grammar and stylistic revisionGravatar Willem Ferguson
This commit was jointly authored by Pedro Neves and Willem Ferguson. Pedro added a FAQ section to the manual. Many long lines of text were broken into shorter lines. Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-13Automated whitespace / coding style correctionGravatar Dirk Hohndel
First attempt to use the tools on one of our source files. So far so good. Not perfect, but a HUGE improvement. Most importantly it effortlessly fixed the Allman style braces introduced in commit 51220f26ef71 ("Add recent files to main menu."). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-13Fine tuning of the whitespace / coding style post processingGravatar Dirk Hohndel
The struct / class regex was way too relaxed. Having the parent class on the same line usually looks better. clang-format appears to do something odd with continuation strings - even with UseTab: Always it indents those with four spaces. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-13Add recent files to main menu.Gravatar Boris Barbulovski
Add(up to four) recent files to File main menu. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Add a simplistic tool to clean up whitespaceGravatar Dirk Hohndel
This hasn't been tested enought, but it seems to get really close. It assumes that clang-format is in your patch. Run perl scripys/whitespace.pl FILENAME and you'll get a diff of what it things is wrong with that file. If you like what you see, simply pipe the output into patch -p0 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Use "rint()" instead of rounding manually with "+ 0.5"Gravatar Linus Torvalds
rint() is "round to nearest integer", and does a better job than +0.5 (followed by the implicit truncation inherent in integer casting). We already used 'rint()' for values that could be negative (where +0.5 is actively wrong), let's just make it consistent. Of course, as is usual for the messy C math functions, it depends on the current rounding mode. But the default round-to-nearest is what we want and use, and the functions that explicitly always round to nearest aren't standard enough to worry about. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Fix default value for missing surface pressure from divecomputerGravatar Linus Torvalds
We should *not* default to the incorrect "1 bar". Instead, we should leave the resuling pressure at 0 mbar, which leaves visual entries empty and uses the default surface pressure for calculations. Reported-by: Pedro Neves <nevesdiver@gmail.com> Cc: Patrick Valsecchi <patrick@thus.ch> Cc: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Ensure the correct parent is used in the dialogGravatar Dirk Hohndel
This way the dialog is centered and the main window gets dimmed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Don't redeclare variables of the same nameGravatar Dirk Hohndel
This isn't broken, but it's confusing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Replace mainWindow() with MainWindow::instance()Gravatar Boris Barbulovski
C++ style of accessing single instance class object. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Make the mean depth line follow the size of the axis.Gravatar Tomaz Canabrava
When we move, shrink or expand the depth axis, the meandepth should also change it's position. this patch adds that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Hide the extra axis labels on release mode, show on debug mode.Gravatar Tomaz Canabrava
The extra axis labels on the Temperature and Cylinder Pressure graphs are not wanted in release mode as they create a lot of visual clutter, but they are useful to have in debug mode since we can then better understand what went wrong. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Added cylinder pressure shrinking on show/hide partial pressure.Gravatar Tomaz Canabrava
Same as the last commit, but for cylinder pressure. Another bug was spotted, where the mean depth line does not move to the correct location after a axis-size-changed - fixing that on next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Shrink temperature axis when partial pressures are shown.Gravatar Tomaz Canabrava
This patch adds shrinking of the Temperature axis when partial pressures are shown. This adds an unwanted side effect however, the axis started showing it's values - and we didn't do that on the gtk version or on the old profile. While this is good for debugging, it's not wanted for the software if it's on release mode. I'll fix that in due time. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Animate transition between show / hide partial pressure graphsGravatar Tomaz Canabrava
When the user checked the option to show or hide the partial presure graph the size of the profile graph was kept the same; usually I do those changes on the objects themselves, on the settingsChanged method, but since the calculation of the size of the profile was done on the ProfileView class for consistency with the other objects, I had to change it there too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Correctly track parent of print dialogGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Whitespace and dead code cleanupGravatar Dirk Hohndel
The coding style for switch isn't the prettiest, but let's at least keep things consistent. Also, those ugly break statements never got reached, anyway. And there was no need to re-declare and re-generate currentString. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12More variable scope confusionsGravatar Dirk Hohndel
Don't have nested loops with the same loop variable. Really. Even if it is legal C++. And don't declare local variables more than once. This will only cause issues later. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Make sure the about dialog is correctly centeredGravatar Dirk Hohndel
Otherwise, why pass in the parent to begin with? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Don't shadow object members like thisGravatar Dirk Hohndel
If you need to use this->error to distinguish the local variable from the object membe that should be a hint that maybe you didn't pick the best name for the local variable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Don't reuse a variable name with a different type inside the same functionGravatar Dirk Hohndel
Since the variable was inside of an inner scope this was technically legal, but it's just too annoying for words. (The diff in the commit doesn't make this obvious, but outside the for loop in the same function there is a divedatapoint *dp, so we had a pointer to divedatapoint and a divedatapoint with the same name...) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Don't use current_dive instead of the argument to the functionGravatar Dirk Hohndel
I could have gone either way - the other alternative would have been to remove the argument to the function. But since current_dive is a macro and since the semantic of the function make sense with the argument being passed in, it seemed better to just not use current_dive in the function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Remove external declaration of non-existant global variableGravatar Dirk Hohndel
Just to slightly reduce possible confusion. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Fix variable scope issueGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Fix ATM-vs-bar confusionGravatar Linus Torvalds
SAC should be calculated in relationship to surface pressure, not "1 bar". I also realize that we have a few other cases where we do the same mistake: the partial pressure calculations do things like po2 = o2 / 1000.0 * depth_to_mbar(sample->depth.mm, dive); which is wrong as well - the partial pressure is also relative to standard atmospheric pressures. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Take the on-canvas position into account for DiveCartesianAxis::valueAt()Gravatar Dirk Hohndel
We did this right for posAtValue(), but not for the inverse. Fixes #438 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Update #include statement for QStringListModelGravatar Boris Barbulovski
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Migrate MainTab models(QStringListModel)Gravatar Boris Barbulovski
Migrate MainTab models from static xxxCompletioModel::instance() to private MainTab variable members. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11User manual: small updatesGravatar Willem Ferguson
The section on the main menu descriptions has been changed a little bit to reflect the current menu structure. The section dealing with exprt from other dive software has been changed to appear more user friendly, with three new icons. Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Handle cancel in PreferencesDialog::on_chooseFile_clickedGravatar Patrick Majewski
If I click in the Preferences Dialog on the 3 dots to choose a default file to load and cancel the opening FileDialog an empty string is returned and set to the coresponding QLineEdit. The new behavior (and mostly expected) is to update the QLineEdit only if there is a filename returned from QFileDialog. Signed-off-by: Patrick Majewski <dive@patrick-majewski.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11More renamingGravatar Dirk Hohndel
I don't even know what a partial gas might be... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Give the widget for the new profile a better nameGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11New profile: enable switching between dive computersGravatar Dirk Hohndel
This was mostly in place, just needed to be hooked up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Minor cleanupGravatar Dirk Hohndel
Remove obsolete header and unused variable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Use our macro for FP comparisonsGravatar Dirk Hohndel
I think that catches all the ones we missed (thanks clang -Wfloat-equal). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Fix bug in logic expressionGravatar Dirk Hohndel
Yes, the old code made perfect sense when you read it - except the C++ compiler turned it into something quite different from what was intended. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Clean up include filesGravatar Dirk Hohndel
They should have a newline at the end. Forward declarations of classes should be 'class'. Function / method definitions don't end on a ';' Remove obsolete QStateMachine forward reference. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Don't repopulate the model if the dive didn't changeGravatar Dirk Hohndel
plotDives takes a list of dives (for future use) but currently only looks at the first dive in this list. With that semantic in mind we can save ourselves some work if we first check if this is the same dive we are already showing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Clean up the setDive functionGravatar Dirk Hohndel
* This should never be called with a NULL dive. * The dc variable was set then never used. * We now have a unique id for each dive, but we can't simply not repopulate the model in setDive as the old comment might make you consider, as otherwise the dataModel will reference already freed data in pInfo. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Set up the dive that was passed in as first diveGravatar Dirk Hohndel
We carefully extracted the first dive passed in with the QList, but then always used current_dive. That's silly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Profile2: Prevent another crash if no dives are presentGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Do not add the items to the scene twice.Gravatar Tomaz Canabrava
Those items have parent(), which means that when the parent has a scene, they are automatically added and removed from the scene. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Fixed item visibility on emptyState after being on profileState.Gravatar Tomaz Canabrava
Background was not correctly back to it's original position and a few other items kept their visibility when it shouldn't. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>