aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.h
AgeCommit message (Collapse)Author
2015-08-18Replace global in_planner variable by helper functionGravatar Robert C. Helling
as promised earlier Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Transform GlobeGPS in a static instance() classGravatar Tomaz Canabrava
This is needed to start easing the transition from the completely wrong and bogus MainWindow::instance()->globe() calls. this is still wrong, but with it I removed one level of indirection. I did that now because I wanted to not taint the location management when I use it to deal with the globe. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25Re-enable the dive site editGravatar Tomaz Canabrava
Since now we found the perfect way to deal with dive site handling on the dive, we can reenable this widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: remove a ton of code from the LocationManagementGravatar Tomaz Canabrava
The way I was doing the old location management was very dull: everything was tangled on the mainwindow. Now I think I've found the correct way to create this, and thus, this code can die. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Set up signalling to display notes in planner again.Gravatar Robert C. Helling
This got broken in a recent transition to more abstract models. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Remove all the no longer necessary code that aborts read of first V2 fileGravatar Dirk Hohndel
This was a poorly implemented hack when we executed the reverse geo lookup in the main thread and opening a V2 file could take a very long time. We need to do the "Welcome" message quite differently. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Code cleanup: implement window title update via signalGravatar Dirk Hohndel
This seems quite convoluted to me but I can't seem to make a more straight forward implementation work. The idea is that core code should never directly call into the UI. So instead the core code (this is C code) calls a helper function. That helper function calls a member function of a class which in return emits a signal. The UI code connects to that signal and acts accordingly when it is received. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Cloud storage: only offer cloud storage related options when verifiedGravatar Dirk Hohndel
If we don't have verified cloud credentials disable the menu options and disallow the use of cloud storage as default data file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: better window titleGravatar Dirk Hohndel
This makes it clear that we are working with the cloud storage and removes the (in that case, redundant) branch name from the title. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Indicate that there are unsaved changes with a '*' in the window titleGravatar Dirk Hohndel
This seems to be a fairly common way to indicate this property. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-03Different states for edit / add dive siteGravatar Tomaz Canabrava
When we start the dive site edit dialog, either for add or for edit, we don't save the state, so the reject state didn't know what to do with the dive site. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-01Manage Dive Site from the MainMenuGravatar Tomaz Canabrava
Trigger the ManageDiveSite from the MainMenu. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31Cloud storage: first stab at implementing cloud storageGravatar Dirk Hohndel
So far there is no mechanism to actually create a repository on the server, so this only works with the two test repositories. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>