aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
AgeCommit message (Collapse)Author
2015-02-10Remove the DiveList from the mainwindow.uiGravatar Tomaz Canabrava
It's now set up from the mainwindow.cpp file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Correctly set up the Planner stateGravatar Tomaz Canabrava
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-10Change splitter names to something more meaningfullGravatar Tomaz Canabrava
listGlobe and infoProfileSplitters weren't good names as now we will be able to create more types of widgets there Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Add the modes for ADD and PLANGravatar Tomaz Canabrava
The Plan mode still misses a widget that was done directly inside the mainwindow. I'll extract it from there and create a proper class in the next commit. 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-10Simplify a bit of codeGravatar Tomaz Canabrava
two #ifdef NO_PRINTING one over the other, merged them together. 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-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-07Add the .apd file extension to be treated as CSV fileGravatar Miika Turkia
Adding support for importing .apd files (APD Log Viewer). They are CSV files and already supported in CSV import, but the file extension .apd is added here. Signed-off-by: Miika Turkia <miika.turkia@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>
2015-01-29Don't reimplement the clear() methodGravatar Dirk Hohndel
Much easier and clearer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27Fix UI issues and warningGravatar Dirk Hohndel
Commit e219bc70f863 ("Refactor dctype -> divemode") introduced a few issues. For one thing it causes a warning about incorrect use of zorder - I don't see why this would be needed here, so I simply removed it. Secondly, it adds a new, automatically named layout element that therefore gets handled by our "consistent margin" code which creates a messy layout for the Dive Notes tab. This patch gives that horizontal layout a useful name and adds it to the list of "zero margin" layouts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-19Don't just change the location when double clicking on the globeGravatar Dirk Hohndel
Instead be consistent with other parts of the code and put us in editing mode so the user can accept / reject the change. See #800 Fixes #801 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-18Clean up the header filesGravatar Dirk Hohndel
Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06Another skeleton: LoadFileContentsGravatar Tomaz Canabrava
Also, do not pass QStringLists by pointer, uneeded. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04The margin between toolbar and profile looked strangeGravatar Dirk Hohndel
Especially on Mac where there is already a lot of padding around the action buttons. Also made the spelling of the zeroMargins variable more consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04Attempt to move the more frequently used toolbar actions to the topGravatar Dirk Hohndel
This is highly dependent on the user, I guess. So I may be totally off here. But the previous order was pretty much random (and even tried to push one button in there twice in a row)... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-04Fix toolbar icon size issueGravatar Dirk Hohndel
Instead of messing with the margin (which didn't work, anyway), we need to set the size of the icons. Apparently on Linux this was implicitly done, but on Mac it didn't scale the icons and provided space for the largest one (and we have a couple that are twice as big as the others). What we really need are scalable icons that allow us to set the icon size relative to the font size. But for now this solves the ugliness on Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-03Layout fine-tuning: remove the outermost margin around the windowGravatar Dirk Hohndel
That added visual distraction on some desktop themes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02Zero out the margins instead of just not changing themGravatar Dirk Hohndel
At least on the Mac some objects appear to have generous default margins. This creates a somewhat less wasteful layout. Still we have those massive margins around the toolbar buttons. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02Layout fine tuning. Exclude a few more layouts.Gravatar Dirk Hohndel
The goal is to have things look as consistent as possible - so if some elements have another nested level of layouts, their margins need to be zero. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02Remove all margins from mainwindow.ui fileGravatar Dirk Hohndel
And adjust them in code instead. This seems to look nice. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02Give more layouts reasonable namesGravatar Dirk Hohndel
This time for the mainwindow. This includes an adjustment in the C++ code where we actually referenced one of those weird generic names. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-02Set up consistent margins in the various layoutsGravatar Dirk Hohndel
The hard coded margins were random and inconsistent and generally ended up with a rather unbalanced look. This was worse on Mac than on other platforms, as there the margins get exaggerated for some reason. This code is a bit of a hack and a bit brute force, but it seems to work to create a much more pleasing appearance. It may need some fine tuning (depending on OS or DE (under Linux)), but it definitely seems like a massive improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01User survey: always wait a weekGravatar Dirk Hohndel
I can't remember why I decided to show the survey immediately if someone was running a development version. Seems silly to me in retrospect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-01Automatic update check with an opt outGravatar Dirk Hohndel
Store the last version used, the next time we can check, and the decision if the user does or does not want these checks in the settings. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30Clear DC information when closing log fileGravatar Miika Turkia
Fixes #799 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30Connect the UserSurvey to its qt-parrentGravatar Anton Lundin
This makes sure the UserSurvey object is removed correctly by the qt object tracking system. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30Remove NO_USERSURVEYGravatar Anton Lundin
Back in 71dbcdc0d625 ("Added the option of opening User Survey form explicitly") a define for not adding the user-survey was created. This is quite unnecessary and this removes that option. Based-on-patch-by: Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com> Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Add .dlf to known extensions (Divesoft)Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> 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-12-09Hide any pictures shown when closing divelogGravatar Dirk Hohndel
Fixes #776 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09Close and clear filters when closing divelogGravatar Dirk Hohndel
Otherwise non-sensical information stays behind. Fixes #777 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25Match agreed captalisation styleGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22Use our own file open dialogGravatar Dirk Hohndel
Clearly the static dialogs don't work. Even with the previous commit the dialog still said "Save" insted of "Open". So let's just assemble our own dialog and be done with it. I hope I got all the options right... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22Don't ask confusing questions in open file dialogGravatar Dirk Hohndel
Using the SaveFile dialog to open a file caused it to ask the user if they wanted to overwrite a file when they actually tried to open an existing file. This fixes that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21Use getSaveFileName() as the file open dialogGravatar Dirk Hohndel
This way we can specify file names that don't exist and therefore make our git syntax (/path/to/dir[branch]) work. Thanks to Tomaz for pointing this out. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20Small changes to Yearly Statistics windowGravatar John Van Ostrand
Added a title bar with close button. Set an appropriate title. Centred the window relative to mainwindow. Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17Clean up yearly statisticsGravatar Dirk Hohndel
Remove the unused upper widget, set a somewhat random but at least more reasonable default size and finally support Ctrl-W and Ctrl-Q shortcuts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-15Consistently have a space between file type and extensionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-14Add .txt as dive log fileGravatar Miika Turkia
Add the .txt to the list of all dive log files as this is the file we expect to be opened for Poseidon Mk6 log files. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13When closing filter dialog via menu / shortcut, also reset themGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13Suits Widget created and working.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13Move the filters code to it's own file.Gravatar Tomaz Canabrava
We already have a bunch of filters, let's pack them together Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10Corrected Liquivision nameGravatar John Van Ostrand
And added a missing liquivision item in file open dialog. Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Cleaned up file list in open and import dialogsGravatar John Van Ostrand
Lists were getting a little jumbled. I sorted the extensions and added suitable human readable names. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Added import for Liquivision LVD log filesGravatar John Van Ostrand
Support includes cylinder pressures and works for v3.0 log files. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04Offer to save to a copy in replan modeGravatar Robert C. Helling
When replannig a dive, offer another button that creates a new dive rather than overwriting the old. This should help in creating several versions of a planned dive (longer/shorter, deeper/shallower etc). Note that this makes dives that start at the same time not influcence each other's deco. Also, only the first of a row of simultaneous dives contributes to the tissue loadings of later dives. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01Capitalisation in file type listGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>