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>
Making this persistant creates a very unpleasant user experience.
And if a dive computer needs this setting, we really want people
to report this to us so we can fix it.
Fixes: #2358
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code seemed to do something really reasonable by picking one of the
supported OSTC versions - except that the one it picked didn't support
BT/BLE and therefore our logic of recognizing dive computers on iOS
failed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We now get a working macOS DMG for each CICD release via the webhook -
and the GitHub built .app.zip only worked on the latest macOS and was
near-unusable there.
We still make it available as an artifact of that macIS GitHub action in
case there is some value, but we no longer push it into the GitHub
release artifacts.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I was reminded to do this when a user in French speaking Switzerland reasonably
suggested that fr_FR would be a much better fallback than en_US in their
situation.
Fixes: #2388
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The function had only one line and had only one caller.
We might just as well fold that line into the caller.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
By clearing the model, its contents are removed. There is no
point in reloading the model.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The DiveListModelBase::clear() implementation was flawed: It cleared
the data in the core, but left the data in the model untouched.
The code was relying on the fact that the caller would reset the
model manually. Not a good idea.
Therefore, clear the internal data to keep the model consistent at
all times.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The hidden_by_filter items are set on reload of the dive list.
No point in reloading the filter again.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The way this was accessed via Qt's model semantics was horrible.
This gives arguably more readable code, since we don't have to
shoehorn things through QVariants.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Split out the actual filtering from the MultiFilterSortModel.
Create a DiveFilter class that does the actual filtering.
Currently, mobile and desktop have their own version of this
class, though ultimately we may want to merge them.
The idea here is that the trip-model and undo-commands have
direct access to the filter-function and thus can take care
of keeping track of the number of shown dives, etc.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The filter-model was catching dives-added / dives-deleted signals
from the models to keep track of the number of shown dives.
To simplify the data flow, do this directly in the undo-command.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We mark hidden/shown dives in the core but store the number
of shown dives in the MultiFilterSortModel. Move this datum
to the core for improved locality.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>