aboutsummaryrefslogtreecommitdiffstats
path: root/subsurfacestartup.c
AgeCommit message (Collapse)Author
2014-07-23Animation speed is a value, not a booleanGravatar Tomaz Canabrava
This breaks compatibility with old preferences, but it's a single key and not that very important so I don't think it's a bigger issue I've renamed prefs.animation to prefs.animation_speed to denote that it's a value, and not a state. Also, fixed the places that were treating it as a state (on/off) to treat it like a correct value. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-19De-duplicate planner default settingsGravatar Anton Lundin
All other default settings we get from subsurfacestartup.c's initialization of the prefs struct. The planner had its defaults there and in the retrieve of the settings from QSettings. This changes so the defaults for planner settings will be read from the defaults prefs struct as all other settings. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16Store drop_stone_mode, bottomsac, decosac in prefsGravatar Gaetan Bisson
The values for drop_stone_mode, bottomsac, and decosac are typically the kind of personal data specific to a diver that is unlikely to change from one dive plan to the next. This patch stores/restores them to/from the preferences file. For this, it adds bottomsac and decosac to the prefs structure; drop_stone_mode was already there, though not stored/restored. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10Added the toggle picture button and hoocked it upGravatar Tomaz Canabrava
This patch adds the toggle picture button and hoocks it up with the rest of the code. I'v also changed a call from ProfileWidget because it caused errors on the ui generated code, where it would try to call an still-to-be instantiated object. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Move drop_stone_mode setting to prefsGravatar Anton Lundin
There is no reason to treat drop_stone_mode different from the rest of the planner settings, so move it to our prefs structure. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Planner: Add backgas breaksGravatar Robert C. Helling
If the corresponding checkbox is checked the planner does interrupt pure O2 deco after 12min for 6min on cylinder 0. To make this work for air I removed the gasmix_is_null logic. I guess that makes the planner feature complete for the next release. [Dirk Hohndel: trivial merge into latest master] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-25Make pO2 settings functional in plannerGravatar Robert C. Helling
Spin boxes for pO2 are now hooked up to preference values. Adding new cylinders (or changing their fo2) computes the MOD accordin to the current value of decopo2. Note that chaning the limits for deco pO2 does _not_ automatically update the switch depth of all cylinders as those might have been manually entered. Furthermore, MOD has now to option of rounding to multiples of a given depth. That is used for the automatic switch depth which are now always multiples of 3m (so that EAN50 is switched to at 21m rather than 22m). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-25Hook up UI elements for ascent rates to plannerGravatar Robert C. Helling
That provides some UI elements that were recently introduced with function of allowing the ascent rates of the planner to be configured by the user. I tried to make it work both with senisble as well as with imperial units. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-23Be more consistent in partial pressure namingGravatar Henrik Brautaset Aronsen
Lets just use pO₂ instead of PO2, ppO2, ppO₂, PO₂. They all mean the same, but it's better to be consistent Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14User survey: force running the survey from command lineGravatar Dirk Hohndel
This way people can test the dialog much easier. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-20Dive list: add context menu function to renumber dive(s)Gravatar Dirk Hohndel
No attempt is made to ensure that what the user does is sane. So this can result in duplicate numbers, non-consecutive numbers, non-monotonous numbers, whatever floats the users boat. You can renumber a single dive or all selected dives (with a starting number given that is applied to the oldest selected dive and then for each newer selected dive that number is incremented by one). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-16Renaming the prefs struct members to be consistent with the QSettings.Gravatar Gehad Elrobey
-Renaming prefs members for consistency. -Changing references of QSettings to the prefs structure instead. -Removing unused functions in pref.h were left over from an old version. -Changing the data-type of bool members to short for consistency with other members. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-11Change some references of QSettings to the pref struct.Gravatar Gehad elrobey
After adding the animation member in the preference struct, it is very resonable to change these references of QSettings to the preference structure instead. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-10Feature to show or hide heart rate graphGravatar Lakshman
Adds new push button "HR" to the button bar on the dive profile to toggle display of heart rate. TODO: New icon for the heart rate button is needed. Fixes #485 Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-05Remove check option to show units in text labelGravatar Lakshman
Currently the feature to show temperature units while adding dive is provided through checkbox in preferences->units section. This patch disables this checkbox and always enables this feature. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-28Toggle showing average depthGravatar Lakshman
Add additional check box in "preferences->graph" section that allows users to hide average depth on dive profile. By default this option is checked to show average depth. Fixes #475 Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-25Add optional Win32 console allocationGravatar Lubomir I. Ivanov
This patch adds the optional --win32console command line option. It does nothing on OSx and Linux, while is only useable on Win32. On Win32 if the application was built as GUI (not console), there is no way to view stdout and stderr. With windows.c's subsurface_console_init() we are able to either redirect stdout and stderr to the terminal from which subsurface.exe was started (always happens; --win32console does nothing in this case) or if --win32console is explicitly added to a shortcut, create a dedicated console window and monitor the output there. if set, WIN32_CONSOLE_APP is a condition that will make the subsurface_console_init() and subsurface_console_exit() functions NOP on Windows. The definition will be created if the user passes 'CONFIG += console' to qmake. Fixes #436 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-21Fix system default font handlingGravatar Anton Lundin
We didn't care about system default fonts and sizes, we just used the Qt default font. Due to how QFont is constructed, there was need to split font and font size. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10Show temperature units in the label when editing diveGravatar Lakshman
Currently when user wants to add a new dive information, the ways to know what unit system is being used are - Through preferences panel. - Save the dive information, which displays units in the text field. This patch provides an option to the user to show current unit system by displaying the unit on the side of the label when the user is editing the fields. This feature can be enabled or disabled by using the new checkbox option i.e. `Show units in text labels` included in `preferences->units` section. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-26Fixing default font on preference windowGravatar Danilo Cesar Lemes de Paula
Default font was hardcoded as 14. What happen if you change any other preference value is that the application would start to use fontSize=14. This commit loads the right value in the QDoubleSpinBox Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Convert the C code to using stdbool and true/falseGravatar Anton Lundin
Earlier we converted the C++ code to using true/false, and this converts the C code to using the same style. We already depended on stdbool.h in subsurfacestartup.[ch], and we build with -std=gnu99 so nobody could build subsurface without a c99 compiler. [Dirk Hohndel: small change suggested by Thiago Macieira: don't include stdbool.h for C++] Signed-off-by: Anton Lundin <glance@acc.umu.se> 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>
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-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-11-02Speed up XML loadingGravatar Linus Torvalds
This tries to speed up XML loading for large XML files (and thus subsurface startup times) by trimming the fat off our own matching code. The actual libxml overhead (particularly string allocation) tends to be the dominant part, so this only speeds up a big load by about 12% for me, but hey, it can be noticeable. Dirk's example nasty 175MB xml file with ~5200 dives takes "only' 7.7 seconds to load, when it used to take 8.8s. And that's on a fast machine. For smaller xml files, the dynamic loading costs etc startup costs tend to be big enough that the xml parsing costs aren't as noticeable. Aside from switching the node names around to "little endian" (ie least significant name first) format to avoid some unnecessary strlen() calls, this makes the nodename generation use a non-locale 'tolower()', and only decodes up to two levels of names (since that's the maximum we ever match against anyway). It also introduces a "-q" argument to make startup timing easier. Passing in "-q" just makes subsurface quit imediately after doing all necessary startup code. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> 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-15Dependencies are too aggressive for version.hGravatar Dirk Hohndel
Apparently qmake can't tell that #include "version.h" and #include "libdivecomputer/version.h" are not the same thing. Instead of spending another bunch of hours on fixing the buildsystem I decided to just cleanup the spots where we actually use the version file and rename it to ssrf-version.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Next step towards working translationsGravatar Dirk Hohndel
This may seem like a really odd change - but with this change the Qt tools can correctly parse the C files (and qt-gui.cpp) and get the context for the translatable strings right. It's not super-pretty (I'll admit that _("string literal") is much easier on the eye than translate("gettextFromC", "string literal") ) but I think this will be the price of success. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06Delete code and files that are no longer usedGravatar Dirk Hohndel
Most of this is Gtk related, some of it is helpers that we don't need anymore. I love the diffstat. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06Trying to switch to Qt translationGravatar Dirk Hohndel
This compiles and looks about right, but it doesn't appear to work, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06First steps towards removing glib dependenciesGravatar Dirk Hohndel
- remove the build flags and libraries from the Makefile / Configure.mk - remove the glib types (gboolean, gchar, gint64, gint) - comment out / hack around gettext - replace the glib file helper functions - replace g_ascii_strtod - replace g_build_filename - use environment variables instead of g_get_home_dir() & g_get_user_name() - comment out GPS string parsing (uses glib utf8 macros) This needs massive cleanup, but it's a snapshot of what I have right now, in case people want to look at it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04Code Cleanup - Uneeded preferences stored at the old prefs settingGravatar Tomaz Canabrava
Those preferences removed ( basically the ones about visibility of the List View of the Table ) are now managed by the Qt Settings system, and thus there's no need to have them there. wich gave us a pretty good cleanup. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.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-09-09Use the same code for command line and gui for file handling.Gravatar Tomaz Canabrava
The Command line execution of Subsurface happened before the GUI was created, this leaded to various bugs by me(tm) over time. This patch seems to fix all of those, by reusing the same code for GUI interaction and CommandLine interaction. I had to rework how the main.c worked, it used to be C code calling C++ code, and this is non desirable, since C doesn't really understand C++. I Moved all of C-related code to 'subsurfacestartup.c/h' and created a tiny wrapper to call it, so all of the C code is still C code, and the new main.cpp calls the mainwindow->loadFiles and mainWindow->importFiles to get rid of the bugs that happened before. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>