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>
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 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>
This is a bit aggressive as it changes the globe with every single
character that's entered, but it's better than what we had before.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We still don't respond correctly to a user changing them (i.e., the map
doesn't change), but at least once they change the dive to a different
dive and back to this one things get done correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Open dive file. Click Location-manage. Pick a site. Click close. Click
Location-manage again. BOOM.
This seems to make sense, but since not a lot of the code is hooked up
yet, I'm not sure this is what we want in the end. But for now it prevents
an easily reproduced crash.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The SimpleWidgets file was getting too big, and location information will
also need a new model - a good way to do not mix everything is to put
things in a new file.
[Dirk Hohndel: added missing include of stdint.h]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>