aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
AgeCommit message (Collapse)Author
2014-01-15Add-main-window-full-screen-featureGravatar Boris Barbulovski
This patch enables main window full screen mode by menu toggle or pressing F11. [Dirk Hohndel: whitespace cleanup] Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-11Don't show tanks that aren't used during a diveGravatar Dirk Hohndel
Some dive computers will always download all tanks that they store, not just the ones used in a dive. Most people only want to see the tanks that they actually used during the dive (and for the others there's an option to go back to the old behavior, just in case). All this is only in memory / during runtime. If the dive computer provided the extra data we will not throw it away. Fixes #373 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-11Fix app icon and title for yearly statisticsGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-10Switch to new UserManual implementationGravatar Sergey Starosek
This enables search within user manual by pressing Ctrl-F. Esc key closes search panel. Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-08Show import dialog only when needed for CSV configGravatar Miika Turkia
We do not need any import dialog when importing normal XML based divelogs. With this they are imported directly after file selection dialog. However, when CSV files are detected in the import list, the configuration dialog is displayed and applied for them. (CSV files are detected by file extension.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-03Refactoring import to DiveLogImportDialogGravatar Miika Turkia
Changing the import stuff to DiveLogImport. Now we should have one import function/dialog for importing divelogs instead of multiple menu entries. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-28Update tank model with custom tanks used in XML filesGravatar Dirk Hohndel
Fixes #377 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20Use QFile::{encode,decode}Name for file namesGravatar Thiago Macieira
And make them use UTF-8 on Windows instead of the local 8 bit encoding. This will also get us the proper NFD encoding on OS X. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-19Files: prefer toUtf8() over toLocal8Bit()Gravatar Lubomir I. Ivanov
We may want to use toUtf8() for win32 considerations. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-18Make default font setting actually workGravatar Tomaz Canabrava
We were asking the widget.font() which returned the font that the QFontSelector uses to display it's contents, instead of using currentFont() that's the correctly selected font. duh. :)) Fixes #368 Fixes #375 (for #375 the solution is to select a different font that a) looks better and b) has the missing characters) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-17Don't enter edit profile mode when already editing the diveGravatar Dirk Hohndel
This is not the ideal solution. Ideally we might want to simply enter the profile edit mode if we edit a dive that was manually added. But right now the code contains lots of assumptions about being in one mode or the other and as we are redoing the profile / planner classes for 4.1 anyway, I'd rather err on the safe side for 4.0.1 Fixes #374 (well, it fixes the second bug reported in 374 which is quite different from the original bug) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-16Don't quit while dive is editedGravatar Dirk Hohndel
If the user edits a dive and then quits we try to ask them to finish editing, first. If the user did this by either clicking the little 'x' in the window decoration or by hitting Alt-F4 (or similar), we didn't have that question (only the 'save changes' question in case the dive list had already been modified. Fixes #374 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Implement a settingsChanged in DivePlannerWidgetGravatar Anton Lundin
This is so we can default to the GF's from the preferences. We need the bail handler in createTemporaryPlan, because its triggered when we change GF's, and if we don't have a stagingDive there, we will access a NULL-pointer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07Add support to edit a planned diveGravatar Anton Lundin
Left to do is to remove all the auto-added deco-points, aka the ones that had entered==FALSE before we created a dive from the plan. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07redraw profile (actually clean it) if no dive is selectedGravatar Martin Gysel
otherwise the previous selected dive is still visible in the profile view. clicking on edit crashs subsurface: null pointer dereference in editCurrentDive as it uses 'current_dive' which is null. Signed-off-by: Martin Gysel <me@bearsh.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06Add icon and title for User Manual windowGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-05MainWindow: fix setTitle() callsGravatar Lubomir I. Ivanov
setTitle() works with an enum that can be fed different values, and other we may have eventually. For example not only "app title", or "app title: filename", but others, like dates, certain app status and so on. Patch fixes an issue where deleting a single dive in the divelist resets the title to "Subsurface" only. clearUpEmpty() should only call setTitle(MWTF_DEFAULT) if no file is currently open. It also adds a safe-guard to revert back to MWTF_DEFAULT if no file is open but setTitle is called with MWTF_FILENAME. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-05Open external links in default browserGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04Merge branch 'improve-subsurfaceweb' of ↵Gravatar Dirk Hohndel
git://github.com/thiagomacieira/subsurface
2013-12-03Attempt to fix the 'click goes to 0,0' thing on the globe.Gravatar Tomaz Canabrava
This patch attempts to fix the 'click goes to 0,0' bug on the globe. it moves a bit of code around and I particulary don't like the way that we are dealing with 'EditMode', I think I'll refactor that for 4.1. We are alredy dealing with a bunch of states, maybe a State Machine will help on removing code-complexity. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03Implement the network part of the support for divelogs.deGravatar Thiago Macieira
This implements support for: * uploading a zip file containing dives - untested (the zip file must have been prepared elsewhere) * downloading the dive list and the dive XML files The networking part is finished, but it's missing the actual import of the XML files sent by divelogs.de. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03More strings to be translatedGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02MainWindow: store the window maximized stateGravatar Lubomir I. Ivanov
We add the "maximized" entry for the settings group "MainWindow", and store it on close, so that the window state is the same on the next run. But then also, we only store the window size and resize to that size if not maximized. This attempts to preserve a "restored" window size. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-26Changing the preferences should update the Add Dive interfaceGravatar Tomaz Canabrava
Since all internal units are in mm we needed to only update what's shown on the interface. Fixes #299 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-26Remember Trip Selection.Gravatar Tomaz Canabrava
This patch remembers the trip selection across the Dive Tree Model. It's a tiny bit big because we used to have a variable 'selected trips' that's now calculed dynamically - this is more future proof. This is a start of Un-cluttering the view ( for 4.1 I hope to reduce the code in this class to nearly a half. ) Fixes #303 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-23Create a text entry for default cylinder in preferencesGravatar Dirk Hohndel
We don't do anything with this just yet. And frankly, a drop down of the cylinders that we know of would be even better. But hey, it's a start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-22Save button on menu calls InfoWidget saveGravatar Taiane Ramos
When editing a dive and clicking save button on menu bar, it saved dive information but didn't mark dive as not being edited anymore. For closing file, user should always click on the save button on the bottom of the page and then saving it. Now when clicking save button on menu bar, it will call the accept_changes before saving to disk. Signed-off-by: exhora <exhora.tat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-22Show user-hidden widget when choosing Show AllGravatar Tomaz Canabrava
A user could have hiddden and lost any of the four panels on the interface. Now when he chooses 'show all', if a part of the interface is hidden, it will be shown again. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Added a configuration option to have gf_low apply at max depth instead of at ↵Gravatar Patrick Valsecchi
deepest ceiling. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Refactoring of the configuration handling.Gravatar Patrick Valsecchi
Before, when clicking the OK button on the preferences GUI, we were updating in-memory preferences from the GUI, saving them to the configuration file from the GUI, reloading from the file to the in-memory preferences. Then, to add to the ducplication, when the application was exiting, some fields were saved again. Basically the first step and the last step were useless appart from the fact the the other steps where missing a few fields here and there. This patch removes the first step and fixes the missing fields. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> ACKed-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Trigger redraw of the Dive Info pane on preferences changeGravatar Dirk Hohndel
If we change the units we need to redraw the info on this pane. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Collect per tank SAC rateGravatar Dirk Hohndel
This is a bit painful, but we basically walk the samples and pick the valid tank from the events. And then we do a simple discrete integration to figure out the mean depth per tank and duration per tank. And then we assemble all that into per tank statistics. Strangely the value calculated here seems slightly higher than one would expect from the overall SAC rate. This inconsistency should be investigated a bit further, but my guess it it's based on the assumption that the DC provided mean depth is possibly more accurate than what we can calculate from the profile. Fixes #284 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-17Make edit / dive add in progress check more consistentGravatar Dirk Hohndel
We need to check for this whenever we do something that directly or indirectly closes the data file. Previously we were missing the straight "quit". Also, we should consistently check for both editing or dive addition. And lastly, we should use consistent language with commit 0e9cd0944284 ("Make editing message consistent with button labels"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-17Fix a couple of problems with dive mergingGravatar Dirk Hohndel
- Dive list no longer has messed up trip entries - Dive list is now correctly marked as modified after trips are merged - When data file is closed, the list of selected trips is cleared which avoids a potential crash when loading a new data file Fixes #286 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-17Add more file types to import/default log file dialogGravatar Henrik Brautaset Aronsen
- Allow ssrf as a default log file suffix. - Allow sde/dld/db as import log suffices (we don't use the LIBZIP and SQLITE3 ifdefs anymore) Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-16Small code cleanup.Gravatar Tomaz Canabrava
This was bugging me for a while. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Don't close the active file or start "add dive" while editing a diveGravatar Dirk Hohndel
Seems rather obvious to me - the language in the warning doesn't sound very smooth, though. Fixes #246 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Forget old filename on starting a new log.Gravatar Robert C. Helling
Fixes #253. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Avoid std::string: QByteArray is enough and already compiled inGravatar Thiago Macieira
No need to add more code to Subsurface by bringing in std::string too. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15More code cleanup.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Good deal of code Cleanup.Gravatar Tomaz Canabrava
Rewrite of the way we handle the last used directory for the loading / saving of files. we didn't reuse anything for the code, and that's error prone and also dumb =p. Reworked that so we have a nice method to help us out on that. lastUsedDir and updateLastUsedDir Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Make the info box look as it did in 3.1Gravatar Anton Lundin
In the Gtk version there were no option to disable the showing of time in the mouse over, so this removes that option to limit the amount of clutter in the settings panel. This also renames the time and temperature to match the names they used to have. T -> @, Temp -> T Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Code Cleanup - Removed unused var.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Fix some random compiler warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Maintain the selection when aborting "dive add"Gravatar Dirk Hohndel
We remember what was selected before and restore it. Maybe there's a more "Qt way" of doing this, but my implementation appears to work :-) Also remove unconditional debug output that snuck into an earlier commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Switch to the Dive Notes tab when manually adding a diveGravatar Dirk Hohndel
This gives a more consistent and expected user experience. Fixes #236 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Fix loading the information of splitter sizes on empty config.Gravatar Tomaz Canabrava
We previously did did bad things when running with an empty configuration. This attemps to clean it. We will now correctly handle the splitters in almost all cases ( if I didn't break anything on the way. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Introduce an on/off switch for calculating ndl/ttsGravatar Anton Lundin
Let the user choose if the calculation of ndl and tts is worth the time it takes. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Make gas selection for add dive workGravatar Dirk Hohndel
This now offers the correct gases for which we have cylinders defined. For both the planner and add dive we still don't end up with the correct cylinders in the resulting dive. But that's for another commit to fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Handle add dive cancel correctlyGravatar Dirk Hohndel
This should leave the program in a consistent state after add dive was cancelled (and do the right thing in case the dive list was empty). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>