aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveeventitem.cpp
AgeCommit message (Collapse)Author
2014-05-05Fix bug in handling of fake SAMPLE_EVENT_PO2 eventsGravatar Dirk Hohndel
In commit bcdd6192fe45 ("Show translated event names in tooltip") I was too aggressive in replacing the checking for event names with checking for event types. It turns out that we are abusing an existing event type in the planner (and use a different event name to mark the difference). By just checking for the type this now caused incorrect information to be displayed in the info box (a simply "PO2 warning" on a Suunto D9 could turn into a "Bailing out to OC" notice). The correct fix is to get our own range of SAMPLE_EVENT_xxx numbers from libdivecomputer. Once we have those, we can do this the right way. For now we just fall back to also checking the event name (which is what I wanted to get away from so translated names don't trip us up). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29Fix test for "air" in tooltip display of gaschangeGravatar Dirk Hohndel
The "is_air()" test works when we have the gases in permille, but not in percent. In that case we can just check for He == 0 and O2 == 21. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29Show translated event names in tooltipGravatar Dirk Hohndel
In order for this to work we need to compare against the event type instead of the event name - which makes much more sense to do, anyway. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-03Edit name option for bookmarksGravatar Yosef Hamza
Add the option to edit the name of a bookmark to be more meaningful for the user they prefer. It works just as simple bookmarks and can be removed and hidden. It won't accept names longer than 22 characters because longer names will display as garbage text. Also changed the code from displaying flag depending on event name to depending on event type. Signed-off-by: Yousef Hamza <jo.adama.93@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-16New profile: fix event hiding logicGravatar Dirk Hohndel
Turns out we unconditionally set all events as visible when redrawing the dive - even with a comment that this should take into account if the event is visible. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15New profile: add event manipulation to context menuGravatar Dirk Hohndel
This got lost when we switched to the new profile. Remove event works. Hide events does call hide() on the DiveEventItem but for some reason it stays visible. I'll hope for one of the more experienced Qt people to fix that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11Support Animation Speed via Settings.Gravatar Tomaz Canabrava
This is very userfull for a ( yet to be implemented ) preference dialog about the animation speed, so the user can enable / disable the animations or make it a bit faster for it's taste. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-25New profile: add event info to tooltipGravatar Dirk Hohndel
This appears to correctly add the tooltip to the event item, but for some reason the tooltip isn't displayed for most events. Still needs more work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-23Don't try to setup event if it is NULLGravatar Dirk Hohndel
This also fixes the whitespace in a function that I instrumented to figure out what's going on. I restored it to its original state, but I couldn't leave the whitespace unfixed... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-22New profile: add image pixmaps for image eventsGravatar Robert C. Helling
For reasons that I don’t understand, the image is only shown if the event happens to be at the same time as a depth sample. This is, however, not specific to these image events, it seems to apply to all events. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Move the events when a partial pressure graph is enabled / disabledGravatar Tomaz Canabrava
The events were static on the canvas even if the profile changed its size because of a toggle of the partial pressure gas. This patch makes events move on the canvas to their correct place. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> 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-01-17Fix compile time warningsGravatar Dirk Hohndel
Plus some small whitespace fixes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-17Transform the DiveProfileItem to an Abstract GeneralizationGravatar Tomaz Canabrava
The DiveProfileItem contained much of the complexity and algorithms for almost all line-based items on the canvas, so I transformed that to a general abstraction and implemented a new DiveProfileItem that uses it. this should reduce a bit of code since the implementation of the PP Graphs, Temperature Cylinder Pressure and maybe a few others will only need to reimplement the paint() and the modelDataChanged() methods. The rest is ready. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-17Added a DiveEventItem that knows how to handle itself.Gravatar Tomaz Canabrava
Simply pass a event to the item and it will know what to do. The sad part is that this isn't true yet - there's quite a bit of boilerplate that a lot of the items are needing, but the good part is that the boolerplate is the same in all of the items, which means that I can create a tiny bit of abstraction to encapsulate it and the code will be way smaller to setup the items on the canvas. Right now the items are being correctly placed on the right places. It doesn't supports hidding / showing yet. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>