summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.h
AgeCommit message (Collapse)Author
2015-05-17Move Locationinformation to its own file.Gravatar Tomaz Canabrava
The SimpleWidgets file was getting too big, and location information will also need a new model - a good way to do not mix everything is to put things in a new file. [Dirk Hohndel: added missing include of stdint.h] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-30Manual added dives edit button is missingGravatar Gehad elrobey
once the manual added dive is added it can't be edited directly, This can be fixed by adding an edit button to the log menu, this will be consistent with the plan/replan buttons. Fixes #847 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Change the references to ShowError to the new notification object.Gravatar Gehad elrobey
Showing an Error message is better called from the Notification Object, So for consistency old references to showError is replaced by calling the notification object. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Creating a Notification widget in the Main Window.Gravatar Gehad elrobey
The main error message bar can be used to show exporting information and other notification. So a new Notification handler object is created in the main window <NotificationWidget> that inherits <KMessageWidget> that shows different type of notifications, ex. (Warning, Error and information) Also this class contains a QFutureWatcher object that is set to handle the QFuture variable returned from the exporting thread. this will allow the UI to be updated when the thread finishes execution. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27UI to learn hashes of local image filesGravatar Robert C. Helling
This addes a menu entry for the user to select a directory that is recursively traversed to look for image files and compute the hashes of those images (for those images to be available to be displayed in dives according to their hash values). This traversal and hash computation happens in and independend thread and so far the only feedback to the user is that upon completion the dispayed images are updated. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-25Display slowness warning before opening a V2 fileGravatar Dirk Hohndel
This is somewhat invasive as aborting the XML file read requires us to report things up the recursive parsing chain. What we really need to do here is to ask the user how they want to use the data from reverse geo lookup. But for now we only warn about the fact that this can take a while. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Correctly connect the maintab to dive site managementGravatar Dirk Hohndel
We now have a working uuid - use it. And populate the fields accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Pass a fake dive site UUID to the callback.Gravatar Tomaz Canabrava
This is the start of the preparations to edit the dive site, passing a uuid so we can retrieve it later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Accept / Cancel location editGravatar Tomaz Canabrava
Make it possible to cancel or accept the location edit and get back to the mainwindow default state. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Enable the location edit widget on mainwindowGravatar Tomaz Canabrava
Clicking on the 'Manage' button now brings you to the widget to manage it. Nothing has been added on it yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Create a new state for the MainWindow: EditDiveSiteGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Add undo stackGravatar Grace Karanja
Add an instance of QUndoStack in the mainwindow, and add undo/redo actions in the edit menu. The QUndoStack will have a collection of QUndoCommands to process the undo and redo events. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Reverse undo bufferGravatar Grace Karanja
Reverse all the code using the UndoBuffer class so that we can use the QUndoStack and QUndoCommand classes. These are Qt's own inbuild undo framework classes, offering a better undo/redo process. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove unused enumsGravatar Tomaz Canabrava
Thuis is garbage from the old code. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Change the order of the quadrantsGravatar Dirk Hohndel
At least to me it seems more natural to enumerate them row by row instead of column by column, so now we do 1 2 instead of 1 3 3 4 2 4 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Rename the widget to better reflect what it doesGravatar Dirk Hohndel
This widget defines what's in each quadrant of the main window. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Don't set the state if it's the sameGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Finish the cleanup of mainwindow.uiGravatar Tomaz Canabrava
This is the last patch in the series of clearing up the mainwindo.ui. Now to bugfixing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Move the Profile out of the mainwindow.uiGravatar Tomaz Canabrava
And place it in mainwindow.cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the ProfileWidget from mainwindow.uiGravatar Tomaz Canabrava
It is now in mainwindo.cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the PlannerWidget from mainwindow.uiGravatar Tomaz Canabrava
Now it uses the states on the mainwindow.cpp and it's finally starting to be worth the hassle of reworking the UI. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Create the method that changes the state of the applicationGravatar Tomaz Canabrava
Not used yet. The idea is to call 'setApplicationState("plan");' and all widgegts for plan will be magically setup because we added the plan state with registerApplicationState. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Add the first call to registerApplicationStateGravatar Tomaz Canabrava
This will be used to set the 'default' state. The other two possible states right now are plan and add; those will be created right next. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Implement the registerApplicationState functionGravatar Tomaz Canabrava
This function registers the different widget layouts that we will have in subsurface. Currently we have three layouts (default, plan, add) and a few more are comming (for instance location) and the code is scattered around. It was making me unconfortable. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Add a new struct that will hold the widgets for each cornerGravatar Tomaz Canabrava
The combination of the map / struct will change based on the state of the application. Currently a lot of different widgets change what is shown on the main window, and it's very messy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-09Add menu entries for undo/redoGravatar Grace Karanja
Add an edit menu with undo and redo submenus, and connect them to the UndoBuffer class. The submenus are only enabled when needed. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-03Disable dive component copy/paste shortcuts when no profile showGravatar Dirk Hohndel
Instead of inventing another way to do this (and inevitably forgetting a path where this should be re-enabled) I renamed the DcShortcup related function and made them enable/disable the copy and paste shortcuts as well. Of course there now is one exception (isn't there always?): in "ADD" state we don't want to be able to switch DCs, but we do want to be able to paste. Fixes #825 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17Added the option of opening User Survey form explicitlyGravatar nikhil
Earlier, there was no option for the user to explicitly open the User Survey form. This has been corrected by placing an option in the "Help" menu by which the user can explicity open the User Survey form. Signed-off-by: Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-26Support for importing Poseidon MK6 logsGravatar Miika Turkia
This patch adds support for importing the logs from a Poseidon MK6 rebreather. This DC produces logs that contain of a .txt file that has all the meta data and a .csv file that contains the sample readings. The CSV file is different from the others in that it has a line per each sample reading at given time. Thus we have to merge all the lines from one point in time into one sample reading of ours. [Dirk Hohndel: addressed some compiler warnings] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19Tissue saturation plot a la Sherwater PretelGravatar Robert C. Helling
This adds a toolbox icon to turn on a tissue plot inspired by the bar graph of the Sherwater Petrel, It shows the inert gas partial pressures for individual compartments. If they are below the ambient pressure (grey line) they are shown in units of the ambient pressure, if they are above, the excess is shown as a percentage of the allowed overpressure for plain Buehlmann. So it has the same units as a gradient factor. Thus also the a gradient factor line (for the current depth) is shown. The different tissues get different colors, greener for the faster ones and bluer for the slower ones. Positioning and on/off icon action still need some tender loving care. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Random whitespace updateGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Trigger the log->filter by tag to open the tag filter.Gravatar Tomaz Canabrava
You can't really close it for now. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25Remove a lot of non-necessary boilerplate code.Gravatar Tomaz Canabrava
We used to have a very sad way of controlling the statistics, now we will create the model when there's a need for it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-23A much better Toolbar for the profile.Gravatar Tomaz Canabrava
Using QToolBar I was able to remove much of the dead code from the mainwindow.ui xml file by transforming the QToolButtons into actions and loading them dynamically in the .cpp code. I couldn't use the designer for this ( as I wanted ) because Qt has no notion of ToolBars outside of the areas where the MainWindow should have one, and we use it in a very different area. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19Add ability to replan a dive that we planned beforeGravatar Dirk Hohndel
When doing this, all waypoints of the calculated ascent are now waypoints in the plan - so the user has to remove the ascent part of the dive in order to really replan the dive. That's a pain, but we don't keep the data around that would tell us which waypoints are user input and which ones were calculated. Fixes #527 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18Merge branch 'joshua-gsoc' of git://github.com/thiagomacieira/subsurface ↵Gravatar Dirk Hohndel
into josh Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Conflicts: subsurface.pro
2014-08-16Cut'n'paste for dive data: implement copy sideGravatar Dirk Hohndel
Admittedly not very useful without working paste, but it's progress. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15TankBar: hook into prefs and make ppGraphs resize accordinglyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-09Create Dive Computer configuration dialogGravatar Joseph W. Joshua
Create a dialog for reading and writing settings to and from dive computers, with a menu entry in MainWindow to open the dialog. I will build up on this dialog and change it as needed. Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com> Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-04Disable the Toolbox when in edit mode.Gravatar Tomaz Canabrava
Some of the toolbox icons will trigger a recalculation of the dive, triggering then a replot, that will copy the dive to the displayed_dive again, but in the case of a edit this would discard the edition ( that would still be shown on the UI ) leaving the dive in an unconsistent state. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14Remove unused menu "Filter"Gravatar Anton Lundin
The filter menu wasn't connected to anything other than a debug print. This removes that menu. Signed-off-by: Anton Lundin <glance@acc.umu.se> 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-04UI restructure: simplify setup of add and plan modeGravatar Dirk Hohndel
Recreate the helper function (which now does something fairly different) to share the common code between the two modes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: use displayed_dive for add dive and plan diveGravatar Dirk Hohndel
This gets rid of the stagingDive and stops the constant adding and removing of dives from the divelist (that was an INSANE design, seriously). When adding or planning a dive all work is now done in the dedicated displayed_dive. Add dive mostly works - when the user clicks save the dive is added to the dive list and selected. Plan dive is mostly untested. It passed trivial "start planner, save" testing so it's not entirely broken, but I'm sure there's more work to be done there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Fixed SearchBar layout and iconsGravatar Tomaz Canabrava
This is almost a rewrite of the Search function on the WebView the old code had a few uneeded things, mostly being a subclass of QMainWindow instead of the QWebView - this makes the code use a tiny bit less ram. The SearchBox was also moved to an own class ( we can use it later to filter the contents of the DiveList for instance ) and a forced use of the pixmaps for the Mac and Windows platform was added. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-13Start a user survey dialogGravatar Dirk Hohndel
The idea is that a week after the user starts using Subsurface we ask them if they would like to submit a survey response. If you are running a development build, don't wait seven days. This patch doesn't do anything with the user's selections, doesn't submit anything to our server, etc. It's just a placeholder to tune what we should ask, etc. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-08Simplify the code that checks if it's OK to close the current fileGravatar Dirk Hohndel
And make sure it gets called whenever it needs to get called - it was missing from the openRecentFile case. Fixes #530 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04Force TTS/NDL calculation off if things take too longGravatar Dirk Hohndel
This is kind of a random cut off, but if plotting the dive takes more than a second and TTS/NDL is on, we force it off. Because the algorithm for that is fundamentally quadratic in nature it can take a VERY long time - getting users to think something is broken. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add print button to plannerGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Make the new picture widget display the pictures.Gravatar Tomaz Canabrava
Small changes in the model to display the pictures of the dives. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>