9efb56e2d4 added code to rearrange
pictures on drag'n'drop. To keep the correct repainting order (i.e.
later thumbnails are painted on top of previous thumbnails), the
z-value was set accordingly. In principle a sound idea, but it did
not work out, because on hoverEnter and hoverExit events, the z-values
were modified, thus restoring the wrong drawing order.
Instead, use the QGraphicsItem::packBefore() function. Experimentation
showed that this only works if stacking is done from the back
of the list.
Silence an erroneous compiler warning by initializing a variable to 0.0.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
On top of the file filter for all media files add a file filter
for images only, one for videos only and one for all files.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This changes the above mentioned terms everywhere in the UI to
reflect the fact that Subsurface now also supports video files on top
of image files.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
DISK_LOADSYNC_INT used double correct to int
DISK_LOADSYNC_INT used double correct to int
Signed-off-by: Jan Iversen <jani@apache.org>Signed-off-by: Jan Iversen <jani@apache.org>
SettingsObjectWrapper contained some delicate font handling mixing font and
font_size, breaking that into 2 parts broke font handling on some platforms
Copy font + font_size handling 1-1 from SettingsObjectWrapper
Signed-off-by: Jan Iversen <jani@apache.org>
Whereas extraction of the dive-duration is trivial, AVIs don't seem
to have a standardized way of saving the creation time. This commit
implements support for two versions randomly found on the internet.
Additional version will follow if need arises. AVI seems not to be
a particular popular format for either vacation or professional
videographers.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We want the duration of videos for two reasons:
- To display the duration of the video in the profile plot.
- To be able to determine which dive a video is closer to if the
start is not during a dive.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Gracefully handle drag & drop to the profile, which changes the
offset of the pictures. To do this, keep the pictures in the
DivePictureModel and the ProfileWidget2 sorted by offset and
re-arrange if needed to keep the list sorted. This needs some
code reshuffling.
Introduce a helper-function that moves ranges in arrays.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If pictures were deleted, the remaining thumbails where staying at
their positions. Only when switching between dives, the new positions
were recalculated. Do the recalculation immediately. More precisely:
the x-coordinate, which is determined by the timestamp, stays identical.
Only the y-coordinate is recalculated such that overlapping of thumbnails
is avoided.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Disables the WindowContextHelpButtonHint by default on Qt::Sheet and
Qt::Dialog widgets. This hides the ? button on Windows, which only
makes sense if you use QWhatsThis functionality.
This value has been added in Qt 5.10.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
When I switched over from our own custom IO implementation to the new
upstream custom IO model in libdivecomputer, I completely missed the
fact that the libdivecomputer custom IO model also does a custom _sleep_
function.
I'm not entirely sure what the point was, and it broke things even in
libdivecopmputer itself when some of the new sleep functions were
broken.
Anyway, we didn't export any sleep functions at all for the bluetooth,
BLE and FTDI cases, the the libdivecomputer code didn't fall back to any
sane default sleep implementation either, so the end result was no
sleeping at all.
Which didn't matter for most divecomputers.
But it seems like at least some OSTC dive computers did care, at least
in certain situations, and both Miika and Anton had trouble downloading
with their OSTC Sport dive computers. Using the serial line protocol
and the legacy /dev/rfcomm model worked fine, because then it used the
sleeping functions in the POSIX serial code inside libdivecomputer.
This just adds trivial sleeping functions for the affected download
protocols. Maybe I should have just made libdivecomputer have a sane
default instead, but this wasn't hard either (the hard part was trying
to figure out why the downloads worked for some people and not for
others).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
When we introduced the whole check for supported transports code, no one
noticed that it broke configuring all ostc's over bluetooth.
The configure code just used a placeholder model of OSTC 3 to get the
right backend code. With the new supported transports model it errored
out if you where trying to connect to a bluetooth enabled device, just
because the original OSTC 3's wasn't bluetooth enabled.
This switches the placeholder model over to a OSTC Plus which is both
bluetooth, serial and ble capable, so the code works again.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Allow Derek to modify labels and milestones and add a few more of our
contributors to the list of people allowed to give Derek commands.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The information on how to build smtk2ssrf was pretty outdated.
Update this information and point to subsurface downloads repo for
windows installer and linux appimage.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
The QML types needs to be registered before the MainWindow
instance is created on the desktop version, otherwise
the MapWidget instance will be created and it will fail
with a missing QML namespace.
In subsurface-helper.cpp, move register_qml_types() from run_ui()
to init_ui(), as later in init_ui(), MainWindow is instantiated
for the first time in the desktop version.
Ref #1500
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
add test cases to secure struct preferences and qPrefAnimations work together
remove animation tests from testpreferences
Signed-off-by: Jan Iversen <jani@apache.org>
remove Animations from SettingsObjectWrapper and reference qPrefAnimations
update files using SettingsObjectWrapper/Animations to user qPrefAnimations
this activated qPrefAnimations
Signed-off-by: Jan Iversen <jani@apache.org>
Update set/get functions to follow common name scheme:
- get function have same name as in struct preferences
- set function have set_<name in struct preferences>
- signal function have <name in struct preferences>_changed
one class one .h/.cpp is the C++ idiom. Having load/sync of each
variable in 1 functions (in contrast to the distributed way SettingsObjectWrapper
handles it) secures the same storage name is used. Having the set/get/load/sync
functions grouped together makes it easier to get an overview.
REMARK: this commit only defines the class, it is not active in production
Signed-off-by: Jan Iversen <jani@apache.org>
remove test macro, split in functions and add test cases
the existing test macro does not work because
sync() does not save these variables to disk (set* does)
Signed-off-by: Jan Iversen <jani@apache.org>
ensure SettingsObjectWrapper load() loads all display variables.
Copy font setting code from SettingsObjectWrapper to qPrefDisplay
Signed-off-by: Jan Iversen <jani@apache.org>
Add qPrefDisplay sync to sync in SettingsObjectWrapper.
If a program part change display variables in struct preferences, they would
not be saved on disk.
Signed-off-by: Jan Iversen <jani@apache.org>
add the prepared class qPrefDisplay to SettingsObjectWrapper and thereby making it active.
As a consequence of the uniform naming standard desktop-widgets/preferences_defaults.cpp and
tests/testpreferences.cpp have been updated.
Signed-off-by: Jan Iversen <jani@apache.org>
add subsurface-helper.cpp to TestQML target
remove local qmlRegisterType() and add register_qml_types() instead
Signed-off-by: Jan Iversen <jani@apache.org>
With Qt 5.11 the qml compiler is included and qmlc files created in the same
directory as the qml file (at least for the qml test harness).
ignore *.qmlc
Signed-off-by: Jan Iversen <jani@apache.org>