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>
-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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>