It turns out that I forgot to make sure that the progress bar is shown if
the user has things set up so that the cloud storage is the default dive
file that they open.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the authentication check and cloud server availability check which
are different from the one git does. The mechanism for overriding things
is different from there, but this should work just as well.
We intercept the SslErrors signal and if we get the known good hash for
our certificate, we simply call it good.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While the whole idea of calling these functions through the MainWindow
instance is atrocious, until we change the architecture of all this
refreshProfile() is a useful function to have.
In order to make this cleaner to implement I allowed an argument to
ProfileWidget's replot() which allows picking a specific dive. By
defaulting this to 0 we get the previous behavior when calling replot()
without an argument.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch changes the dive merging to be much more careful about
things, because it turns out that we had several small oddities that
caused big merge issues.
The oddities are:
- the dive "duration" is actually how long we spend under water.
But that means that when we do "dive->when + dive.duration.seconds"
to calculate the end of the dive, that is nonsensical if you came up
to the surface in the middle of a dive.
Now, normally you don't see profiles like that, but once you start
merging dives together, it can go from "small detail" to "dominant
factor".
- We have two different cases of merging: the automatic "merge new dive
computer download if it looks like the same dive" (which always has a
merge offset of 0, since we merge it as a new dive computer) and the
"merge two different dives into one longer dive.
The code assumed that it could look at the "downloaded" flag for the
dive to check one or the other, but that doesn't really work.
Reading a dive from an XML file isn't any different from downloading
it.
So we need to change the logic to determine what kind of merge it is
to actually check the passed-in time offset.
With this, Stuart Vernon's test-case of eight dives with short surface
intervals in between end up merging correctly into one dive.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Stuart Vernon <stuartv@force2.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems this has never worked and nobody ever tested it. There was some
confusion with time zones since Qt takes by default local time when
converting from/to epoch while the exif library used UTC.
For my single test dive, this works now. But this needs more testing!!!
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I'm not quite sure why this works, but it appears to do the trick.
Apparently you are supposed not to have the meta type declaration in a
shared header file. Also, with Qt5.5 you can't have the declaration for
QBluetoothDeviceInfo, not even on Windows.
This may need more tweaking to make sure it works on all combinations of
OS and Qt version.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Passing the cloud URL to the file select box leaves "git syntax" in the
filename which makes us look for a directory with a git repository in it
and give non-sensical error messages to the user.
With this we simply use the users email address as local filename with a
.ssrf suffix.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The logic to pick the initial dive ID for the uemis downloader was very
confused, and did not work at all when restarting a download when the
Uemis filled up, and the "Force download all dives" flag was set. It
also required a rather odd Uemis-specific callback from the download UI
because of how it picked the initial ID.
This changes the logic to just look at the list of downloaded dives when
restarting, which simplifies the logic a lot, gets rid of the odd
special callback, and also means that the whole "Force download" issue
just goes away. It seems to work now.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On some Windows platforms when we convert a Bth address to a String
it is formatted as "(XX:XX:XX:XX:XX:XX)". Therefore we first try to
remove the round parentheses and finally we truncate the string
to 17 because there are 6 two-digit hex values and 5 colons.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Spell Setpoint without space in user visable strings.
Explain authorized_paired.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now inplace edit is supported, so enable editing the "Default"
statistics template, Also show warning when editing this template.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When editing a bundled template show warning message.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Edit the templates into the same file, which is more intuitive as
Custom.html is a bit confusing.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The current way that facebook works is terrible: it's scattered
around tons of files ( at least 4 different files and classes )
this moves things around a bit, add a disconnect button that
was missing, cleans tons of code and fix inconsistencies.
I will also redo this part for 5.0, but it's too late for 4.5
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Unify spelling of this name in strings shown to the user, as commented
in mailing list. Internal coding use untouched.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Our OSTC 3 config code works for all hwOS devices, so be more clear when
saying that as the chooser option.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This connects up the custom serial code in the configure dive computer
dialogs.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When working with ostc's via bluetooth, they will reboot and exit
bluetooth mode when you send the disconnect command. Thats kinda
inconvenient when you would like to read your settings, change something
and write it back, you need to start bluetooth mode on your device
twice.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In a user provided sample the last column name included "\r\n" which
prevented us from automatically matching that column.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The fixup_dive() function assumes that values that are set already in the
divecomputer and dive structures come from a reliable source - sometimes
dive computers are able to track a maximum depth continuously, so that
value can be larger than the deepest sample and we need to honor that.
But in the case of a manually added dive, the samples define the dive. So
in this case we need to reset the values that were calculated when the
dive was first added so that the user can then edit the dive and reduce
the maximum depth reached in the profile and have that reflected in the
dive list.
Fixes#926
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Give the user the possibility to attach images to a dive even
when the times do not match
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the gas selection list on a waypoint refers to a gaschange there
influencing the following segments, there must not be a gas selection
on the last manually entered waypoint since from there the planner
handles the gas selection.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds delegates to simplify configuration of setpoint values in the
OSTC's.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The table data is set via role, so retrieve the data via role too.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This switches to use the closeEvent to save settings and cleanup instead
of the destructor.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the spinner caused all kinds of problems inside VMs, wasn't shown at
all for some people on Win10 and appeared to get stuck a lot and still
left people with the perception that Subsurface was hung, this patch takes
a more traditional approach and gives the user a progress dialog.
An additional benefit of this is that the user now can cancel a hung
transfer.
The slightly weird passing in of the callback allows for the separation of
UI and core logic code...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subsurface crashes when multiple dives are selected on divelogs.de
export. The crash occurs on malloc that is called indirectly from
xmlReadMemory().
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This if'defs DC_TRANSPORT_* use with SSRF_CUSTOM_SERIAL, because the
enum doesn't exist when building against stock libdivecomputer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Bluetooth implementation doesn't work if SSRF_CUSTOM_SERIAL
is undefined. Therefore it is a good idea to remove it from
the UI if the libdivecomputer version is wrong.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the Bluetooth download mode was disabled then remove
the Bth address from the device or mount point section and
reset the index.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Save the dive computer download mode flag. In this way,
if the user used Bluetooth mode to download its dives on
his last session he doesn't need to open the Bth selection
dialog if he wants to use the same device.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Due to the new dive site management, we need to include this information
before transforming the XML to divelogs.de format.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need at least 23 columns when reading in Subsurface CSV.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Let's set the configs properly for Subsurface CSV import for better
usability. (Actually the only meaningful configuration is units as
others are discarded, but I could not figure out how to set that to
imperial when needed - what is the variable holding this information?)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Showing the header line improves user experience quite a bit, even
though this configuration is actually discarded in the XSLT transform.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When adding APD2 import, the Sensus and Subsurface indexes should have
been increased by 1. While fixing this, switch to using enum names for
clarity.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The skipping of header field manipulation for APD was a bit too
aggressive, skipping the header fix up for all logs when on initial
state. Also, addition of APD2 was not taken into account.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In btdeviceselectiondialog.cpp ON and OFF strings need to be
translatables to avoid issues in the translation of the resulting
displayed string, as "turn on" and "turn off" translates to a single
word in most languages.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Changes to capitalisation to comply with coding style
Changes to make some blocks of english sound a bit better
Signed-off-by: Tim Wootton <tim@tee-jay.org.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After an incorrect upload I can no longer fix the source tar on launchpad.
Oh well, so now Beta 1 is 4.4.96. No big deal.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The changes in commit 3bcb634e06 were a bit over ambitious. There was a
reason why I had this hack in place and preparing for the beta reminded me
of that. Oops. Oh well. The code is back, adapted for the current release
cylcle.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This enables enables you to configure a couple more settings in the
OSTC devices, roughly corresponding to the new ones that can be
configured in the OSTC3 devices.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This enables enables you to configure a couple of new settings in the
OSTC3 devices.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The DeviceDetails class is just a storage container for passing values
back and forth between backend and ui code. The different names between
the setters and getters just made it a pain to write nice macros and
keeping the two ends in sync, so this just removes the setters and
getters in favor of having the members public.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small, Small screen. why are you still used today?
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And also show a warning to the user saying that that
action is non-cancelable.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Get the Qt data structures and convert to something
that we can use in our C - core.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We where showing the UID, wich didn't made sense.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So we can merge them later - currently we are showing
only the ID, ugly - fixing next.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a new widget on the dive site management view to
display all other dive sites at the same coordinates.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The UI detects when it should refresh the loction after the
user finished editting a divesite. Creating and editting
divesites is now working even when the current dive is not
saved yet.
Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update the tooltip and enable only when there is a divesite selected
Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use clicked instead of activated signal on the completerList to
handle the selection of a divesite.
Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A divesite uuid is created using the timestamp of the currently
selected dive. When there is no current_dive, use the current
time to create a uuid.
Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If localDevice isn't valid we never initialize the discory agent, so
let's not dereference it in the destructor unless it is valid.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Continuing the crusade against excessive number of parameters for some
functions. This should be the last of the import functions to be cleaned
up.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
At least on Ubuntu with xfce instead of Unity this appears to be necessary
to get a menu bar for the application.
Fixes#833
Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When, in a dive edit mode user entered a dive site
and went to dive site edit mode then finished the ds
edit, the app would lose the disabled property of the
dive list, making it possible to select a new dive
when we where editing another one, complete mess.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the user clicks on the first or second option of the drop
down list, subsurface will move him to the dive site edit panel
automatically, since it's a new dive site and there's no information
about it yet.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we are in display dive mode, and then edit the
location text edit, going to edit dive mode, the location
text edit will be moved a bit below of it's original position
but the Dive Site List would be already opened, and stuck
on it's original position, covering the dive list.
This patch fixes that.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Moved the get taxonomy button from the maintab to the edit dive site
widget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The get taxonomy button will be inside the manage dive site interface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I didn't have time to create / finish the photos widget, so
I'm adding back the profile view while in dive site edit mode,
but disabling it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now this is quite ugly. And at least in my VM the transparency
doesn't seem to work correctly. But at least we now have some visual
indication that we are doing something while opening or saving cloud
storage.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This removes the excessive amount of parameters on manual CSV import. We
just use appropriate string array than can be directly fed to XSLT
parsing.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Having random uuids seemed like a good idea, but there are several
situations where they really cause problems. One is merging dive file
imports from V2 logfiles. Another is testing such imports.
Instead of making the uuid random we now hash the name and add the
timestamp of the first dive associated with this dive site to the hash
(first in this context is "first encountered" with no guarantee that it is
the chronologically first). This way V2 imports create deterministic uuids
but uuid conflicts are still extremely unlikely, even if the user has
multiple dive sites with the same name.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Gas switch is not part of recreational mode, so disable the switch options.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Editing statistics templates is not supported now, as there is no
custom template for statistics printing, so disable the template
edit area.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
The new statistics code, enable the editing of colors, font, and other
template options.
This patch enables the UI elements for these features.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
- use the same generic code for both types of templates
- check for the printing type before generating the template
- remove unused printStatistics() method
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Show the existing templates based on the print type selected
by the user.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Template names was capitalized, so change the file name to
"Custom.html" instead of "custom.html"
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
After a replot, check if there is an error message to display.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Each state can have the same widgets but with different
properties - currently I'm using "enabled" : true and false
for the DiveSiteEdit, it looks like a big amount of code
for such a small thing but it was the cleaner way that
I tougth of doing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>