summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2014-01-17Remove duplicate method callGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Get rid of build warningsGravatar Dirk Hohndel
This is just to make it more obvious when new issues get introduced. The build should always be free of warnings... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Fix compile error when not building with CONFIG+=debugGravatar Dirk Hohndel
There are still some warnings left, but at least it compiles now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Fix some memory leaks.Gravatar Boris Barbulovski
Memory leaks were caused by broken parent/child relations. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Whitespace and coding style updatesGravatar Dirk Hohndel
Another futile attempt to cleanup the code and make coding style and whitespace consistent. I tried to add a file that describes the key points of our coding style. I have no illusions that this will help the least bit... This commit should ONLY change whitespace Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Show old profile when starting SubsurfaceGravatar Dirk Hohndel
Tomaz code had us start on the depth model tab (when built in debug mode). It seems to make much more sense to still show the fully featured profile by default. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Reworked the calculate_max_limits and plotted the dive.Gravatar Tomaz Canabrava
Created a new version of calculate_max_limits that doesn't have a graphics_context and returns a plot_info. The code is basically the same as the old calculate_max_limits, so there's not much to talk about. The rest of the code is just boilerplate to plug the Profile code with the axis and model stuff, to be plotted on screen. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added debug code to help understand the ProfileGravatar Tomaz Canabrava
This commit adds a QTableView if built in debug mode. This is very userful to understand the Profile that will be drawn by the graphics classes and fix the possible errors. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Importantly, I had forgotten to start the state machineGravatar Tomaz Canabrava
The state machine needs to be started before it works; now the animations are working. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added names to the states, so it's easier to debug.Gravatar Tomaz Canabrava
There's a Qt visual debug / helper tool made by KDAB named GammaRay that uses QObject instrospection to understand what's happening on a QProject. This tool uses the Object Name to display the items on a list, so I've added the QState's names to their objects, which greatly helps debugging with Gamma Ray the states of the StateMachine. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a Context menu so we can test the state switching.Gravatar Tomaz Canabrava
The context menu added here should only be temporary, it's an easy and simple way to test the transitions of the items on screen. They seem a bit broken atm, I'll try to fix that. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added the Animations for the transitions of the States.Gravatar Tomaz Canabrava
This code creates the animations that will be triggered when an state changes. Things like hiding items and such should be handled this way. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Aparrently there's no need for a showEvent here.Gravatar Tomaz Canabrava
Just removed some code that I tougth to use, but it looks like it's just a waste of lines. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Fix the size of the scene on screen and Background improvements.Gravatar Tomaz Canabrava
It seems that I forgot to add the background pixmap, but this is being done right now by luisa. This patch fixes the size of the scene by scaling everything to the size of the viewport as soon as a resize is done, and it also fixes the size of the - to be included - background pixmap. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added all the state transitions for each state.Gravatar Tomaz Canabrava
This code adds all state transitions for the items on screen; they do not animate yet, but already move to the correct location (the location seems wrong on the screen, because I'v not correctly zoomed out the canvas yet). Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added Constants to the code, to ease the setup of the transitions.Gravatar Tomaz Canabrava
Those constants will be used later on to setup all transitions of the Graphics Items on the canvas. They are the correct positions of each item inside and outside of the scene, in a way that the state machine can animate them smootly. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Started the work on the States for the Profile.Gravatar Tomaz Canabrava
This is a start of the work on the States for the Profile. All setup is done, all connections are done. Maybe there's something missing because I never worked with QStateMachine before, but it seems to work correctly. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added the flag to ignore item transformations on the background.Gravatar Tomaz Canabrava
The background should be a Pixmap and thus it cannot zoom in or out; this keeps it the same size always, the full height of the scene. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Setup the default icon sizes and locations.Gravatar Tomaz Canabrava
Setup the default item sizes and locations inside of the QGraphicsScene. Also added every item to the scene so that it's correctly displayed on screen. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Initializing the new Profile Class.Gravatar Tomaz Canabrava
Beginning of the code for the constructor, just constructing some of the items and preparing for the State Machine to come. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Create a Time Axis that knows how to plot the minutes.Gravatar Tomaz Canabrava
Created a Time Axis based on the CartesianAxis that knows how to plot the minutes. This is needed because the CartesianAxis donesn't knows about minutes at all, and would plot the seconds instead. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a 'Depth' Axis that knows how to add its strings on screen.Gravatar Tomaz Canabrava
The CartesianAxis used a simple method to put things on screen which is wrong for almost any case besides the 'current value here' since we store things in milimeters on the axis, we need to convert those to meters before showing on the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Pass the current selected dive to the new Profile Widget.Gravatar Tomaz Canabrava
This call just passes the selected dive to the new profile widget. No drawing is performed, I still have to setup the constructors and the rest of the initialization of the new Profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added the DiveProfileItem that uses the DiveProfileModel to diplay data.Gravatar Tomaz Canabrava
I've used the paint() method on it ( even if it's not necessary on a QGraphicsView ) to reduce absurdely the number of items that are inserted on the QGraphicsScene ( each small line of the profile should be an item if it was not for this, it's like that on the old profile. ) and thus reducing the memory consumption, speed and so on. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a Model that should handle the Dive ProfileGravatar Tomaz Canabrava
This model encapsulates the plot_info struct and provides a consistent way to show it using the Qt Model view system in the C++ and QML way. For a QGraphicsItem that should show a Profile, this is the start. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added the remaining of the ticks to their correct position.Gravatar Tomaz Canabrava
When we prepare the axis to show something on the Profile we need to add the remaining ticks to show on screen, Since this method tries to animately move / remove things before calling this. This has no animations yet - will have in the future. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Moves the remaining ticks of the Axis to their correct position on update.Gravatar Tomaz Canabrava
If the size of the Axis changed, this should move them smootly to their place. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Remove only the Uneeded Ticks / Labels when a update is requested.Gravatar Tomaz Canabrava
This patch makes the updateTicks method not remove / readd everything when it's triggered, but to only remove the ticks / labels that are no longer needed on the current display. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Cartesian Axis, based on the Ruler class on the Dive Planner.Gravatar Tomaz Canabrava
This is the same class as the Ruler, but uses the DiveLineItem and DiveTextItem classes created to make it animateable. The next few commits will work on that part. The Ruler was a very bad name for a class that's actually an Axis, that's why I depreceated the later. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a new Namespace to deal with Animations and related functions.Gravatar Tomaz Canabrava
Since the animation methods are fairly the same for any QGraphicsItem, I created a new namespace named 'Animations' that should handle all of the specific Animation Functions there, and the programmer has to call those functions from the objects. Good thing is that this reduces boilerplate code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Add a class based on QGraphicsSimpleTextItem that handles animations.Gravatar Tomaz Canabrava
This commit adds a class based on QGraphicsSimpleTextItem that handls animations via animatedHide() animatedMoveTo() and a few other QPropertyes. This is to be used in conjunction with the DiveLineItem added in the past commit on the Coordinate Axis. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a class based on QGraphicsLineItem that can be animated.Gravatar Tomaz Canabrava
This class has animatedHide, animatedMoveTo and QProperty animations. it's very userful for the future creation of the Cartesian Axis that will have the ticks 'flowing' around when it's needed. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a QGraphicsPixmapItem subclass that handles Animations.Gravatar Tomaz Canabrava
This class is useful for adding / removing icons on the future profile in a way that they are smoothly added to / removed from the canvas. It uses the QProperty System to deal with animations. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a new class based on QGraphicsRectItem that can be animated.Gravatar Tomaz Canabrava
This class extends the QGraphicsRectItem with the ability to use the Qt Property System - and thus, we can animate the properties. Initially I put only the rectangle, the position and the x and y positions indidually for testing. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Add the skeleton for the New Profile System.Gravatar Tomaz Canabrava
The idea of this widget is to display and edit the profile. It has: 1 - ToolTip / Legend item, displays every information of the current mouse position on it, plus the legend for the maps. 2 - ToolBox, displays the QActions that are used to do special stuff on the profile ( like activating the plugins. ) 3 - Cartesian Axis for depth ( y ) 4 - Cartesian Axis for Gases ( y ) 5 - Cartesian Axis for Time ( x ) It needs to be dynamic, things should *flow* on it, not just appear / disappear. It's the last attempt to create a QGraphicsView based Profile System, as the next will most probably be written in QML. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Enter dive edit mode on buddy field focusGravatar Sergey Starosek
Seems it's related to bug #390. Not sure whether this fix is correct. See #390 Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Emit textChanged() signal on completion selectionGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Extend tags model to Buddy fieldGravatar Sergey Starosek
This doesn't change storage format. Instead it parses buddy strings and converts them to string list which is supplied to tags widget. This feature was requested in ticket #311 Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Populate buddy completion model using CSVGravatar Sergey Starosek
While preparing to extend tags model to 'Buddy' field we populate completion list by splittng those fields by comma. Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Fix "hide unused cylinder" behaviorGravatar Dirk Hohndel
There are at least two scenarios where our old code was flat out wrong. If you manually add a cylinder (because you may want to switch to it in the profile), then at least until the next time you restart Subsurface this cylinder should be shown. Also, when you switch to a cylinder by adding a gas switch event on the profile, that change should then make that cylinder visible. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15In Qt5 reset() is depricated.Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Don't downgrade tags to AsciiGravatar Anton Lundin
Use Utf8 everywhere, and toAscii is depricated in Qt5 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Convert to TRUE/FALSE to stdbools true/falseGravatar Anton Lundin
I had problems with this one on Qt5. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Resync included header with upstreamGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15QAbstractItemModel::reset doesn't exist in Qt5Gravatar Anton Lundin
Let the library resolve this one instead. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Make this code Qt5 compatibleGravatar Anton Lundin
The method have bin renamed in Qt5. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Make the include Qt5 compatibleGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Use setSectionResizeMode if we use Qt5Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Remove unused importGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Port this code to work with Qt5Gravatar Anton Lundin
This code had parts that where Qt5-compatible, this introduces the last bits that it needs to be completely compatible. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>