summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-05-22Implement default dive computer and deviceGravatar Dirk Hohndel
The data is saved in the settings and the correct dive computer (vendor and product) and device are picked when the download dialog is openend. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22The never ending, futile fight for whitespace consistencyGravatar Dirk Hohndel
I just need to write a tool that does this... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Re-enable dive computer selectiomGravatar Dirk Hohndel
This had been disabled by some redraw optimizations in commit 81406b80c6ec ("Fix loading a second dive, after the first file was loaded."). We need to redraw the plot not only if the dive changed but also if the selected divecomputer changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Start editing Dive Notes when clicking on Rating or VisibilityGravatar Dirk Hohndel
Those widgets respond to MouseButtonPress and not FocusIn. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Merge branch 'fixResizeEvent' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-05-22Small fixes to the modelGravatar Dirk Hohndel
Prevent a crash when no cylinder type description is set. Correctly calculate the cylinder volume. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Get the math right for cylinder model setData functionGravatar Dirk Hohndel
This is a fun one. We only want to mark the divelist changed if the user actually changed something. So we try really hard to compare what was entered with what was there and only if it is different do we overwrite existing values and record this as a change to the divelist. An additional challenge here is the fact that the user needs to enter a working pressure before they can enter a size (when in cuft mode). That is not really intuitive. We work around this by assuming working pressure is 3000psi if a size is given in cuft - but then if the user changes the working pressure, that changes the volume. Now going back and changing the volume again does the trick. Or enter the working pressure FIRST and then the volume... This also changes the incorrect MAXPRESSURE to WORKINGPRESSURE and uses the text WorkPress in English (Gtk code used MaxPress which was simply wrong - this is just the design pressure or working pressure, not some hard maximum. In fact, people quite commonly "overfill" these tanks. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Fixed update the plot as we resize the view.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Merge branch 'comboBoxDelegate' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-05-22Removed the unused add cylinder and add weigthsystem dialogs.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Removed unused debug, and set the correct data on the delegates.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Merge branch 'comboBoxDelegate' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-05-22Added the trash.png file that was missing.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Actually remove cylinders and weightsystems from the data structuresGravatar Dirk Hohndel
The UI had only stubbed this code out. This adds the implementation of the helpers and calls them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Added a Delegate for editing CylindersGravatar Tomaz Canabrava
Now when you edit 'Type', a drop-down list will appear and will enable you to choose from it's contents. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Shorten the 'set location' textGravatar Dirk Hohndel
The old text was quite verbose and caused issues on smaller screens Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Merge branch 'randomFixes' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-05-22Added basic editing functionality for Cylinders and WeigthsystemsGravatar Tomaz Canabrava
This patch adds basic editing functionality for Cylinders and Weigthsystems, it still doesn't use delegates to show the data to the user in a better way, and it does not take in consideration user preferences yet, but it's a starting point. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Extend a bit the skeleton 'removes' on cylinder and weigth to help dirk.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Calm down the Globe widgetGravatar Dirk Hohndel
This addresses two issues: - the kMessageWidget did not word wrap, so if it was wider then the Globe widget the Globe would expand (and divelist shrink) when the user switched from a dive with location to a dive without location - the code was also too aggressive removing and redrawing the message widget when switching from dive to dive. with this change we only hide the widget if the next dive has a location (and only show it if it isn't shown already). We also hide the message if no dive is selected. Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Added a 'trash' icon on the Cylinders and Weigthsystem modelsGravatar Tomaz Canabrava
So, the Cylinders and Weigthsystems got a new Trash icon, and the interface already intercepts the clicks ( on all columns ) and send this to the 'remove' method on boch models. On the model I'm just filtering the indexes that are not 'DELETE' and creating a stub method to be filled later. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Disable some MacOSX GTK dependenciesGravatar Henrik Brautaset Aronsen
Now it's actually possible to build the Qt variant on MacOSX with MacPorts and marble support. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22Only enable the add buttons when there's a dive loadedGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Re Enable the option to add cylinders / weigthsystems.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Rework on the Equipment tab to make it look more Modern.Gravatar Tomaz Canabrava
Note that this is a WIP and it does break functionality - ie, not possible to add Equipments, but this will be fixed in the next commit. Removed add / edit / remove buttons, only a single '+' icon appears on the widget now. the edit / delete will be done in place. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22Fixed the 'click in close doesn't close' on KMessageWidget.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Replace GError handling with a kMessageWidget based approachGravatar Dirk Hohndel
Instead of passing pointers to GError around we pass just pointers to error message texts around and use kMessageWidget to show those. Problem is that right now the close button on that doesn't do a thing - so the error stays around indefinitely. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Remove Gtk crudGravatar Dirk Hohndel
The DEBUGFILE logic isn't needed anymore. Nor are helpers dealing with model / datastructure updates. Nor conditional compiles to use Gtk instead of Qt. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Initialize QSettings earlier & change the Organization to "Subsurface"Gravatar Dirk Hohndel
The first change allows the default_filename to be found again. The second change switches us to .config/Subsurface/Subsurface.conf which I find much more useful. QtCreator also fixed a few indentation issues for me. How helpful. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Merge branch 'microFixes' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-05-21Removing an kinky settings that I forgot to.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Fixed the hide / show columns using the settings.Gravatar Tomaz Canabrava
This also changed a bit the behavior on how the QSettings are managed, till now, we used the QSettings constructor passing the name of the software and the 'company', but this is now default - so there's no need to pass anything by the QSettings contructor. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Correctly restore the column sizes in the dive listGravatar Dirk Hohndel
Ordering here is important - we can't resize the columns before they are created. On the other hand this now means that we explicitly need to expand to the first dive shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Merge branch 'microFixes' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-05-21Added code for handling of show / hide of columns.Gravatar Tomaz Canabrava
The code also remembers to save in the config file. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Correctly format the values shown for cylinders and weightsGravatar Dirk Hohndel
Make use of all the nice helpers that we have... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Correctly use the weightsystem_none / cylinder_none helpersGravatar Dirk Hohndel
Plus a couple of minor formatting changes Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Fixed memory leakGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Added support for visualization the Weigthssystems on the Equipment Tab.Gravatar Tomaz Canabrava
This patch adds support showing and for editing weigthsystems in the equipment tab, so, now the two things that are missing are 'edit' and 'delete', wich are quite easy to do. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-21Added the code to show the cylinders from a dive.Gravatar Tomaz Canabrava
i Added the code to show the cylinders from a dive, this code also already permits additions from the interface, so the user can click 'add' and insert what he wants there. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20Implement rudimentary divecomputer downloadGravatar Dirk Hohndel
Small changes to the names of elements the divecomputer download UI and very simplistic first stab at populating the device_data_t structure. This is lacking lots of things - it should remember the last vendor / product used - it should figure out which device (mount point) to offer - it needs proper error handling But it's a step in the right direction. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-20Populate the Vendor && Dive computer information.Gravatar Tomaz Canabrava
This uses the QStringListModel to populate the items of the QComboBoxes. I used a QHash to hold every Computer of a particular Vendor. so, products[vendor] gives me the full list of products from each vendor. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20Added code to cancel the thread.Gravatar Tomaz Canabrava
I think it's self explanatory - When user clicks on 'Cancel', the interface will wait for the trhead to quit then will close itself. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20Skeleton code for a non-blocking UI thread for downloading dives from the DCGravatar Tomaz Canabrava
This is the skeleton code for a non-blocking ui-thread It already creates the first-thread ( 'do not block the ui' ) and the second thread ('download from the dive computer') We can in the future merge both in the same place - I didn't want to do that now because the download function is written in the libdivecomputer.c code, and I cant just transform that to a QThread and use signals, so I used two threads for that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20Detect libdivecomputer using pkg-config if possibleGravatar Miika Turkia
If libdivecomputer is managed by pkg-config, we should query it for the compiler parameters on Linux also. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-20Integrate visibility Star widget into editing flowGravatar Dirk Hohndel
This also removes some incorrect code from the clear() function for the DiveInfo tab. Putting the readOnly() calls for the DiveNotes tab there was wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-20Move visibility Star widget to the DiveNotes tabGravatar Dirk Hohndel
This looks much better and seems much more contextual. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Display the statisticsGravatar Dirk Hohndel
This would be correct if the current selection code wasn't broken. Right now we only add to our internal notion of what is selected - we never deselect anything. Once that is fixed, thestatistics should be correctly displayed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Try to add a StarWidget for visibilityGravatar Dirk Hohndel
It's not editable. And of course it continues to look like utter crap - even more so now since this is left aligned and everything else is centered. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Close needs to clear the Globe and the DiveNotesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>