aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
AgeCommit message (Collapse)Author
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-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-11Fix variable scope issueGravatar Dirk Hohndel
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-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-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>
2014-02-10Clear the data when the model resets.Gravatar Tomaz Canabrava
This patch does a few things: 1 - reset the model when user closes the dive file 2 - connects the 'rowsAboutToBeRemoved' in a way that the graphics can remove their polygons too 3 - adds a 'clear' virtual method so items that don't follow the rules can clean themseves up. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Improve sanity check for DivePlotDataModel::data()Gravatar Boris Barbulovski
Adds DivePlotDataModel row upper-boundary check (isValid method already checks for negative values). Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10memory leak fix(that I created in some previous commits).Gravatar Boris Barbulovski
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Profile2: Prevent a crash if no dives are presentGravatar Lubomir I. Ivanov
But in general we should not show the profile of a dive that was recently removed from the list - e.g. via File->Close. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-10Use 'struct membuffer' for profile info string generationGravatar Linus Torvalds
The profile info was generated using nasty string concatenation that the membuffers are much better at anyway. And membuffers don't need those arbitrarily sized fixed buffers (500 bytes? Why 500 bytes?). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09ProfileWidget2 class improvementsGravatar Boris Barbulovski
* Reorder ProfileWidget2 class constructor initialize list. * Initialize(lazy) ProfileWidget2::plotInfo structure. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09ToolTipItem class improvementsGravatar Boris Barbulovski
* Initialize every ToolTipItem variable member in initialize list. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09DiveTextItem improvementsGravatar Boris Barbulovski
* Add colorIndex to initialize list. * Reorder initialize to correct order. Note: colorIndex initialize value is set too SAC_DEFAULT. I do not know what is the rigth value since this variable member is not used anywhere. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09diveprofileitem.cpp improvementsGravatar Boris Barbulovski
* Initialize/construct all variable members in constructor list. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09DivePlotDataModel improvementsGravatar Boris Barbulovski
* Add missing improvements::diveId variable member to the initialize list. * Cleanup DivePlotDataModel::pInfo structure instead only one member. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09Initialize variable members in DiveCartesianAxis class.Gravatar Boris Barbulovski
* Initialize variable members in DiveCartesianAxis class. Note: Initialized values I put needs to be doublechecked. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Fix placement of notification area and dive computer name.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Fix the rest of item visibilities and a few alignment fixes.Gravatar Tomaz Canabrava
Every item is now back on the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Re-enable more items on the new profile.Gravatar Tomaz Canabrava
Temperature and DC Label. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Partial pressures and cylinder pressure back on profile.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Remove code that was unused.Gravatar Tomaz Canabrava
Ancient code that was unused and only adding complexity to the DiveCartesianAxis. Also remove the spacing between the text and the lines of the Axis. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Show the profile again.Gravatar Tomaz Canabrava
This patch re-enables a few items on the profile, most notably, the profile itself. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Fix time and half of depth lines.Gravatar Tomaz Canabrava
Comment out most of the items on the profile since they are currently completely broken ( positioning, etc ). Also, remove the settingsChanged stuff from the DepthAxis because it doesn't have the shrinked / expanded size on it ( it sits on the profile code ) so I'll most probably move that to the profile settingsChanged in the future - or if anyone knows of a better place to have this, I'm all ears. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Start the profile stateGravatar Tomaz Canabrava
The setup of the item positions for the profile state should be done here. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Fix the 'Empty' profile state that was broken for ages.Gravatar Tomaz Canabrava
Show a nice poster that Luisa did for Subsurface ( we have a few other options that I'm waiting her to send. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Start to make things sane again...Gravatar Tomaz Canabrava
Change the 'namespace ItemPos' declared on the commit before this one to a struct that will have all the 'on canvas' and 'off canvas' positions and representations of all items, so we know where to change. Also remove the remaining stuff from planer that was going to exist on this profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Remove duplicated additemGravatar Tomaz Canabrava
This addItem was being called twice, and a warning that the item was already in the scene was annoying me. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Break everything to make it correct next time.Gravatar Tomaz Canabrava
This commit breaks the whole new profile. <3 The problem with the old code is that I was using the QStateMachine and I just got tired of it. I will implement a much-simpler state machine to do what I want instead of hitting my head on the wall to understand how that was supposed to work. This commit also adds a few helper methods to simplify the understanding of the constructor and tries to make the logic a bit better. No graphics are being show right now. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08Huge code cleanup.Gravatar Tomaz Canabrava
This patch starts the cleanup that will take a few iterations to finish. The current profile code uses QStateMachine, and it's much too verbose for something we can do with less than a third of its lines of code. I also added on the beginning of the redesign of the profile code for planner, edit and a few other things that are going to be ported to the new profile in the future, but not currently - I just lack the time to make that work for the next release. This commit basically: - moves all 'new' calls to the initializer-list - create a new 'setupItem' private method to concentrate the calls that any item will do Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Process events just after starting the StateMachineGravatar Tomaz Canabrava
This is needed because of a braindead issue on the Qt event loop: http://stackoverflow.com/questions/10059721/qt-qstatemachine-sync-problems-initial-state-not-set-on-started-signali For the "event 1" to be received, the machine must already be in a state that react to that signal. Even it was a queued connection, the slot would be queued but only after the signal was received, which it isn't since there is no connection yet at that point. To solve your problem, you can wait for the machine is in "state A" before emitting the signal: machine->start(); qApp->processEvents(); Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Remove a lot of unused code.Gravatar Tomaz Canabrava
This will probably be added back in the future, but for now they have no use and it was making me nauseaus. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>