Rob Norris [Sun, 22 May 2011 09:03:45 +0000 (10:03 +0100)]
Better safety checking to prevent crash due to null variable reference in use of the current trackpoint.
ATM This can happen when the Track/Waypoint layer is selected, then go to toolbar edit trackpoint, then select a trackpoint.
This internally invokes the treeview select_cb layer track callback which highlights just that track but resets the current trackpoint.
Thus an operation in edit trackpoint dialog previously crashes due to attempting to use the null current trackpoint.
Sven Wegener [Sat, 21 May 2011 18:18:35 +0000 (20:18 +0200)]
Fix etag handling
commit fba991f645629444888e099c85d254a621991ac7 ("Fix compiler warning
in curl_download.c") actually broke etag handling by only modifying the
local pointer variable instead of the target it points to.
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Rob Norris [Mon, 17 Jan 2011 10:30:40 +0000 (10:30 +0000)]
Add getting the users confirmation when deleting an individual track or waypoint.
Replace the static iterator in callback array (since it was never used) with the delete item flag.
As a bonus this means no increase to the size of the array and so no need to change everywhere else it is used.
Rob Norris [Sat, 29 Jan 2011 20:24:37 +0000 (20:24 +0000)]
Add new graph type Distance/Time in the track properties window.
Part of request SF#2894245.
Add vik_track_make_distance_map based on the vik_track_make_speed_map function
Refactor graph types into enumeration.
Refactor track_graph_click to simplify redrawing all graph types.
Rob Norris [Sat, 8 Jan 2011 19:49:26 +0000 (19:49 +0000)]
On the Track Properties Window draw an always updating indicator of where the readings are taken from.
Internally this indicator is called a 'blob' (to be different from the marker line indicator) which is drawn in the same function as the track marker (and so is also coloured black), so that the saved image can be updated as necessary. The whole image is now always saved as any part of it could have changed and is restored when the window hasn't changed size.
Rob Norris [Sat, 8 Jan 2011 14:53:49 +0000 (14:53 +0000)]
Add ability to resize the Track Properties window.
Only redraw on initialization and when dialog is resized.
Ensure the saved graph images are reset.
Ensure the track marker is also redrawn.
Improve the statistics text positioning to behave better on dialog resizing.
Rob Norris [Tue, 4 Jan 2011 01:17:03 +0000 (01:17 +0000)]
Restructure the graph drawing functions to only handle a single aspect of functionality. (create or update)
This will allows the main draw update functions to be called as necessary.
To ensure the graphs have been drawn, they are triggered by the window's initial configuration event.
Rob Norris [Mon, 17 Jan 2011 10:33:54 +0000 (10:33 +0000)]
Add support for kml files.
Implicitly attempt to convert to/from the kml filetype via GPSBabel.
Rework the a_file_load return type as an enumeration to help detect GPSBabel failures.
Rob Norris [Thu, 3 Mar 2011 01:21:56 +0000 (01:21 +0000)]
Enable vik_layers_panel_get_all_layers_of_type to optionally return only visible layers.
In selection tool only get visible layers. (especially useful to avoid invisible aggregrate layers)
Maintain full list of (map) layers when invoked from the download_maps_along_track function.
Rob Norris [Fri, 4 Feb 2011 00:15:35 +0000 (00:15 +0000)]
Add ability to move selected trackpoint or waypoint by the mouse within the select tool.
If you want to move the waypoint immediately press shift whilst selecting the waypoint, otherwise one can move it on the second selection.
If you want to move the trackpoint immediately press control whilst selecting the trackpoint, otherwise one can move it on the second selection.
The idea is to prevent accidently moving the item upon initial selection.
Reuse the core of the existing track/waypoint tool move code.
Rob Norris [Mon, 6 Sep 2010 22:18:29 +0000 (23:18 +0100)]
Add a new select tool at the window level to enable/disbale item selection of the a track or a waypoint.
This may be from any track/waypoint layer upon left mouse clicks in the viewport.
A right mouse click in the viewport brings up the context menu for the track or waypoint selected, which can be used in the normal manner.
Left mouse clicks not near a track or waypoint clears the currently selected item.
Rob Norris [Fri, 13 Aug 2010 22:15:36 +0000 (23:15 +0100)]
Add track and waypoint highlight for the selected layer or individual item.
Adds VikLayerFuncLayerSelected callback property into the layer, so that action can be taken by the each layer code.
The treeview on selection invokes the layer selection callback. The trwlayer on the selection callback, stores the selected item into the window, and turns highlight on or off as appropriate.
Provided the draw highlight mode is on, the drawing of selected track(s)/ waypoint(s) item(s) is amended, such that a selected track is shown in the highlight colour;
a selected waypoint has it's text background of the name drawn in the highlight colour or if it has an image associated with it, then that is shown with a highlighted border.
ATM the highlight colour is hard coded to orange.
Rob Norris [Sun, 5 Sep 2010 18:36:05 +0000 (19:36 +0100)]
Add the storage and retrieval of any kind of track or waypoint selected item (either an individual item, list (i.e. a sublayer) or layer) at the window level.
This implementation is quite rude as:
* logo is built-in, while a right solution would be to download
the logo and caching the result in viking's cache.
* attributions are downloaded at first need, without automatically
refreshing vikviewport, while a right solution would be to cache
the file in viking's cache.
Some providers use different copyright at different zoom levels or
different world region.
This is an initial implementation. By some aspect it is a rude patch.
Currently, VikViewport asks VikMapsLayer which asks VikMapSouce
which calls back VikViewport via function callback. This seems the
simplest solution to transmit many copyright per map provider without
affecting performances and without changing too many interfaces.
A better/cleaner solution could be to add a get_copyright method on
VikLayer. By this way, VikViewport can pick copyright directly from
owner (Vikayer) and only when needed (for example only when showing
or hiding a Layer).
Rob Norris [Fri, 31 Dec 2010 18:22:52 +0000 (18:22 +0000)]
Add Track->Split by Number of Points (as per SF#2847587 request).
This uses the new dialog to get a positive number, so the user can specify the number of points to split by.
The algorithm for the split by number of points method is derived from the split by time method.