summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2013-11-15Manually add trips from dive list context menuGravatar Dirk Hohndel
We had all the logic, we were just lacking the UI. Fixes #243 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Fix potential crash when merging tripsGravatar Dirk Hohndel
strdup doesn't like to be passed a NULL pointer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Fix planner / add dive handling of DiveHandler PointsGravatar Tomaz Canabrava
Dirk, is this really necessary or it's just something that you forgot to remove? this is adding a bit of pain to fix some issues on the planner, so I'm commenting this out untill you have a bit of time to look at it. It looks like this was added to handle the gas in the pos-1, but you reverted if so, this completely reverts it, and things works as expected again. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Adds the first DiveNode at 5meters / 10minutes when clicking on plusGravatar Tomaz Canabrava
Adds the first DiveNode at 5m / 10 minutes when clicking on the plus button on the DiveNotes Table. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Fix adding DivePoints on the planner via the table.Gravatar Tomaz Canabrava
Somewhere we broke this, most probably in the code that activated the planner to be used together as an 'add dive'. This commit makes the code workable again. There's one thing, though. if the model is empty, this will add something in the first point - it's behaving strangely. I'll try to fix this in a way that's invisible to the user, but overall, why are we inserting something in the first(0,0) time and depth? Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Use the correct font for the Air Types Model.Gravatar Tomaz Canabrava
The air types model had a font bigger than the other models, this patch creates a data() method that correctly delivers the correct font. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Correctly handle changes on the CylinderModel to update the AirModel.Gravatar Tomaz Canabrava
What happened before was that the AirTypes model was only being updated when the user requested to change the air by clicking directly on the Air, in the planner ( but not on the Air Table. ). This fixes it by calling 'repopulate' whenever the cylinder model changes ( by adding, removing and changing something.) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Close the Air list when clicking outside of it.Gravatar Tomaz Canabrava
This patch closes the air list when clicing outside of it, making the use of the planner more pleasant. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.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-15Remove some unneeded member functionsGravatar Anton Lundin
We can wire qt to call the right functions directly, so we don't need these members. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Planner: Default to GF from prefs.Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Planner: use a QSpinBox for GFLow/GFHighGravatar Anton Lundin
Switch to using a QSpinBox instead of a QLineEdit. This makes it a bit more intuitive and now you can see how the deco plan changes based on the GF's. Signed-off-by: Anton Lundin <glance@acc.umu.se> 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-14Change the menu structureGravatar Dirk Hohndel
Mostly based on suggestions by Tomaz and Luisa (but with some changes based on my rather strongly held believes). I also tried to clean up the shortcut keys. Not sure if I got this right. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Hook up the tank change and tank update for the plannerGravatar Dirk Hohndel
This failed spectacularly when I first tried it, so I put it on the back burner. And it appears that with all my recent fixes for "add dive" as a side effect this is working, too. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Expand the trip of the first selected dive.Gravatar Tomaz Canabrava
I probably broke this a while ago, as I was not using the big dirk dive file to test ( just using some random files over the test folder. ) Now it's working as it should. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> 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-14Correctly sets the size of the Air Types on the plannerGravatar Tomaz Canabrava
The last commit correctly setted the minimumSize, but I forgot to set the maximum size, and thus, it still expanded. sigh. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Makes the Air Types widget on the planner smaller ( but expanding.)Gravatar Tomaz Canabrava
This patch makes the Air Types widget on the planner smaller, since on most dives users will only enter 1 to 2 dives, it's not good to have so much whitespace. this makes it smaller for small screens, and it will grow on bigger screens where space is not an issue. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Fix Last Column adding a horizontal Scroll on the Dive List.Gravatar Tomaz Canabrava
Fixes the last column adding a horizontal scroll on the dive list, since we have the hability to show / hide columns, I had to create a helper method to discover what is the last column and set the size of it very small so no scroll is created. Also, I'v set the setStrechLastSection to true. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Fix edition of alphanumeric input on equipments.Gravatar Tomaz Canabrava
This patch fixes the edition of alphanumeric input, columns like depth accepted '23ft', '20m' or '30', with an inplicit conversion to the unit. But the code ignored that the input could have a 'ft' or 'm' ( ot anything else for that matter. Signed-off-by: Taiane Ramos <exhora.tat@gmail.com> 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-14Sort the dive table after adding a diveGravatar Dirk Hohndel
This commit scares me. Any pointers to dives or indices into the dive table... anything like that is invalid after we resort the table. Well, not technically "invalid" (as in bad pointers), but after re-sorting the table these will possibly not be pointing at what we expected. This starts with the selection being "wrong" after we add a dive that isn't the last dive (once we click OK the chronologically last dive will be selected). But of course without doing this, our #1 assumption about the dive_table is broken. The dive_table is supposed to be in chronological order. Best advice of course would be "don't enter dives out of order" - but of course that's not realistic. Fixes #234 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Handle tank data correctly in profile editing mode for manually added diveGravatar Dirk Hohndel
This is subtle. Normally you would expect someone to edit the tank data by simply clicking on it in the equipment tab. But a user could conceivably edit the tank data after clicking on the profile editing button instead. This works now as well. This also addresses the issue that start and end pressure were not shown in profile editing mode. Fixes #235 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-14Add file naming dialog for save asGravatar Miika Turkia
When right clicking a dive on the divelist a dialog for selecting a dive was opened. However, Save As requires a getSaveFileName dialog so that user can give a new file name as well as selecting an old file to overwrite. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Correctly convert an existing dive into a planGravatar Dirk Hohndel
I missed this one spot when converting back to the different semantics for divedatapoints. With this change add dive appears to work correctly (fingers crossed). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Fix addGas to look at the correct cylinderGravatar Dirk Hohndel
That was a stupid bug. You have to actually update the variable to look at the right cylinder. Duh. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Don't overwrite the new cylinders when adding a diveGravatar Dirk Hohndel
We carefully assembled the correct data in the cylinders - don't replace that data when manually editing a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Correct behavior when adding a dive to an empty list and canceling the addGravatar Dirk Hohndel
We need to leave the widget disabled and the date / time and coordinates cleared. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Don't change gas used in segments if there is still a cylinder with that gasGravatar Dirk Hohndel
Otherwise adding a second cylinder (to the default one cylinder of air) and subsequently changing the gas of that cylinder will illogically change the gas used in all the segments. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Connect changes in the tanks with the dive that is being addedGravatar Dirk Hohndel
- you can no longer delete a tank when its gas is in use - therefore you can no longer delete the last tank - when you change the gas mix of a tank, the corresponding segments in the dive change as well - when changing gas for a segment the correct available gases are offered Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Instead of a "Cylinder for planning" use a default cylinderGravatar Dirk Hohndel
Right now hardcoded to AL80. This way in the future we'll have a volume of gas that's available. And this makes much more sense then a random string in the description field. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13When selection gets confused, don't try to select non-existing diveGravatar Dirk Hohndel
While the argument could be made that this is just a symptom of Subsurface getting very confused about the selection (which it still gets at times - most likely we are calling select_dive() instead of selectDive() (or the corresponding deselect functions) in places where we shouldn't), but either way, we should not crash. Fixes #220 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13MaxPPO2 should be a double, not an intGravatar Dirk Hohndel
This just fixes the spinner used in the preferences dialog. Reported-by: Benjamin <nystire@gmail.com> 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-13Partially revert d72c69db7a49f and fix its errorsGravatar Tomaz Canabrava
In the offending commit a QWidget was changed to QTableView, but only in the header - and thus making avaliable all method calls, but the initialization of the widgets was still a QWidget, and nothing of QTableView was used besides an incorrect call to setColumnHidden. This commit fixes that by using the view() method provided by the TableView implementation which returns the true QTableView that should be used for specific nitpicking, like hidding columns. :) 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-12Only auto-complete gps information when empty.Gravatar Michael Andreen
Previously gps information was always overwritten, unless the user had modified it in the current editing session. This causes problem with some use cases, like when coordinates are provided before the location name by the companion app. Now gps information is only overwritten when it is: - Empty - Auto-completed in the current editing session. (When the user hits accept it is considered hand-edited.) Signed-off-by: Michael Andreen <harv@ruin.nu> 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-12Use existing helper functionGravatar Dirk Hohndel
And remove spurious extra ';' 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>
2013-11-12First steps to make add dive work with the correct infrastructureGravatar Dirk Hohndel
This just makes sure that we do the right thing with the staging drive, that we don't mess up the selection, the we are smart about using our helper functions, etc. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Remove some debug outputGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Make planner work againGravatar Dirk Hohndel
This partially reverts changes in commit 1b655d5c806b ("Correctly track gases when manually adding and then editing dives") as it turns out this did NOT help us correctly track gases (which is ironic, given the title of that commit). I didn't actually want to revert that commit as infrastructure has changed since then and this made the patches look even more incomprehensible. So we are back to tracking the "gas on which we arrive at this spot" in each dive plan node as this makes the rest of our planning so much easier - I had forgotten about the reasons why we did things this way when I made the above mentioned commit. Instead we now make sure that our available tanks are added the correct way, that such entries are ignored when planning and when drawing the editable profile, and that at the end it all gets assembled correctly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Add depth colum to cylinder modelGravatar Dirk Hohndel
To make the planner work this adds a new column to the Cylinder widget (depth - for the depth at which we want to change to a certain gas during deco). This also tries to hide that column in the equipment view and hide the start/end pressure columns in the planner view. Oddly that fails :-( Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-11When entering a new point, pick the previous gas by defaultGravatar Dirk Hohndel
This is much more useful than always picking air. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-11Connect cylinders entered in planner with the gases availableGravatar Dirk Hohndel
Now the gases for which we have cylinders are offered in the gas selection list and correctly recognized and added for the plan. Still tons of work to be done to make this work the way it is designed, but we are getting closer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>