aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
AgeCommit message (Collapse)Author
2014-08-07Move the Trash bin to the topRight on the picturesGravatar Tomaz Canabrava
It was too easy to remove a picture by mistake, not anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Delete pictures from the Widget by pressing deleteGravatar Tomaz Canabrava
Select the picture, press delete, profit. [Dirk Hohndel: removed the stray hunk that snuck into this patch] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Show the cross hair only when planning or adding a diveGravatar Dirk Hohndel
In normal profile mode it's rather redundant and clatters the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Remove unused static functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Fix order of initialization warningGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Don't zoom the profile when the left button is pressedGravatar Robert C. Helling
This prevents zooming out to more than max in the planner. Using a Mac MagicMouse it happens at times that the finger slides on the mouse while dragging a waypoint which can result in zooming out further than max. Fixes #695 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Make the cross hair less obnoxious on MacGravatar Dirk Hohndel
While on Linux it was drawn as fine 1px line, on Mac it came out rather fat and obnoxious by default. With this it's always set to a very thin line. This still needs more work, but let's leave it where it is for Beta 5. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Add lines that follow the mouse helping see time and depth.Gravatar Tomaz Canabrava
This was missing from the conversion from the oldPlanner to the new one, and it also works ok on the profile. One thing is missing is the Labels on the bottom / left saying which position it is, but it's already userful. Fixes #674 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Picture handling: cleaning up the messGravatar Dirk Hohndel
We had pointers to data structures on the stack which we frequently reallocated. These data structure contain basically a filename and an offset. We then create a hash of the pointers to those datastructures with the filename being the key. And then we passed those pointers around through a Qt model(!!!) only in order to then later look up by filename what the offset might be. I am at a loss for words for the lunacy behind this design. How about we just remember the offsets and pass the integers around? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Picture handling: hide the pictures before deletingGravatar Dirk Hohndel
Because of the way deleteLater() is implemented, the pictures need to be hidden, otherwise they might stay around at the wrong time (e.g., when printing). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Profile: Don't disconnect too many signalsGravatar Dirk Hohndel
If we disconnect the picture releated signals then in dive add and dive plan mode the pictures from the last shown dive could appear on the profile. That's not cool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Planner: show mean depthGravatar Dirk Hohndel
Almost invisible, mostly looking like an odd bug in the profile code, there was a tiny red line at depth 0 in the planned profile. Turns out that was the missing mean depth. We didn't populate enough data in the dive computer of the dive we generated from the plan (and the length of the depth line was incorrectly determined by the duration of the dive instead of the duration stored in the dive computer). Fixes #570 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Add a new 'show' Animation, and use it on the close button.Gravatar Tomaz Canabrava
The error with 'ungrabMouse' warning that we got was because we were removing an item that had the mouse grab instead of waiting a few milisseconds so it won't be the mouse grabber anymore. So I'v used the Animations::hide() to get rid of it, and since it worked well, I'v also added a Animations::show() method to display it in a good fade-in way. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Implement the functionality of remove_picture.Gravatar Tomaz Canabrava
Added the remove_picture functionality, with code shamelessy stolen from remove_event, and hoock it up with the interface. Fixes #650 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Instead of holding the index, hold the URL.Gravatar Tomaz Canabrava
Since the idea is to remove the picture in the future, we need to not hold the row on the model, as when we delete one, the other pictures will change the row. but the QUrl is unique. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Added a button to hide a picture from the dive.Gravatar Tomaz Canabrava
This patch hides a picture from the dive, it should actually remove it, but because I didn't found a quick way to remove a picture from the dive yet, it just hides it. To remove a picture from the dive, the DivePictureItem has to remember the QUrl of the original file, to remove that from the model, and currently it only has the QPixmap. this can be for 4.2.1 or we can postpone 4.2 a tiny bit since this is a important feature. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Planner / Add dive: hide handler after removing itGravatar Dirk Hohndel
Otherwise users can still interact with it. Fixes #648 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Do not show the heartrate info unconditionally.Gravatar Tomaz Canabrava
use the preferences instead. Fixes #664 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Make the Axis set the changed flag when a new line is setGravatar Tomaz Canabrava
This was preventing the recalculation of the ticks, making the line static when we enabled or disabled the PP graphs. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Change the Ruler text values when metric system changes.Gravatar Tomaz Canabrava
"ups", as I did this in Metric system I forgot to update to imperial when the user selected it. Fixes #665 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Another string to translateGravatar Sergey Starosek
[Dirk Hohndel: took only one of the two parts and adjusted commit message accordingly] Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Code cleanup: HeartRate item was doing insane thingsGravatar Tomaz Canabrava
This simplifies so much of the code that we were using to control the visibility of the HeartRate. now things are much saner. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Animation speed is a value, not a booleanGravatar Tomaz Canabrava
This breaks compatibility with old preferences, but it's a single key and not that very important so I don't think it's a bigger issue I've renamed prefs.animation to prefs.animation_speed to denote that it's a value, and not a state. Also, fixed the places that were treating it as a state (on/off) to treat it like a correct value. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Don't plot pictures in Print modeGravatar Tomaz Canabrava
The pictures were being plotted in print mode, the main reason for this was that when we entered print mode and had already a picture plotted, the method would return before removing them from the screen. This fixes it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Set visibility in a saner wayGravatar Tomaz Canabrava
for some reason we did a if(true) setValue(true) else serValue(false) now we just use the value to set the value. =p Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Break really long line.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-18Save / Restore the QPainter before operations.Gravatar Tomaz Canabrava
I don't know if this fixes anything, but it is asked of us to do that by the Qt docs. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-18Correct usage of current_dive to displayed_diveGravatar Anton Lundin
current_dive is the selected dive, and displayed_dive is the one we are currently drawing. They are quite often the same one, but not in the case of adding a dive for example. This fixes potential null pointer dereferences in the case of a blank divelist, and makes sure we use the correct data in the case of adding and planning dives. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-17Hide gachange events in the first 30 secondsGravatar Anton Lundin
Back in 4.0 we hide all gaschange events during the first 30 seconds, not just gaschange events on second 0. Eg, the OSTC3 emits its gaschange event on the first sample, which can be 2, 10 or 30 seconds into the dive. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-17Use get_cylinder_index instead of get_gasidxGravatar Anton Lundin
Replace get_gasmix_from_event and get_gasidx with get_cylinder_index. get_cylinder_index actually knows about both types of gaschange events and the difference between them. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-17Add missing struct keyword in DivePlotDataModelGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-17Use plot_data cylinderindex instead of event dataGravatar Anton Lundin
For the info box, we can't use the event data, because its not 1:1 mapped to whats in the cylinder and what we actually switched to. Use the plot_data here we already calculated what we are switching to. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Do not create a backup for Q_FOREACH containerGravatar Tomaz Canabrava
Q_FOREACH will expand and already creates a copy of the contained container, so this is just a waste of cpu cycles and also increases a tiny bit the memory consumption. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14Shrink YAxis when heart rate is on displayGravatar Lakshman Anumolu
This patch makes sure that YAxis is not expanded to cover heart rate when it is displayed on profile panel. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14profile2: remove unused varable diveComputerGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Rename event: correctly replace event with new oneGravatar Dirk Hohndel
I don't like that the event structure includes the variable length array. That really makes it a pain to change the name of an event (on the flip side, freeing events is easier I guess). Anyway, to correctly rename an event we need to actually remove the event from the correct dc and then add a new event with the new name. The previous code was insane (it only worked if the new name was of smaller or equal length, otherwise it had a beautiful buffer overflow). And of course we need to do this both for the current_dive and the displayed_dive. Fixes #616 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12Fix inserting gaschange eventsGravatar Miika Turkia
Use a macro that works to get the current DC. Fixes #613 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Mark divelist changed when adding bookmarkGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Code cleanup: removed bogus animation functionsGravatar Tomaz Canabrava
All animations are now on the Animations namespace, which resulted in a bit of code cleanup, which is nice. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Correctly disable all animationsGravatar Tomaz Canabrava
This seems to be needed for the correct print of the profile, What was happening on the print code was that the profile even in print mode was doing animations, and we were getting a frame of it and trying to print it. Also, a bit of code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11profile capitalisationGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Planner: add event that explains when planner turns redGravatar Dirk Hohndel
I don't know why the plot_info was walked backwards - for our purposes walking forward needs to make a lot more sense. And the event nicely goes away when the diveplan gets modified and the displayed_dive gets reset. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Planner: fix calculation when it is safe to surfaceGravatar Dirk Hohndel
We were comparing with a negative depth which apparently confused the algorithm. Fixes #611 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10Show/Hide pictures working.Gravatar Tomaz Canabrava
This code hoocks the pictures with the preferences change. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10Added the toggle picture button and hoocked it upGravatar Tomaz Canabrava
This patch adds the toggle picture button and hoocks it up with the rest of the code. I'v also changed a call from ProfileWidget because it caused errors on the ui generated code, where it would try to call an still-to-be instantiated object. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10Use different gas change iconsGravatar roberto forini
[Dirk Hohndel: scaled PNG files and added the code to show them and to make them somewhat bigger] Signed-off-by: roberto forini <forini.r@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Printing: scale fonts when printingGravatar Dirk Hohndel
This seem to work better, but it misses a couple of items at times (for example the highest label on some of the axis). Needs lots more testing. See #590 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Printing: force redrawing of the profileGravatar Dirk Hohndel
If the first dive we end up rendering is the dive currently shown, the info overlay would end up being printed which looks really silly. See #590 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-08replot() needs to really force a replotGravatar Dirk Hohndel
So let's set forceReplot to true to make sure that happens. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: don't use random dives from the divelist for dataGravatar Dirk Hohndel
Everything should come from the displayed_dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>