Commit graph

7 commits

Author SHA1 Message Date
Linus Torvalds
e618a245b9 Use proper helper functions for dive location and for_each_dive
This makes the code use the "dive_has_location()" function rather than
check the longitude and latitude directly.

It also uses "for_each_dive()" rather than open-coding it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-22 22:26:12 -08:00
Dirk Hohndel
9e13655854 White space and coding style adjustments for gps.c
It's just nicer this way.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-20 20:28:37 -08:00
Dirk Hohndel
97ce7a3763 Fix map scrolling
The osm-gps-map default is to scroll-and-recenter around the mouse position.
That is BAT SHIT CRAZY. So this implements our own scroll handling instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-20 20:26:15 -08:00
Dirk Hohndel
980ba9cb50 Reuse map windows
Instead of opening a new window / new map for every dive site we now have only
two windows / maps. One for the overview of all the dive sites, the other one
that is used to show the map for a specific dive site.

This also switches the position preference from CENTER to MOUSE - this way it's
less likely that the two map windows will be drawn exactly on top of each
other.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-20 17:07:07 -08:00
Henrik Brautaset Aronsen
e9953fa5e6 Show single dives in map.
This adds a "Show in map" entry in the dive list context menu.  It will
zoom to the dive location if it exists, otherwise the full map will be
displayed.

I've also switched map tiles from OpenStreetMap to Google Maps just to
show off that we can.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-15 17:41:57 -08:00
Lubomir I. Ivanov
2330f9b379 Use the legacy GDK keyboard definitions in gps.c
display-gtk.h has a check if gdkkeysyms-compat.h or gdkkeysyms.h
has to be used. In gps.c, from such as "GDK_Up" has to be used,
so that this file compiles on older GTK.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-14 20:17:20 -08:00
Pierre-Yves Chibon
8ff350387d Work on a dive localisation tool using GPS coordinates
For each dive recorded, place their GPS coordinates onto a map using the
OSM-GPS-MAP library.

This map is accessible via the "log" menu or the shortcut ctrl+M (M as map).

We check for the GPS coordinates "0, 0" which are the default when we do not
have real GPS coordinates set.

[Dirk Hohndel: fixed int/float math confusion, fixed some whitespace and
               coding style issues, cleaned up some comments, added a
	       missing cast to prevent a compiler warning]

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-13 10:08:07 -08:00