aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/preferences.cpp
AgeCommit message (Collapse)Author
2013-11-24Create a drop down to choose default cylinderGravatar Anton Lundin
This also renames the ui element to match. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-23Use the default cylinder if definedGravatar Dirk Hohndel
With this every cylinder downloaded from a divecomputer that doesn't provide cylinder data, and every cylinder manually added anywhere will default to the default cylinder that is set in the preferences. For people who most of the time dive with the same equipment (always on dive boats with AL80, or almost always diving their personal HP119) this should be a nice improvement. If you don't like this behavior, simply leave the default cylinder setting in the preferences empty. This commit also fixes the incorrect s->value call (should be s->setValue). I wonder what this did to the default filename before... Fixes #145 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-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-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-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-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-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-10-17Show SAC in the mouseover.Gravatar Anton Lundin
This is really nice to have when looking at specific parts of a dive. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14Enable file selection dialog for preferencesGravatar Miika Turkia
This enabled a file selection dialog for selecting default log file under the preferences. [Dirk Hohndel: added missing declaration to .h file] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04Added configuration options for vertical speed units.Gravatar Patrick Valsecchi
Some people (free divers) are loving ft/s or m/s units for vertical speeds. Now they can choose between /min or /s in the configuration (only Qt UI). Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Make the classes generated by uic be real members of our classesGravatar Thiago Macieira
This means we don't have to new/delete them, which is a waste of overhead. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Include the ui_*.h headers in the main headers.Gravatar Thiago Macieira
This means we can also remove the forward declarations. This is the first step in removing the memory allocation for the ui sub-classes. Without the second step, this commit is just making the compilation time increase for no good reason :-) Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Show sample time in the mouseover.Gravatar Anton Lundin
This is really nice to have when looking at specific coutures of a dive or events. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-28Close child windows and dialogs with main windowGravatar Lubomir I. Ivanov
Most child windows should be closed with the main application window otherwise if left open and if making specific modifictions could potentially cause a SIGSEGV. To solve that we mark all custom windows/dialogs with the Qt::WA_QuitOnClose attribute on instance creation. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-04Explicitly store UI values to prefsGravatar Dirk Hohndel
This helper wasn't called as intended - but because of the syncSettings call which emits settingsChanged this only became visible for the default_filename. Next I need to clean up what is called for the settingsChanged signal. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-03Tie all the pieces together and make Preferences work as intendedGravatar Dirk Hohndel
Not Apply / Close without Saving / OK work as designed. And things get correctly stored and reset. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-03Implement Apply / Close without Saving for preferencesGravatar Tomaz Canabrava
This hooks up the buttons correctly Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-02Correctly implement Metric / Imperial / Personalize preferenceGravatar Dirk Hohndel
The code so far had completely ignored Metric / Imperial. Turning this into a three way radio box seemed to make much more sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-31Cleanup minor issues with ceilings for individualy tissuesGravatar Dirk Hohndel
In commit b8d31d8534b ("Show ceilings for individual tissues") Robert inadvertently broke the connection from dc_ceilings to red_ceilings and also didn't correctly enable the checkbox for all_tissues when calc_ceilings was already set in the preferences before the dialog was created (and therefore the connection in the .ui file isn't run). There's also a simplification / cleanup to the code deciding whether to show all the tissues. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-31Show ceilings for individual tissuesGravatar Robert Helling
I think that displaying tissue loadings either as pressure or as percentages is not very intuitive but that it makes much more sense when translated to ceiling depths. This change enables just that for the 16 tissues in our calculated ceiling and visualizes this in the profile graph. There is a checkbox in the preferences to turn this on. If enabled, all tissues having non-trivial ceilings are also shown in the info box. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-29Correct the ceiling preference handlingGravatar Dirk Hohndel
Added the red dc ceiling as preference option. Hooked them all up together so the sub-preferences are enabled when the master preference is set (for 3m and red ceiling). Use the options in the profile plotting functions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-29Correctly enable partial pressure threshold entry in preferencesGravatar Dirk Hohndel
The initial state needs to reflect the value of the checkbox. Once the dialog is run, there is a signal/slot connection in the .ui file that keeps things in sync. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-29Connect preferences to the rest of the codeGravatar Dirk Hohndel
The biggest problem here was that bool has different sizes in C and C++ code. So using this in a structure shared between the two sides wasn't a smart idea. Instead I went with 'short', but that caused problems with Qt being to smart for its own good and not doing the right thing when dealing with 'boolean' settings and a short value. This may be something in the way I implemented things (as I doubt that something this fundamental would be broken) but the workaround implemented here (explicitly using 0 or 1 depending on the value of the boolean) seems to work. I also decided to get rid of the confusion of where gflow/gfhigh are floating point (0..1) and when they are integers (0..100). We now use integers anywhere outside of deco.c. I also applied some serious spelling corrections to the preferences dialog's ui file. Finally, this enables the code that selects which partial pressure graph to show. Still to do: font size, metric/imperial logic Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-26Hook up most of the Preferences dialogGravatar Dirk Hohndel
The imperial/metric super setting doesn't have any effect. But changing the individual units now works and is tracked. And causes the display to change after clicking "OK" (but not yet when clicking "Apply"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-26Repair the saving and loading of unitsGravatar Dirk Hohndel
This way it should work... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-24Added support for a preliminary Preferences DialogGravatar Tomaz Canabrava
Dirk asked me to try to make it more modern, so I used as a base, the Firefox preferences. currently it saves / loads the preferences, and also smits a signal 'preferencesChanged' that should be connected to anything that uses preferenes, via the PreferencesDialog::intance() object. In the future, I plan to make it have a signal / slot for each member that changes. I also moved the icons to a new folder this time, because the amount of icons is now more than just two, and it was becoming messy. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>