summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2013-05-09The Zoom is working just like the GTK Version.Gravatar Tomaz Canabrava
This code enables Zoom in / Out with the Wheel, and it also enables panning by moving the mouse around. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Removed unused code that I'm sure it's safe to delete.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Use a Default pen to make the configuration easier.Gravatar Tomaz Canabrava
Created a default pen that has 'cosmetic' enabled, A cosmetic line doesn't change it's width no matter what zoom level we apply. Also , changed everything that used a line to have that as default pen instead. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plot the vertical ruler on the left of the profile.Gravatar Tomaz Canabrava
Plot the numbers on the left of the profile. It seems that everythign is being plotted - But I can see that there are coordinate-errors on the code. ( the GTK one plots some curves below of the dive, but the Qt one is overlapping - probably the way that I'm using the gc information) Need to investigate a bit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09Plot pp TextGravatar Tomaz Canabrava
This patch plots the PP text, but when I plotted I realized that the gc.pi.mapp is being calculated wrong, probably something went wrong on the calculations - it's comming zered always. So, only one line & text is plotted. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plotting deco text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09Plotting cylinder pressure text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plotting depth text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plotting temperature text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Shows the correct color for the CylinderPressureGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Horizontally align labels on info widget page.Gravatar Amit Chaudhuri
Left aligning text values looked wrong. Use Qobject cast to filter labels from any other qobjects around and set alignment. Doing this via Qt Designer would be tedious. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09Remove 2 keyboard short cuts.Gravatar Amit Chaudhuri
Ctrl-C & Shift-Ctrl-C were used for next & prev DC which was considered to be poor style. Disable for now. Maybe replace with something else? Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09Plot of the Cylinder Pressure over time.Gravatar Tomaz Canabrava
a few code was moved around, a macro that contained the form of x ? : y; had to be rewritten to x ? x : y since c++ doesn't allow ternarys without the middle operator. The color-choosing for the Cylinder Pressure broke on the Qt port - but it's a small issue. I'm painting everyone as 'dark green' now, will fix that later. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Add bounding box to profileGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Show the dive computer name in the profile windowGravatar Dirk Hohndel
And clean up some obsolete Gtk related stuff that is no longer relevant for the Qt port. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Add tooltip data and cleanup size calculationsGravatar Dirk Hohndel
Tomaz' code had a fixed height per tooltip item and some rather suspicious logic how to position them (and how to size the surrounding box), based on a fixed height in pixels per item - which of course fails if you use larger fonts or multi line items. This uses the bounding rects to correctly calculate the sizes and populates the tooltip with the other dive data that we already had in a helper function. This also fixes a small formatting issue for gas change events. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Stop passing around gc and piGravatar Dirk Hohndel
Make the graphics_context part of the ProfileGraphicsView and remember that the plot info is already a part of the graphics_context (we kept passing around both of them in the Gtk code... pointless but a leftover from before adding the pi to the gc...) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Fix moving the ToolTip box with the mouse.Gravatar Tomaz Canabrava
When I changed the way that the tooltip box behaved, I accidentaly 'ate' the mouseMoveEvent, it was being used only to show tooltips instead of everything that it should have. this simple patch fixes it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Plot the temperature GraphGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Make tooltips worksGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Work on the tooltips - WIP.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Better design for the ToolTip Handler.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Fix crash on right click dive tripGravatar Amit Chaudhuri
A null pointer dereference occured after right click on a dive trip because updateDiveInfo was called with dive == -1 causing get_dive(int) to return null. Wrap to avoid crash and clear dive info widget text labels. [Dirk Hohndel: this is different from the fix I had committed earlier; I decided to combine the ideas, clean this one up a bit more and this is the result] Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Avoid potential crash if no dive is selectedGravatar Dirk Hohndel
I missed to spots where we would unconditionally dereference the dive pointer. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Reported-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07Added a bit of documentation on how to use the ToolTips & removed 2 bad-api ↵Gravatar Dirk Hohndel
methods Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07Adds real support for ToolTips.Gravatar Dirk Hohndel
This patch changes the Event drawing so it can display tooltips. It is now the responsibility of the item to show / hide a tooltip. A bit of code-refactoring got on here too because I was using only QGraphicsItem calls and I wanted to use a hover in / hover out event to show / hide the tooltip. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07Added the first overlay of the tooltips, with some test data.Gravatar Tomaz Canabrava
The tooltips now can: 1 - be moved around the canvas 2 - dynamically expand / retreat when a new tooltip is added. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Enable the code that was #if 0'ed outGravatar Thiago Macieira
Linking error is fixed. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Start populating the maintab Dive Info widgetGravatar Dirk Hohndel
Establish some useful helpers and use them when updating the values. One of the helpers (from statistics.c) puzzlingly doesn't link - so that's ifdefed out. Also had to re-arrange the settings reading code (it came too late) and to extract the expanding code of the top dive from the settings reading code (as it had no business being there to begin with). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Finish the plotting of the eventsGravatar Tomaz Canabrava
Beautification of the triangles done, Tooltips are also displaying Some rework on the code - don't know if dirk will accept, I'v changed an if-else-if-else by a ternary operator, since it improves legibility a little bit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Plotting the Events doneGravatar Tomaz Canabrava
There are subtle differences, the Cairo version looks prettier - but that's fixable. I did a small triangle and a exclamation mark on it. maybe a gradient would make a good difference there. this item has a ItemIgnoresTransformation tag, so scalling, rotating or zooming will not change it's size. The tooltips are not yet ported. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Make the text ignores transformations on the sceneGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-06Port the plot text method to Qt, also test it by actually plotting somethingGravatar Tomaz Canabrava
The plot_text function from the cairo-methods are now ported on the qt version. this patch moves around some code since quite defines are already used and I didn't want to reinvent the whell. Original code used varargs, but I prefered to change it , so now it receives just a reference to a QString object and the string must be constructed before sending, using the .arg methods. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Fill Dive Notes widgetGravatar Dirk Hohndel
Make sure we clear things out if no dive is selected. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Added the code to populate the tabs when a dive is selected.Gravatar Tomaz Canabrava
So, this is what happens now: Every tab should be populated from updateDiveInfo method, it will be called whenever a new dive is selected I'm already populating the 'notes' box to show how it can be done. If you are unsure what's the name of anything, open the file maintab.ui on the designer, click on the item and check its objectName, the access is ui->objectName from here on. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Add various keyboard shortcuts.Gravatar Amit Chaudhuri
Add shortcuts to match GTK version for view menu items and the log menu so that e.g. Ctrl+1 selects the list view. Remove debug statements from the view functions. Leave in place for functions with no obvious actions yet coded. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Reformat statistics tab in MainTab tab widgetGravatar Amit Chaudhuri
Rename various labels and text into clear pairs and reflect changes into .cpp file. To avoid clashes with names on other tabs use '..All..' to emphasise that this page deals with an aggregate across the selected dives. Re-format the statistics tab. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-05Add most settings to the QSettings codeGravatar Dirk Hohndel
This is missing the char * based settings (as I have no idea how to do those) plus the map provider. Everything else should work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-05Fixed some bad drawingsGravatar Tomaz Canabrava
Removed the lines of the graphs that doesn't supposed to have lines. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-05Enabled some Render Hints for AntialiasingGravatar Tomaz Canabrava
Enabled some Render Hints for Antialiasing and smooth transformations. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-05Merge branch 'PlotsV2' of https://github.com/tcanabrava/subsurface into QtGravatar Dirk Hohndel
Minor conflicts based on my cleanup of Tomaz' earlier commits. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-05Finished the port of the plot_profile code.Gravatar Tomaz Canabrava
There are a few regressions, mostly because the text is not being plotted yet and the background of some of the curves are not being applied. This is because QGrapdien is based on the coordinates of the items that I wanna paint, but I'v setted a QGradient that's global and doesn't take this into consideration. all curves are being plotted. in Small resolutions they plot bad. but it's just a matter of redrawing in the correct resolution. the Line widths are being hardcoded now, on the cairo version they weren't, this will need a bit of porting too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-04Added the code to plot the actual Graph.Gravatar Tomaz Canabrava
This version already plots the dive-graph, with the gradient and all that jazz. One thing that will be easily spotted is that the size of the line is very thick - easily changed, I'm just using the default. As soon as everything is plotted correctly I'll fix the lines. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-04Plot of the Mean DephGravatar Tomaz Canabrava
The mean depth now is plotted correctly. I wanted to do more stuff on this commit, but since it required that a few things on profile.c got moved to profile.h, commited to not have a huge blob for review. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-04Start plotting something.Gravatar Tomaz Canabrava
The first plotting method was removed from profile.c to profilegraphics.cpp and some conversion ( almost 1 to 1 ) was made so that the code could work. Since the code is big - this commit has just a part of it working - it plots the grid. but already works for testing the resizing of the window and Zooming ( unimplemented ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-04Moved the plot from the cairo version to the Qt versionGravatar Tomaz Canabrava
Started working on the Qt version of the Plot, initially nothing is printed - but this is not a bad thing, the program doesn't explodes too. :) some work had to be done about the 'bool/gboolean' stuff so I removed all gbooleans in the code that I'v encountered. A new file was created ( profile.h ) so I could put the signatures of helper methods that cairo used to call. till now the code computes the max limits. Next patch the first drawing will be made. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-04Converted the Colors.h code to QtGravatar Tomaz Canabrava
The colors on colors.h were done to fill a special struct by Subsurface - I removed that structure and replaced the code that generated the map of colors to a QMap. I know that this changes are not very 'welcomed', but C++ has issues on creating & initializing complex static members, this was the best way that I could think of. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-04Started the code for the Profile PlottingGravatar Tomaz Canabrava
This small patch adds a new class - ProfileGraphicsView it's a QGraphicsView based class that will holds all graphics-items for the plotting. The setup is simple, just call ui->ListView->plot( dive ) ( that's already a ProfileGraphicsView and magic will happen. Since Im using a QGraphicsView , the size of the canvas doesn't matter and I'm fixing it at 0,0,100,100. when a resize is done, the resizeEvent will be called, fitting the scene's rectangle on the view. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-04Added the code to plot the actual Graph.Gravatar Tomaz Canabrava
This version already plots the dive-graph, with the gradient and all that jazz. One thing that will be easily spotted is that the size of the line is very thick - easily changed, I'm just using the default. As soon as everything is plotted correctly I'll fix the lines. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-04Plot of the Mean DephGravatar Tomaz Canabrava
The mean depth now is plotted correctly. I wanted to do more stuff on this commit, but since it required that a few things on profile.c got moved to profile.h, commited to not have a huge blob for review. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>