aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2013-11-21Add optional support for cns import from csv filesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Add optional support for po2 import from csv filesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Give room for more options in csv dialogGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Make temperature optional in csv importGravatar Anton Lundin
This adds a checkbox to be able to import csv files without temperature. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Rework csvimportdialog to make room for featuresGravatar Anton Lundin
This rewires things a bit to make room for new features coming. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Fix a couple of warningsGravatar Dirk Hohndel
Removing unused variables. 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-21Fix typoGravatar Henrik Brautaset Aronsen
All hail the groub! Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Hack to make tank selection work on MacGravatar Dirk Hohndel
This is an ugly hack as it partially breaks the ability to abort a selection (so if you click outside of the combobox, the last value you hovered over is selected). But this seems much better than not being able to select a different tank at all. Fixes #275 (and by 'Fixes' I mean "hacks to sort of make work"... but the trac automation is rather inflexible in which words it understands...) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Complete add bookmark for the profile context menuGravatar Dirk Hohndel
This (together with the commits fixing the QMessageBox title) should finally close all the issues in bug 250. Fixes #250 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Work around QMessageBox not showing its title on MacGravatar Dirk Hohndel
This is a bit hacky and simply adds the title to the message text when compiling on a Mac, but hopefully this will be enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Quiet down warning about return in non-voidGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Quiet down warning about duplicate nameGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> 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-19Add gas change event from profile context menuGravatar Dirk Hohndel
This allows to add missing gas change events to the currently shown dive computer. Only gases defined in the Equipment section are offered. Fixes: #250 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Use the correct dive to create the gas listGravatar Dirk Hohndel
If we are adding a dive, it's the stagingDive, otherwise it's the current_dive that we need to look at. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Hiding events doesn't change the dive_tableGravatar Dirk Hohndel
So let's not mark it as changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Small whitespace cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Hooked up 'Hide Events'Gravatar Tomaz Canabrava
With this commit one can hide all events of the selected type through a context menu on the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Enable the 'Remove Event' callback.Gravatar Tomaz Canabrava
Based on the code in the Gtk branch. [Dirk Hohndel: whitespace cleanup and changed the message text] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Adds half of the support for the menu on the profile.Gravatar Tomaz Canabrava
This adds the menu, it just doesn't do anything, yet. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Do per cylinder statisticsGravatar Anton Lundin
This shows how much gas form each cylinder was used. I would like to add SAC to that list too but it became a mess trying to calculate average depth per cylinder. Design based on idea in #284 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Better handle the mouse movements on the Add Dive profileGravatar Tomaz Canabrava
Better handle the mouse movements on the add dive profile, when outside of the canvas boundaries. It had bugged me for quite a while, but this is so much better. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Enable gas selection through a context menuGravatar Tomaz Canabrava
This patch re-enables gas selection through in the add dive profile. Good thing ( and I really didn't think of that before ) is that it is less than half of the code of the other implementation. :D Fixes #265 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Fixes positioning the first Gas Label on the add dive profile.Gravatar Tomaz Canabrava
We didn't take into account that last == first when checking for the first item on the list. Now the gas is correctly placed on screen. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Removed obsolete Code ( gaslist on text click )Gravatar Tomaz Canabrava
This commit removes obsolete code, there was a gaslist selection when user clicked on the buttons, but this shouldn't be anymore, since the next commit will add a menu to select the gas for that particular point. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Print bailout on separate row from SP changeGravatar Anton Lundin
It looked kinda weird without a separator between the SP change and the bailout. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Fix trip summary line in dive listGravatar Dirk Hohndel
Two errors fixed. - With no location set, the summary line would start with a ','. - When auto creating a trip for a manually added dive or when editing the dates of dives in a trip, the timestamp for the trip was not updated after editing the dive. Fixes #293 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Clear selected trips after restoring selectionGravatar Dirk Hohndel
The rememberSelection() / restoreSelection() functions ONLY handle selected dives, not selected trips. This is a bit of a misfeature, but because of that we need to make sure we clear our notion of selected trips when we use restoreSelection() Fixes #285 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Hook up MOD in the preferences dialogGravatar Dirk Hohndel
For some reason this was never connected. Oops. Fixes #267 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Sanity check on gas percentagesGravatar Dirk Hohndel
O2 + He + N2 = 100% (well, there are some other gases, but this is close enough) Since N2 can't be negative that means we should refuse any change where O2 + He > 100% (or o2.permille + he.permille > 1000). Fixes #280 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Immediately update the dive flag label when editing location textGravatar Dirk Hohndel
This seems like a much nicer user experience. Editing a location's name is immediately reflected on the globe label, the moment it happens. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Immediately show new locations on globe widgetGravatar Dirk Hohndel
When modifying or adding a dive location on the globe widget while in dive edit or dive add mode, we now show the modified / new location right away on the globe (assuming a location name has been given). This makes it much easier to manually reposition a dive location. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Handle double clicks on globe during dive edit modeGravatar Dirk Hohndel
When we are editing or adding a dive, the globe widget needs to act differently. Instead of directly changing the lat/lon of selected dives, it needs populate the coordinate text field as if this information was entered by the user (effectively all it is is a way to more conveniently enter coordinates). As a side effect, this also allows us to change the location once it has been added (you just need to go into dive edit mode to do so). There is one weird issue that occasionally (and I can't quite reproduce this) I get lat/lon very close to 0/0 (as if the globe widget was centered on 0/0 and not on whatever it is actually showing). That still needs to be addressed. Fixes #239 Fixes #131 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Quick hack to make the dive add icons smallerGravatar Dirk Hohndel
This is about the right size, but the scaling pixelates the icons. So this is not really a fix, just a hack. See #269 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Change the order of the increase / decrease buttons on the planner.Gravatar Tomaz Canabrava
Change the order of the increase / decrease depth button on the planner since 'bottom' means increase depth and 'top' means decrease. Sorry I'm too undiver currently :) See #269 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Do not let the dive have the 0 value.Gravatar Tomaz Canabrava
The number 0 means "this dive has not been numbered". So manually assigning this seems wrong. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Make it posible to renumber dives.Gravatar Tomaz Canabrava
If the user doubleclicks on the number of the dive in the dive list, this will present to him a dialog to change that number. Pressing enter will renumber the dive if there's no dive with the same number already. Fixes #288 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Anchor bottom of the dive ruler editor ro items on the DivePlannerGravatar Tomaz Canabrava
This patch is a crude attempt to 'anchor' the bottom of the Dive ruler editor ( the new graphics ) to the bottom of the scene. since QGraphicsView doesn't have a good way to modify the origin point of an item, I'v just shifted all other items up a bit, this way the 0,0 point is in the bottom of the drawing and I can safely move it around, making it bottom-anchorable. :D Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Just some code cleanup.Gravatar Tomaz Canabrava
This flag is added to all items on the parent, so there's no need to implement this on all of them. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Fix various issues with the dive add / edit manual dive codeGravatar Dirk Hohndel
- get_gas_from_events does NOT always set o2/he. It only updates them IFF a matching event is found; so we need to make sure we start out with a valid gas mix - the way we tried to restore the edited dive in case of an edit to a manually added that is cancelled was completely bogus. Way too complex when we can simply and reliably simply store the dive and then copy it back Fixes #270 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Don't add spurious 5m/15ft node at 10 minutes when canceling editGravatar Dirk Hohndel
When cancelling the edit of a manually added dive, we should send the sample with timestamp 0 to addStop - that's a magic value and causes us to add a node at 5m/15ft and 10 minutes instead. Since the dive always starts at the surface, calling addStop is redundant, anyway, so let's just not do that. See #270 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Improve shift time functionalityGravatar Dirk Hohndel
In commit 85fab31c71fc ("Shift times of selected dives") we added a dialog that didn't align its content very well. This change improves the layout (I hope) and makes the labels in the layout clearer (earlier and later seem easier to correlate with the direction of the shift). The original commit also forgets to deal with the consequences of shifting the dives. The dive list needs to be re-sorted (as the relative order of dives could have changed) and be marked as changed. And we should try to maintain the selection across these operations. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Shift times of selected divesGravatar Robert Helling
This patch adds the possibility to shift the times of all selected dives by a fixed amount to correct for time zone problems or mis-set dive computer clocks. Select the dives and right click in the dive list. [Dirk Hohndel: added .ui file to FORMS and fixed some whitespace damage] Signed-off-by: Robert C. Helling <helling@atdotde.de> 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-17Removed the ugly icons on the visual profile editorGravatar Tomaz Canabrava
Removed the ugly icons on the visual profile editor and replaced them with the much better looking ones that Luisa designed. This was not a simple search and replace since Luisa's design was a bit more sophisticated. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-17Add "add dive(s) to trip above" featureGravatar Dirk Hohndel
This honors the sort order of the dive list when figuring which trip is "above". It works both on a single dive or all selected dives. This also fixes a couple other cases where the dive list selection and trip display could get messed up. Fixes #287 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>