Since we now have a selection.c translation unit, put the selection-
related functions there.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The file command_private.cpp had functions concerning selections
only. To make these functions accessible from outside the undo
machinery, turn it into a part of the core-library. Currently,
only C++ functions are exported. We might think about also
exporting a C interface.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The dive-trip models now send changed-events if the shown-status
changed. Thus, there is no reason to fully reset the filter on
filter changes.
Simply tell the filter that it has to react to changes of SHOWN_ROLE.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In analogy to the tree-model send signals when dives change
their shown status in the list-view. Do this in two passes
(collect changes; send changes) to be able to reuse the
already existing functions.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Send signals if the shown-status of top level items changed.
Do this in two passes to be able to use the previously created
function.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
To avoid having to do full filter reloads, send dive-changed signals
for dives in trips when the shown-status changed. But only for trips
where not all dives are hidden. Because for those, the plan is to
hide the trip as a whole.
Implement the signal sending in its own function so that it can be
reused for top-level items and the list-view.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Implementing proper model semantics (only sending a changed
signal for items that actually changed) will be somewhat
complicated. Therefore, move the filtering of trip-items
to its own function to make the nesting a little bit less
deep.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
For deterministic construction/destruction (i.e. objects are
destructed in reverse order of construction) it is crucial that
constructor initializer lists follow the order of the class
definition.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The current png generation is intertangled with the desktop
UI, and a shared Webservice needs to be developed.
Block Radiobutton
Signed-off-by: Jan Iversen <jan@casacondor.com>
The current Webservice implementation is intertangled with the desktop
UI, and a shared Webservice needs to be developed.
Block Radiobutton
Signed-off-by: Jan Iversen <jan@casacondor.com>
DiveFilter have 2 implementation on or desktop and one for mobile,
the common export function uses DiveFilter (desktop version).
Block Radiobutton
Signed-off-by: Jan Iversen <jan@casacondor.com>
All exports are to file except 2 which are upload to web.
Integrate standard qml filedialog for all exports (minus 2).
Signed-off-by: Jan Iversen <jan@casacondor.com>
Prepare page for exporting the diveLog (feature currently
only in the desktop version).
Add Radiobuttons to select type of export
also add "anonymize button"
and a "explain" text field
Subsurface-mobile does not allow selection of dives, therefore
export will always be all dives
Signed-off-by: Jan Iversen <jan@casacondor.com>
Add enum with different export types (used to signal which type
of export QML desires).
Add QML export functions (one for file and one for upload to web)
Signed-off-by: Jan Iversen <jan@casacondor.com>
desktop-widgets/divelogexportdialog.* contains both the desktop
dialog as well as the "real" export functions.
Create a class to be shared between desktop and mobile
Copy the export functions 1-1 from divelogexportdialog.* of course
changing class names.
saveProfile is highly dependent on the UI, so the implementaion will
be done in each UI directory (desktop-widgets, mobile-widgets).
Remark this commit just add the copied functions, in order to secure
nothing is broken.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Recently, undo of dive-replanning was introduced. Therefore,
it appears logical to do the same thing for editing of the
profile of manually added dives.
For now, use the same undo-command, just change the displayed
text from "replan dive" to "edit profile". Move the fixup dive
call into the undo-command.
Eventually, every action on the profile should be made undoable.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add the export of environmental parameters in star widgets to .html format. The
dive rating is always shown both in the condensed as well as in the expanded
view. The other five environmental variables are only shown in the expanded
view. Only those star widgets with a rating are shown: if a star widget has not
been rated in the UI, then it is assumed unrated and is not indicated in the
expanded view.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Provide file I/O for those star widgets that are enabled. The values of the
widgets can be stored to and read from either xml or git.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Connect the UI to the underlying dive structure. Enable proper initialisation
and management of star widgets while Information tab is active. Enable undo for
the addtional star widgets.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Implement the UI features related to the additonal star widgets.
Create the additonal star widgets and connect them to the preferences settings.
By default only the current and visibility widgets are shown. In this case the
current widget is on the left hand side of the tab. If the additional widgets
are enabled the horizontal order of the widegts are changed to reflect
attributes roughly from the start of the dive on the left to those towards the
end of the dive on the right.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create a preference setting on the General Settings page. The setting is saved
with the other preferences.
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As per request from users on scubaforum.com, this adds
the current gradient factor to the deco information of
the infobox. Up to now, this information was only
graphically represented in the pressure bar graph
and the heatmap. This gives a numerical value.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
When selecting all dives via CTRL-A or manually and the trips
were not expanded, the QSelectionModel sends a single
selectionChanged signal per trip. We are reloading the map
in every call, making this very slow.
I couldn't figure out how to make QSelectionModel behave more
nicely, therefore I chose the nuclear option: Remove the map
reloading from selectionChanged() and hook into all functions
that do selection changes. In these functions, first call the
original code and then do the selection-changed operations.
This will certainly need some tuning.
Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Right now in the Ubuntu 14.04 base image for Docker the file
/etc/apt/preferences.d/ubuntu-esm-infra-trusty doesn't exist.
Subsequently, apt-get update enables ESM, but since we don't have a license to
use that upgrades / installs from ESM fail.
This workaround simply ensure that there is such a file pinning ESM to never be
used. With that, the creation of our image should succeed again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These are of course arbitrary. The Android container image for some
reason based its version number on the Qt version. Which may or may
not be a good idea. The other two had 0.x version numbers, so let's
move them to 1.0 for the first release that gets pushed to the
subsurface account on docker hub.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When triggered by a push event, the checkout action checks out the correct branch.
But without this change, the stage 2 action would always run on master.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Based on ideas from Anton - both the basic building of containers in the first
place as well as the workaround for the 6h build limit.
Because GitHub Actions are limited to 6 hours we split the creation of the MXE
container into two steps and push the intermediary container after stage 1 to
docker hub. Right now each of the steps takes about 3.5 hours, so hopefully
even with changes in the future this will continue to work.
This commit also introduces use of docker hub instead of GitHub's own registry
(since strangely right now GitHub actions cannot run containers from GitHub's
private registry).
In order for this to work, we need to have the docker credentials in secrets in
GitHub. As a result, only people who can create branches in our repository can
easily test changes to the container images. Others can modify the code to use
a different docker hub account and provide those secrets in their own GitHub
account. Not ideal, but of course we cannot allow every pull request to
potentially overwrite docker images in our "official" docker hub account.
Suggested-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create Xcode project, allowing easy editing of all sources.
the project uses "make mobile" and "make desktop" to generate the project,
so all CMake changes are automatically updated
the project uses folder references, so adding/removing a source is
automatically updated
The project expect build-mobile and build to be existing as well
as external libraries, so after cloning do a normal build before
using the project.
Signed-off-by: Jan Iversen <jani@apache.org>
Change the remove() function of the cylinder and weight models
to take the index by value. The code used to take it by reference
and the reference would be invalidated when removing rows from
the model!
Reported-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
qml demands all qml files to be in 1 directory, but allows
a "qmldir" file to reference qml files in other directories.
Add qmldir to reference map-widget.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Add flag to subsurface_mobile (only when compiling for desktop)
to allow using qml files from disk instead of resources.
This allows testing qml changes with just restarting subsurface_mobile.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Add -DSUBSURFACE_MOBILE_DESKTOP to CMake, allowing the
C++ part to be different when compiling for a device or
for the desktop.
Signed-off-by: Jan Iversen <jan@casacondor.com>