aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
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>
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>
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>
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>
2013-05-03Small changes to the selection logicGravatar Dirk Hohndel
Now it correctly uses the existing helper functions and keeps our idea of the selection consistent. There is a small behavioral change compared to the Gtk code. Range selections no longer have the last dive clicked on as selected_dive but instead the dive with the highest index that was selected. I don't think that is a major issue for anyone. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03Added code to select / desselect a range of itemsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-03Make Ctrl-q work as QuitGravatar Dirk Hohndel
It's annoying to always have to close the window with the mouse. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03Select the first diveGravatar Dirk Hohndel
This works regardless whether the first dive is in a trip or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03Temporarily expand all dives so the automatic width calculation worksGravatar Dirk Hohndel
Suggested-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03Reformat dive info page in tab widgetGravatar Amit Chaudhuri
Clean up the formatting. Distinguish between headings and value labels. Tidy up text appearance (remove trailing ':') Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03Remove the majority of the Gtk related codeGravatar Dirk Hohndel
- rip all Gtk code from qt-gui.cpp - don't compile Gtk specific files - don't link against Gtk libraries - don't compile modules we don't use at all (yet) - use #if USE_GTK_UI on the remaining files to disable Gtk related parts - disable the non-functional Cochran support while I'm at it Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Don't hard-code column width.Gravatar Dirk Hohndel
Auto-detect on first start and keep in settings afterwards. So if the user resizes them, Subsurface remembers the correct sizes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Merge branch 'tomaz-css' into QtGravatar Dirk Hohndel
Tomaz' code does a much better job of shading the dive list! Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Added code to Select a dive, fixed minor annoyances.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Test the CSS for styling the TableViewGravatar Tomaz Canabrava
This is a test and I shouldn't be taken seriously. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Alternate background colors for dive listGravatar Dirk Hohndel
This was written with massive hand-holding by Tomaz - actually, this was mostly proposed via IRC by Tomaz and then implemented by me... Right now because of the list-of-lists nature of the model we have the small issue that every trip starts with a dark background dive, even if the trip itself has a dark background. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Set better column widths in the dive listGravatar Dirk Hohndel
This code seems rather crude to me. I'm sure this could be done better. This also makes the column alignment work again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Show cylinder and gas used in the Qt dive listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02Show trip date (with number of dives) in dive/trip listGravatar Dirk Hohndel
That was easy :-) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Minor style updatesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Merge branch 'Qt' into RenderStarsOnTableGravatar Tomaz Canabrava
2013-05-01Added Support for the Trips and Dives on the DiveList model.Gravatar Tomaz Canabrava
Now the list and dives will work in the same way that the GTK version does. The code got changed heavly because the old one was just looking at the dives and didn't worked like a tree. small adaptations on the list view and model delegates because of the changes done on this model. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-01Fix a couple of small problems in add weightsystemGravatar Dirk Hohndel
The constructor letf the currentWeightsytem variable uninitialized. Instead of creating the memory leak by malloc-ing the newWeightsystem in the on_addWeight_clicked() function use a local variable instead and pass its address around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Create Add Weightsystem dialogGravatar Dirk Hohndel
My first attempt to create a Qt dialog and to hook it up with the program. Unsurprisingly this doesn't quite work as expected (i.e., the values I enter aren't populated in the model), but it's a start... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Don't add cylinders and weightsystems past the MAXGravatar Dirk Hohndel
We actually should disable the 'Add' button, I guess. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Hook up adding a weightsystemGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Add data and add functions for WeightModelGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-01Use the existing current_dive macro in Qt codeGravatar Dirk Hohndel
Replicating this with the currentDive member seems to make no sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-28Merge branch 'RenderStarsOnTable' of ↵Gravatar Dirk Hohndel
https://github.com/tcanabrava/subsurface into Qt
2013-04-28Save and retore splitter dimensions.Gravatar Amit Chaudhuri
Rename splitters and remove seemingly redundant empty splitter. Use save/restoreState to save splitter sizes using QSettings. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-28Fixed loading the stars when opening with file as argv. minor cleanupGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-27Merge branch 'RenderStarsOnTable' of ↵Gravatar Dirk Hohndel
https://github.com/tcanabrava/subsurface into Qt