aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-09-10Fix row counting bugGravatar Dirk Hohndel
When updating the weight system model we have to remove the old ones and then correctly count the new ones. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-10Merge branch 'downloaddialog' of github.com:danilocesar/subsurfaceGravatar Dirk Hohndel
2013-09-10Change ws_info and tank_info typesGravatar Dirk Hohndel
This is correct C. But debuggers in C++ mode are broken and can't display the global variables. While I hate having to do this change, I hate not being able to debug my software because of broken tools even more. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-10Fill ws_info structure and use it when entering weight systemsGravatar Dirk Hohndel
The code to initialize the weight systems from the last datafile loaded had not been brought over from the Gtk version. We now correctly update the data structure when loading file (but not yet when editing values). Most likely the same needs to be done for the tanks as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-10improve DownloadDialog's error handlingGravatar Danilo Cesar Lemes de Paula
shows an error message when libdivecomputer returns an error. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-10improve DownloadDialog UI controlGravatar Danilo Cesar Lemes de Paula
* Removes the InterfaceThread which is basically an unecessary proxy between the MainThread and the DownloadThread. * Use a state machine to control the DownloadWidget UI logic. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-09Make the Plus Button on the planner work.Gravatar Tomaz Canabrava
Clicking on the plus button now adds a new stop on the planner. The depth is always 10m and the time is 10 minutes after the last stop. can be changed by double clicking or dragging the balls around the canvas. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Last gas used will be used on new dive planner point.Gravatar Tomaz Canabrava
This patch makes the last gas used on the planner the default. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Merge branch 'moreDivePlanner' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-09-09Signal that the model changed when editing plan specific information.Gravatar Tomaz Canabrava
Signal that the model changed when editing plan specific information, when you changes the ATM pressure or any other information, the graphic of the plan will be generated again to mirror your actual dive. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Plug most of the dive planner - non - model stuff.Gravatar Tomaz Canabrava
Plug most of the dive planner controls that weren't plugged yet - StartTime, ATMPressure, BottomSAC, DecoStopSAC, LowGF and highGF are being used by the calculations now. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Enable the CC SetPoint on the planner, also input bug fix.Gravatar Tomaz Canabrava
Enabled the CC SetPoint settings on the table, changing it will automatically reflect the canvas. Also fixed a bug that prevented the 'Air' handling on the diveplanner table to show the list of options using arrow up and down. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Removed WarningsGravatar Tomaz Canabrava
This patch removes a warning and a function call that shouldn't be there. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Use the same code for command line and gui for file handling.Gravatar Tomaz Canabrava
The Command line execution of Subsurface happened before the GUI was created, this leaded to various bugs by me(tm) over time. This patch seems to fix all of those, by reusing the same code for GUI interaction and CommandLine interaction. I had to rework how the main.c worked, it used to be C code calling C++ code, and this is non desirable, since C doesn't really understand C++. I Moved all of C-related code to 'subsurfacestartup.c/h' and created a tiny wrapper to call it, so all of the C code is still C code, and the new main.cpp calls the mainwindow->loadFiles and mainWindow->importFiles to get rid of the bugs that happened before. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Fix QString UsageGravatar Tomaz Canabrava
Fixes QString Usage. to return a Empty QString, one should return a QString() and not a QString(""), and to check if the string is empty, one should check for string.isEmpty() instead of "string != "" ", because the latter will create a new QString, then call the != operator, less function calls, better code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Code Cleanup, Tabs instead of Spaces.Gravatar Tomaz Canabrava
Just changing a bunch of space-indented block of code to tabs. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-03Fixed a incorrect signal that shouldn't be there.Gravatar Tomaz Canabrava
Fixed a incorrect signal-connection call that should'nt be there anymore because the TableView now correctly knows what to do with models. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-03Missing Files.Gravatar Tomaz Canabrava
This should have been in the last commit - sorry. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-02Code Cleanup: Merged the three TableViews shared codeGravatar Tomaz Canabrava
Merged the shared code for the three table views into one code, this way less code is needed if we need to construct another tableview in the future. I still need to clean some of the models too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-02Added missing CSS file.Gravatar Tomaz Canabrava
Added missing CSS file, this CSS file is used by our tables to set everything on the ui. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-02Fixe: Show the profile and info window on opening.Gravatar Tomaz Canabrava
Fixed showing the profile and info window when opening the program. For some reason ( easy testing of the planner ) the planner was being opened instead of the profile and info window. now everything's back to normal. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Build fixGravatar Dirk Hohndel
I don't quite understand why this was needed - or how this can build for Tomaz without it... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-30Corrected spelling of "weight" in the preferences dialog and codeGravatar Benjamin
"weight" was spelled as "weigth" in a few places in the code, but more importantly, it was misspelled in the preferences dialog. A minor nit-pick, maybe, but it still drew the eye in the dialog and looked weird. Signed-off-by: Benjamin Fogel <benjaminfogel@yahoo.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-30Merge branch 'bugfixes' of github.com:danilocesar/subsurfaceGravatar Dirk Hohndel
Fixed one conflict in qt-ui/diveplanner.cpp - please check I got this right. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-08-30More Code CleanupGravatar Tomaz Canabrava
The code now seems to be mostly working. There is unfortunately a QAction shortcut conflict between the implementation and the MainWindow. - I'm gonna fix that in the next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30More Code Cleanup.Gravatar Tomaz Canabrava
Just a bit of code cleanup so that I don't bloat the software too much. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Fix '+' sign for time on the planer, plus code cleanup.Gravatar Tomaz Canabrava
The plus sign for time was in a very strange position, this puts it back to where it belongs, plus a bit of code cleanup since the planner was in heavily modifications, this will be needed quite a bit. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Make planned points deletion works on the Table too.Gravatar Tomaz Canabrava
Now the planner deletes points by clicking on the trash icon on the table. The dive planner is almost finished. <3 next: add a point from the table. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Moves deletion logic of divepoints to the Model.Gravatar Tomaz Canabrava
Deletes the logic of divepoints to the model, this makes automatic updates on the table on deletions. ( remember, to select dive points, ctrl+click on it. ) if you want to delete it, press 'delete', it will be removed from the graphics part and also from the table. Next: delete point by clicking on the table trash- icon. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Gas choices working, both directions ( Planner and Table )Gravatar Tomaz Canabrava
The gas choice now works and correctly ( I hope ) calculates the gas choosen to show on the planner. User can choose the gas from the list on the visual planner, and also on the table. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Added support for changing Depth and Time on the Table.Gravatar Tomaz Canabrava
Added support for changing depth and time on the table. It now works both ways, one can edit the planner via the table for a fine tuning. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Started the work of Editable Model for the PlannerGravatar Tomaz Canabrava
This commit is the start of the Editable Model work for the planner, it creates a new delegate and shares the code for the model that creates the gas types, so we only need to change in one place to add new gases. The table is already edition-enabled, but the outcome is still undone, next commit - put all together. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Code Cleanup - Remove temporaries.Gravatar Tomaz Canabrava
Just code cleanup, removing temporaries. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Code cleanup - Dead Code.Gravatar Tomaz Canabrava
Just removing an #if 0 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-29fix DownloadDialog behaviorGravatar Danilo Cesar Lemes de Paula
The DownloadDialog behavior was broken in a way it allows the user to make changes on the dialog while the download is happening. Also, clicking on "Cancel" breaks/hangs the UI sometimes, as libdivingcomputer doesn't always cancels the download right away. That's a bug that still needs to be fixed. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-08-28Made the TableViews share a bit of code, code cleanup.Gravatar Tomaz Canabrava
Made the tableviews share a bit of code, and code cleanup. The tableviews for Cylinders, Weigth and Dive Planner Points now shares the CSS and I also implemented the save / load methods for the dive planner points, so the functionality is mostly done on the vieualization side. - since we are now using three tables maybe it's a better idea to create one class SubSurfaceTable that knows how to handle saving / loading of the columns... TODO for the future. ;) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-28Added a 'remove' icon on the dive planner table.Gravatar Tomaz Canabrava
Added a 'remove' icon on the dive planner table, this makes the ui more consistent between the other tables that also manages addition and removal of data. the delete method is still unimplemented. next - css. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Fixed moving a dive point between dive pointsGravatar Tomaz Canabrava
Fixed moving a dive point between dive points. this fixes mostly everything that I have broked by using a Qt Model instead of a linked list - but a model is better to make everything updated and only poke in one place. sharing code++. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Made possible to add a divepoint between two others.Gravatar Tomaz Canabrava
Made possible to add a divepoint between two others, this also implemented the last patch in the correct way. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Fixed entering a dive stop before another dive stop.Gravatar Tomaz Canabrava
Fixed entering a dive stop before another dive stop, the correct way is to fix the position of them but this is easyer - I'll update the correct one in a couple of patches. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Fixed invalid values on the TableViewGravatar Tomaz Canabrava
The values of the dive points on the tableview were too big, I'm now dividing time by 60 and depth by 1000 to get the correct results. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Fixed a bug where moving a handler would mess the plannerGravatar Tomaz Canabrava
Fixed a bug where moving a handler would mess the planner by calculating invalid values to the planner on the model side. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Moved a lot of code to the Model, cleaning the interface.Gravatar Tomaz Canabrava
Moved a lot of code that handled the positioning of the DiveHandles on the interface to the model. there are a few bugs left ( regressions ) that I will fix in the next commits. With this commit an edition of the points on the widget will trigger a repaint of the planner profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Moving Handler on Graphics Updates the Model on the PlannerGravatar Tomaz Canabrava
Moving the handler on the graphics updates the model on the planner Unfortunately, the graphics will move back to it's original position because of the legacy code used to calculate the dive plan. Next: fix the legacy code used to calculate the dive plan. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Moved the creation of the data plan point to the model.Gravatar Tomaz Canabrava
Moved the creation of the data plan point to the model, this way when the user creates a data point on the graphical planner, or when the user creates the point on the QWidget based view, both of them will be updated. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26First implementation of the Shared Model for the PlannerGravatar Tomaz Canabrava
This implementation of the shared model already shares some, but not all data between the two views, but it's already a huge improvement. When the user clicks on the visual planner, it will update the view on the qt-widget based view. The editing of the view is still not allowed, and removing nodes is not allowed too ( yet. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Started the Model to handle the DivePointsGravatar Tomaz Canabrava
Started the model to handle the divepoints between the Qt Widget interface and the QGraphicsView one. good thing is that we share code. Bad is that a model is harder to work, but doable. :) With this finished ( in a couple of commits ) one can insert a point on the Qt widget or on the graphics view and it will be 'mirrored' to both interfaces. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Changed the WindowHint of the planner popup to 'Popup'Gravatar Tomaz Canabrava
Changed the Window Hint of the planner popup to 'Popup' this removes ghost items from the task bar. Hint By: Danilo Cesar Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Code Cleanup: Buttons on Graphical PlannerGravatar Tomaz Canabrava
Removed a bunch of non-used graphics buttons, since the new widget now contains everything needed for the creation / cancelation of the dive plan. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Added a new widget to control the PlannerGravatar Tomaz Canabrava
Added a new widget to control the DivePlanner, now we have two widgets, a graphics one and a qt sidget based one. the Technical divers will most likely use the QtWidget one while the hobbists will most likely use the QGraphicsView one. there's not a option to choose one, they both will appear at the same time. Next step: make the screens to work. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>