This class will surely be used on the mobile version, and it was very
tangled inside divepicturewidget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Models.h now is quite minimal, I'll keep it like that for now, until it
grows huge again. I've also cleaned a bit the headers that are using it so
only the ones that actually need the stuff that I've left behind will
actually include this file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
TreeModel is the base of some important models in Subsurface, the
statistics model and the dive list models, this second is the most
important one in the whole Subsurface universe.
This commit is another one in the series to make easy to create a mobile
version of Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another attempt to make it easyer to create the mobile version of
Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another attempt to make it easyer to create the mobile version.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
One more step to make it easyer to port the app to Mobile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is another effort to make it easyer for the mobile
interface of Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another change to make it easier to program the mobile ui. This was a
fairly easy patch: just moved the contents of the file and fixed the
includes.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Still trying to make it easier for the Mobile Port:
This patch is a bit bigger than I hopped, but it was the smallest that I
could get.
A lot of TODO items where added where I broke the code because the current
implementation would break the QML implementtion on the designer. I'll
most probably fix those myself when I finish the transition to the models
to the new folder.
I only moved both models at once because there's an interdependency
between them (seems inevitable, tough, but I'll take a better look at it
later).
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
models.h / .cpp was getting too big (around 2.5k lines), and each change
triggered a rebuild in tons of parts of Subsurface, this is the first
commit trying to make the models code sane by removing them all of the
models.h/cpp file and also clearning code in the process.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is an attempt to help share code between the desktop version of
Subsurface and the mobile version.
More code will be moved around and the models will be split in a way that
will help recompile times and also creation of different interfaces for
different form-factors.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Corrects typo in ebaa7d1fd which impeded that changes in dive rating
were saved after editing.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I was afraid that this would only work with a farily current git master of
libgit2 and it turns out I was right. The API was available, but the
correct type wasn't.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows entering / storing the PIN (aka passphrase) for the ssh key.
The email isn't used, yet - this will be used by the automated backend to
create a unique git repository that will turn into the remote storage.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The key location is hard coded as this is only intended for our own
infrastructure, so we don't need multiple keys.
If the private key is protected by a passphrase, this needs to be manually
added to the preferences. As RemoteStorage->passphrase.
This has only be tested with a current version of libgit2 master, but
should compile with any previous version (the API doesn't exist in v0.19
and earlier - that's handled with appropriate #if clauses).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While we don't expose it as this to the user, we'll need an ssh key and
potentially a passphrase in order to communicate with the git server in
our infrastructure. This simply sets up a way to store the passphrase.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Just as we would expect, the libgit2 developers of course once again broke
their API. In order to compile against current master we need to remap
those APIs once again.
Simply call cmake with -DUSE_LIBGIT23_API
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
clang complais when converting (char *) to (unsigned char *), so tell
it it's fine.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This copies peaces from the downloadfromdivecomputer dialog into the
configuredivecomputerdialog and connects them to be able to create a
logfile form the configuration of the divecomputer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This implements support for writing debug/diagnostic logs when
configuring dive computers and upgrading the firmware.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There is no reason for the DeviceThreads to keep a copy of the last
error around, so this removes that code.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This moves the dc_device_close call inside the if case for
dc_device_open, to get rid of the special error case and to look and
behave the same as the other ::run calls.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For some reason the file selection dialog box now always adds a default
suffix to the file name we pick - which results in our test for git
storage to fail.
So if the filename looks like "<path>[branch].ssrf" then remove the suffix
that was added.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Emitting the stopFilterDiveSite signal caused us to clean up the UI which
reset currentDs to NULL if this was a new dive site...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It doesn't matter if we first enter coordinates, name, description or
notes. If there is no currentDs we need to handle that gracefully.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When double clicking on the globe on a dive with no dive site we did
almost the right thing - except that we didn't create a dive site.
Not 100% sure this is the right place to do this, but it seems to work and
prevents the crash.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While filtering we would have trips that were collapsed, but this doesn't
really make much sense while managing dive_sites.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Untested code to filter out dives that are not at the active dive_site.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dive site management requires that we filter all the dives that are on
the current dive_site, this is the preparatory work for that.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old way we set the location and *then* updated the model, so the very
first location that we tried to show was empty.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When triggering the dive_site management, we need to get the uuid that was
send to us and set it as the current dive_site on the combobox, the dialog
can fill all required info for us.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We will however create a new dive site when the user clicks on the add
button - creating it here would led to strange behavior.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
setLocationId will filter the dives, so ignore the visual changes when
accepting / rejecting, it will only be triggered again when we are showing
this dialog again.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We should only set the dive_site on the dive site management widget when
we are going to use that information, this is because the dive_site
management widget will filter all dives on the dive list.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
this is the format used by Google maps and thus this...
Fixes#875
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The default RFCOMM channel is 1, not 0 as previously stated in FAQ and
user manual. This patch corrects it.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The suit field should take up all the remaining space and the stars should
be vertically centered with the text.
This looks much better
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The parent here should have been the mainwindow, but we create this dialog
on the stack instead of the heap and because of that we don't set the
parent to prevent a double free.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>