Since pointers to divecomputers may not be stable, the undo
commands take a dive + a divecomputer number. Update the
SetpointDialog accordingly.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We have too many global objects. There is no reason why this dialog
should be a persistent global object.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
These just make no sense. Since the value is copied, it
has no meaning to the caller whether the function can
change the value (and vice versa for return types).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The PIMPL idiom is used by some frameworks (notably Qt) to
ensure binary compatibility. Objects consist only the general
object header (ref-count, connections, children, etc..) plus
a single pointer to private data.
MinMaxAvgWidget was implemented using this idiom. This seems
to make no sense, as we don't produce a general library with
the need of a stable ABI. Let's remove this unnecessary
indirection.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The idea of this new widget is to be able to filter more
types of data, while keeping it simple and extending the
feature set to something that was impossible with the old
implementation.
While the old implementation had 4 panels that you could
use to filter specific tags / people / types of dives
the new one will let you filter by visibility, temperature
people, name, equipment, etc, in a more natural way
than the old one.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This reverts commit 1c4a859c8d,
where the override modifiers were removed owing to the noisy
"inconsistent override modifiers" which is default-on in clang.
This warning was disabled in 77577f717f,
so we can reinstate the overrides.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On import of dive media, the timestamp is read from the
metadata to check if the image belongs to the selected dives.
The pictures are then listed in a dialog.
Currently, the metadata is read twice if images are outside
of a dive: once in picture_check_valid() and if it turns
out that the picture is not valid again in picture_get_time()
to display the proper timestamp.
Even though metadata-extraction is reasonably fast, this is
a bit of an embarrassment.
Instead, read the timestamps only once in the constructor of
the dialog and from then on only used these timestamps. Keep
the timestamps in a QVector. Rename the picture_check_valid()
function to picture_check_valid_time() and pass a timestamp
instead of a filename.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
These also showed up as concerns when creating translation strings.
Adding them thankfully didn't create new strings, but not having them
potentially leads to incorrect runtime behavior.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix some broken translations in the dive list filter UI by adding
Q_OBJECT line to the class definitions of filter classes.
Plus simplify some strings given to translation by separating parts
like ": ".
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Suggested-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Commit df156a56c0 replaced "virtual"
by "override" where appropriate. Unfortunately, this had the
unintended consequence of producing numerous clang warnings. If
clang finds a override-modified function in a class definition,
it warns for *all* overriden virtual functions without the override
modifier.
To solve this, go the easy route and remove all overrides. At least
it is consistent.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The keyword "virtual" signalizes that the function is virtual,
i.e. the function of the derived class is called, even if the
call is on the parent class.
It is not necessary to repeat the "virtual" keyword in derived
classes. To highlight derived virtual functions, the keyword
"override" should be used instead. It results in a hard compile-
error, if no function is overridden, thus avoiding subtle bugs.
Replace "virtual" by "override" where appropriate. Moreover,
replace Q_DECL_OVERRIDE by override, since we require reasonably
recent compilers anyway. Likewise, replace /* reimp */ by
"override" for consistency and compiler support.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Let the menu introduced in commit 5e86442bab
pop up on right-click instead of button-click.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Since these classes do not possess any signals/slots,
these macro are unnecessary.
Likewise, the friend declaration in TagFilter is useless,
since the corresponding fields are in the base class.
Fallout of commit 1a4e7ad0dd.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The TagFilter, BuddyFilter, SuitFilter and LocationFilter classes
all did essentially the same thing. Therefore, factor out common
code / objects into a base class FilterBase.
The new base class stores a pointer to the filter model. It was
felt that this is simpler than introducing virtual methods.
The only thing the *Filter classes now do is setting a label and
in one case a tooltip. Thus, in principle, they could be removed
completely, but let's keep them for now.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
... dialog (part 2)
Show date/time of first/last selected dive instead of displayed_dive.
Thats more useful to identify the right time offset for the images.
Trigger first update of image info already in constructor of the dialog.
Update the results and UI also when the "backwards" radio button is changed.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.
And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.
This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the spirit of "Do the simplest thing that could
possibly work": capture Ctrl+leftclick mouse events
in the Notes area. If the string under the clicked
position is a valid url, then launch it.
Many common URI schemes will work. Typing a url that
starts with https:// will work. So will mailto: and
file://
See #733
Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we have now destkop and mobile versions, 'qt-ui' was a very
poor name choice for a folder that contains only destkop-enabled
widgets.
Also, move the graphicsview-common.h/cpp to subsurface-core because
it doesn't depend on qgraphicsview, it merely implements all the
colors that we use throughout Subsurface, and we will use colors on both
desktop and mobile versions
Same thing applies for metrics.h/cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>