If the 'mouseClicked' didn't get any dives at the click-geolocation,
ignore it and do not try to select an empty selection. this was
causing a lot of issues when map-navigation.
Also, good deal of code cleanup.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manually done by only replacing unfinished translations (and one where an
English term was used as translation).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Let's ALWAYS support the somewhat "international standard" N/S/W/E
characters, but ALSO support localized versions.
Fixes#315
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
commit 3c064d5857 ("Make the message when editing a dive fit better")
kinda fixed the wrong problem. A better solution was suggested - just drop
the instructions regarding Cancel / Safe. It's quite obvious what to do
mow that the buttons are part of the message.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For the names that we have in our "default set" we need to store the
English name so Subsurface will "do the right thing" when opening the file
in a different locale.
With manually entered names in a local language there's not much we can
do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Due to that we can't handle gaschanges to the same gas in another
cylinder, this changes the second gas to EAN22 to workaround that.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This piece of code didn't need to be on the for-loop, so
let's remove it out of it.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old code ( slow++ ) ignored that each new dive-selection
we recreated all information on the profile window, so this
version ( a lot more verbose, I know. ) will ignore all dives
that are being selected and will only send the 'dive was selected'
information in the last line of the algorithm, instead of calling
it for each dive on the list of 'to be selected' dives.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Still trying to fix the same issue that I already tried to address in
commit e0b70b82ca ("Fix translation of weightsystem names") and before
in commit dc03b7e7d6 ("We need the correct context to translate event
names").
I missed the WeightModel. Hopefully this was indeed the real fix.
Fixes#312
(I know, I keep saying that)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should keep the message widget visible without horizontal scroll bar,
even on fairly small screens.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The button box on the bottom of the window made it a bit cluttered
on small screens, this patch uses the window of the MessageWidget
to show the butons - this way less space is used and things are better
spaced on screen.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a context menu to set the dive location
via the globe, being the dive with a coordinate or not.
It also fixes setting the dive location on edit mode.
Fixes: #315
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We add the "maximized" entry for the settings group "MainWindow",
and store it on close, so that the window state is the same on
the next run. But then also, we only store the window size and resize
to that size if not maximized. This attempts to preserve a "restored"
window size.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As usual, I am not the author, just the person pulling from Transifex.
Authorship is tracked there (rather badly).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is very much the same as in commit dc03b7e7d6 ("We need the correct
context to translate event names"). I didn't pay enough attention when
reading the bug report and missed that the weight system names were also
not correctly translated.
Fixes#312
(I hope this time for real)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I have added a section about importing dives from other electronic
sources. There are some potential problems, because I know that the
intercation with divelogs.de is not yet fully functional
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing air or water temperature, you are actually editing the
information in the active divecomputer structure. But the Dive Info shows
the summary data created from the temperature data in all dive computers.
For most people who will only ever have one divecomputer per dive this may
seem like an artificial distinction, but it's very important if you track
more than one computer.
So in order to have an edit reflected in what's shown, we must redo the
"summary creation" for data from the different divecomputers into the
summary fields of the dive.
Fixes#313
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt assumes that all strings are in the context of the class in which you
use them. So when we want to display the translated event names from
within the ProfileGraphicsView we need to make it explicit that these are
strings that come from the C part of the code.
Doing that showed another bug in the code where we foolishly compared the
translated text to a fixed string. Not smart.
Fixes#312
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Again, the author credit to me is wrong. I only did some of the German
translations. Everything else has authorship tracked on Transifex.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subsurface creates a lot of singleton instances on demand, but nothing
ever deleted them. Since they are singletons, these memory allocations
are technically not leaks. However, they clutter the output in valgrind
and other memory analysers, hiding the real issues.
The solution is to delete these items at exit. For the models and for
gettextFromC, the solution is to use a QScopedPointer, which will delete
its payload when it gets destroyed. For the dialogs and other widgets,
we can't do that: they need to be deleted before QApplication exits, so
we just set the parent in all of them to the main window.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Found by Dr. Memory, run by Lubomir:
Error #48: UNINITIALIZED READ: reading register al
# 0 StarWidget::mouseReleaseEvent() [qt-ui/starwidget.cpp:29]
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Hide the sizeing sliders from PrintOptions. we don't really
support any of those in PrintLayout and these are not that
useful and easy to implement, until some sort
of layouting/templating system is in place.
- Move the 'Print' button on top as a workaround, since if
it's bellow the print options it stays bellow an empty area
where the now hidden sizing sliders are.
- Resize the dialog to a smaller size
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Make it consistent with other application dialogs.
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The translatable string in about dialog is truncated at the
VERSION_STRING. Thus it has to be given as argument to the tr function.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When there are no trips at all, we have to skip the Yearly statistics
alltogether, including the header line (that should display all the
dives added together).
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We now only use a slightly large font for the "Dive #" entry.
All other font sizes remain at 9px.
Another change is that we now attempt to use 11px for
individual row height. This makes the table at least 12px bigger
(n_rows * increment), but does not cut letters like 'g',
which go slightly bellow the font baseline.
Perhaps this can be improved later by adjusting the font
and row sizes again.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
nr was used but never initialized.
Also, the code removed used select_dive had likely just been forgotten to
be removed when the correct code using selectDive() was added a little
later in the function.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
c++ have some idea about in what order things should be initialized.
This makes us comply with that order.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the same case for the first letter in the dive table column headers,
use '%' for both gases in the planner, and show "Start time" instead of
"Starttime".
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The "air / water Temperatures" label didn't look to good.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While playing with the ruler, I figured that it happened only once that
my minimum speed was not 0 for a segment long enough to get any display.
And it was a "dive" in an hyperbaric chamber...
This patch replaces the minimum speed with the maximum descent speed and
the maximum speed with the maximum ascent speed.
Signed-off-by: Alexandre Belloni <alexandre.belloni@piout.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We update the values for divemaster, buddy and etc...
Rating and visibility are currently displayed as "x / 5"
values.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Following the new layout for the profile print, we separate
the used gas like so:
AL80 / EAN33 / ...
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>