All those calls are unnecessary:
The first will be called when the QComboBox in the MainTab changes
its index, and the other two calls shouldn't be called: the only thing
that should change a dive site inside the LocationManagement is the
LocationManagement.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I'll connect this in the future with a few methods that will try to
maintain state between dive changes.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We can only enter in editing state by opening the editing dialog, so the
mainwindow check is now invalid. and also we shouldn't set the editingmode
to false, since we will edit until the user clicks close.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we didn't have a proper dive_site_table, the dive sites where
scattered across all dives and so we looped over all dives to find the
dive sites and add them to the tree. Now this is a bit cleaner, a bit
faster.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The globe used to allow the user to pick a dive site if the dive didn't
have coordinates, but this is now wrong since when in dive site editing
mode we can select multiple times new coordinates for it, and it should
only be marked as finished when the user actually finishes it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When setting a dive, we fire the dive site change a few times after the
index of the QComboBox is changed; we don't need that - fire just once.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Clear was the right method to call when we used a line edit, and the line
edit didn't had a model to provide data. Calling clear() on a QComboBox
will delete all itens inside of it, and what we wanted was to choose an
invalid index - and that's -1
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code was commented out when I started to port the locations to new
code, and it's harmless to remove it now.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we are modifying the dive site inside of the dive, we can't ask the
dive for the new one, and we also can't use the name of the dive site, as
there's the possibility that two or more could have the same name, so rely
only on the index of it to get the uuid. The index is variable since we
will sort the dive_site_table alphabetically, but this doesn't matter
since we are using it only temporarely to get the uuid, and this one never
changes.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The KMessageWidget that we used was from an ancient version of KDE4, KF5
is out for quite a while, so it's good that we also update our software
that uses parts of KDE.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I need these to prevent subsurface from segfaulting when opening a new log.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Block size for sample is now variable, so detect the version and parse
proper blocks.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The make install step otherwise will give some odd warnings as it tries to
adjust things from build to deploy.
Signed-off-by: Dirk Hohndel (Intel) <dhohndel@dhohndel-mac02.jf.intel.com>
While in a release we'd want to use the corresponding release branches, it
seems to make more sense to me to switch to the testing branches for Subsurface
master.
Signed-off-by: Dirk Hohndel (Intel) <dhohndel@dhohndel-mac02.jf.intel.com>
So, there's only one crash left (that I put a big TODO: on the maintab.cpp
about) and I'll fix it tomorrow as it's quite late here and I'm almost
sleeping at the keyboard.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I tought about it a bit, and the combobox of the location management was a
bit overkill - we already have another combobox to select the divesite and
also the plus button to add one.
If the user wanna edit the current divesite, he can go to menu and edit it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We are not going to use the add, edit, remove buttons. Removing will be
automatical, addition will be triggered when clicking on the plus on the
dive site. edit is automatically enabled as soon as you try to edit
anything.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly change and update the dive_site, updating the name on the
combobox or other attached views.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also reorganized a bit of the code, and renamed a few misleading methods.
[Dirk Hohndel: remove some C++11 code]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Trigger the ManageDiveSite from the MainMenu.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
GeoLocation discovery would hang if on an incorrectly configured proxy -
this way we will finish as soon as it tries to get everything.
I also need to see what to do with the dive sites if it fails to find any.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Turns out that as of a day ago or so tip of libgit2 master appears broken
(the in memory ssh key test in the cmake file fails). But the specific
commit that I'm picking here appears to work and is also new enough that
https and ssh based cloud storage works.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The credential callback doesn't appear to work (at least not the way I
implemented it) with v0.22 and earlier.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's missing on Windows... we had this helper in liquivision.c but since I
used the function in git-access.c I figured I should just turn it into a
little helper.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far there is no mechanism to actually create a repository on the
server, so this only works with the two test repositories.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cloud storage makes more sense that remote storage - at least I assume
that more people are used to thinking about "storing things in the cloud".
Don't use PIN or passphrase, call it a password everywhere.
Don't use copy_string() to copy the password - the git credentials routine
asserts that password is not NULL, so make sure we at least have a pointer
to an empty string here.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should be asked when we are in dive_site_edit mode.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
run std::sort on the dive_site list inside of the model.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already have the correct number of dive_sites, why use a loop to
calculate it?
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
i is one greater than the number of dive_sites, use the correct nr.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only happens if you dont't have any divesites in your list, but either
way, it could happen.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When changing the index of the combobox we were discarting the
dive_site_id. This fixes it.
Now I need to understand what's happening to the globe.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The LocationEdit now correctly connects to the QComboBox signals, not the
QLineEdit signals.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch updates the DiveLocationModel when the
GeoLoockupInformationThread finishes, and also selects
the correct index for the displayed dive.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I forgot about this one, and we are going to use it
in the mobile version too.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>